Skip to content

Commit b0ce3f7

Browse files
claude[bot]claude
andauthored
chore(cli): retire SCAFFOLD_TSX_RANGE, a conditional statement nothing satisfies (#16951)
The `os create example` template was the only emission that ever declared a `tsx` range; once it was retired the constant reached no scaffold at all. Its docblock -- "The `tsx` range a scaffolded project declares when its scripts need it" -- is not a false statement but a conditional whose antecedent nothing on the tree satisfies. Vacuously true, so a review hunting false statements never catches it; what it misleads is the reader's default assumption that some scaffold satisfies the antecedent. The constant and its docblock are removed together. No surviving emission should declare `tsx`: all four (`os init -t app` / `-t plugin` / `-t empty`, `os create plugin`) plus the bundled `create-objectstack` blank template run every script they emit through `objectstack`, `tsc` or `vitest`, none of which executes a `.ts` entrypoint directly. `@objectstack/cli`, which each of them declares, already carries `tsx` as its own dependency. No assertion is added for the retired range. The comment in `test/scaffold-emission-policy.e2e.test.ts` is updated to describe the retirement rather than the intermediate state, keeping its rule intact: a row is owed by a range some emission really declares, and by nothing else. Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8 Co-authored-by: Claude <noreply@anthropic.com>
1 parent f36eef5 commit b0ce3f7

3 files changed

Lines changed: 46 additions & 7 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
chore(cli): retire `SCAFFOLD_TSX_RANGE`, a conditional statement nothing satisfies
6+
7+
`SCAFFOLD_TSX_RANGE` and its docblock are removed from `src/commands/init.ts`. The
8+
`os create example` template was the only emission that ever declared a `tsx` range,
9+
and its retirement left the constant reaching no scaffold at all.
10+
11+
**The docblock is the reason, and it is not a false statement.** It read *"The `tsx`
12+
range a scaffolded project declares **when its scripts need it**"* — a conditional
13+
whose antecedent no longer holds anywhere on the tree. Vacuously true, so no review
14+
looking for false statements catches it; what it misleads is a reader's default
15+
assumption that some scaffold satisfies the antecedent.
16+
17+
**No surviving scaffold should declare `tsx`, measured rather than assumed.** All four
18+
surviving emissions (`os init -t app` / `-t plugin` / `-t empty`, `os create plugin`)
19+
plus the bundled `create-objectstack` blank template run every script they emit through
20+
`objectstack`, `tsc` or `vitest`; none executes a `.ts` entrypoint directly, which is
21+
the only thing `tsx` is for. The capability is not missing either: `@objectstack/cli`
22+
— which every one of those emissions declares — carries `tsx` as its own dependency.
23+
Declaring it a second time in a scaffold would have announced a lower floor
24+
(`^4.21.0`) for a tool the project never names.
25+
26+
**Nothing importable is withdrawn.** This package's `exports` map is `.` / `./console`
27+
/ `./hook-body` / `./package.json`, with no subpath pattern, and `src/index.ts`
28+
re-exports only the oclif command classes — so no consumer could ever import this
29+
symbol. It is a `patch` and not a breaking change for that reason, but it is not
30+
`skip-changeset` either: the CLI builds with plain `tsc`, so the constant really did
31+
ship. Measured across a before/after build of `packages/cli`, four files inside the
32+
published `files[]` move — `dist/commands/init.js`, `dist/commands/init.d.ts` and both
33+
`.map` siblings — and the other 496 are byte-identical.
34+
35+
No assertion is added for the retired range. `test/scaffold-emission-policy.e2e.test.ts`
36+
already records why: a row in that table is owed by a range some emission really
37+
declares, and by nothing else. Its comment is updated to describe the retirement rather
38+
than the intermediate state it used to describe.

packages/cli/src/commands/init.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ export const SCAFFOLD_VITEST_RANGE = '^4.0.0';
317317
/** The `@types/node` range a scaffolded project declares. */
318318
export const SCAFFOLD_TYPES_NODE_RANGE = '^22.0.0';
319319

320-
/** The `tsx` range a scaffolded project declares when its scripts need it. */
321-
export const SCAFFOLD_TSX_RANGE = '^4.21.0';
322-
323320
/** The zod range a scaffolded project declares when it authors schemas. */
324321
export const SCAFFOLD_ZOD_RANGE = '^4.3.6';
325322

packages/cli/test/scaffold-emission-policy.e2e.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,14 @@ describe('scaffold emission policy — one definition, four emissions', () => {
204204
it('emits the exported constant rather than a literal, for every policy range', () => {
205205
const ranges = declaredRanges();
206206
// ⚠️ `tsx` left this table with #16483: the retired `os create example`
207-
// template was the only emission that declared it, so `SCAFFOLD_TSX_RANGE`
208-
// now reaches no scaffold at all. Asserting it here anyway would compare an
209-
// empty harvest against the constant and go red on a correct tree; a row is
210-
// owed by a range some emission really declares, and by nothing else.
207+
// template was the only emission that declared it. `SCAFFOLD_TSX_RANGE`
208+
// has now been retired with it — every surviving emission runs its scripts
209+
// through `objectstack`, `tsc` or `vitest`, none of which is invoked as
210+
// `tsx`, so no emission declares that range. Asserting it here anyway
211+
// would compare an empty harvest against a constant and go red on a
212+
// correct tree; a row is owed by a range some emission really declares,
213+
// and by nothing else — so this table grows a `tsx` row only after some
214+
// emission declares one, never to keep a constant company.
211215
const expected: Array<[string, string]> = [
212216
['typescript', SCAFFOLD_TYPESCRIPT_RANGE],
213217
['vitest', SCAFFOLD_VITEST_RANGE],

0 commit comments

Comments
 (0)