Skip to content

chore(cli): retire the abandoned tsup build path - #10601

Merged
os-elon merged 1 commit into
mainfrom
claude/issue-10185-retire-cli-tsup-config
Aug 21, 2026
Merged

chore(cli): retire the abandoned tsup build path#10601
os-elon merged 1 commit into
mainfrom
claude/issue-10185-retire-cli-tsup-config

Conversation

@os-elon

Copy link
Copy Markdown
Collaborator

Fixes#10185

Retires the abandoned tsup build path in packages/cli: the tsup.config.ts, the orphaned src/bin.ts, and the now-unused tsup devDependency.

The history check came first, and it cleared the deletion

Triage made the history check a gate on the deletion, not a formality. The clone in this container was shallow (275 commits, every file forged as "added" at the graft boundary), so it was unshallowed to 10,529 commits before any of this was answerable — the first pass returned one bogus commit per file and would have been worthless evidence.

bbea22f350 (2026-02-18) is the pivot. One commit moved packages/cliaway from tsup:

- "build": "tsup",
- "dev": "tsup --watch",
+ "build": "tsc -p tsconfig.build.json",
+ "dev": "tsc -p tsconfig.build.json --watch",
- "objectstack": "./bin/objectstack.js",
+ "objectstack": "./bin/run.js",
+ "oclif": { "commands": { "strategy": "pattern", "target": "./dist/commands", "glob": "**/*.js" } },

The direction of travel is documented and it points away from tsup — and the reason is structural: oclif's pattern strategy needs one emitted file per command under dist/commands/**, which tsup's entry-bundling does not produce. That is also exactly why running the leftover config is destructive. The config was simply left behind by that commit.

The only later touch, 55ac75d730 (2026-06-05), edited 12tsup.config.ts files in one mechanical sweep with the same one-line dts: true to dts: !process.env.OS_SKIP_DTS change. A repo-wide sweep, not a CLI revival. No deliberate future direction exists, so the fallback (make the config non-destructive) does not apply.

The other three checks, each proven separately

  1. Nothing invokes it — proven from four independent sources, not inferred from one: package scripts (build/dev are tsc, test vitest, typecheck tsc, check:app-nav-i18n node — zero tsup); turbo.json (no @objectstack/cli#build override, only #test; the globalDependencies: ["tsconfig.json", "tsup.config.ts"] entry is root-relative with no **, so it names the root config); .github/** (every tsup hit is prose about other packages); and content/** docs (zero hits). It is also in no tsc program at all — the package tsconfig is include: ["src"] and the root one excludes packages.
  2. src/bin.ts is genuinely orphaned — the check the brief flagged as the trap, so it was checked against what oclif resolves, not against imports. package.jsonbin names ./bin/run.js for both objectstack and os; oclif resolves commands from ./dist/commands and its hook from ./dist/hooks/**; bin.ts is in none of them. Its only referrer repo-wide was the dead tsup entry. dd1e67bbda gutted it from a 103-line Commander program to a 13-line re-export in the same migration that created bin/run.js — it is the carcass of the pre-oclif entry point. The barrel already says so in src/index.ts: "The CLI entry point is bin/run.js, and now the barrel says so."
  3. tsup is unused elsewhere in the package — its only live mentions were the config's own import and the devDependency line (the rest are CHANGELOG history). The lockfile diff is 3 lines; tsup stays for the packages that really build with it.

Verification: the command surface, before and after

"Tests still pass" would prove nothing here, so the check is the one triage asked for — the command list oclif actually resolves, compared across the removal. Both legs are clean builds (rm -rf dist first), enumerated through @oclif/core's own Config.load — the same path bin/run.js takes:

beforeafter
commands6060
topics6868
files in dist/commands5959
dist/bin.jsemitted (432 B)not emitted

diff of the two full surface dumps (id + aliases + sorted flag names per command) exits 0 — identical. The sole build-output difference is the dead dist/bin.js disappearing, which is the artifact being retired. Live check through the published entry point after removal: node bin/run.js --version, --help and info --help all exit 0 with the full topic list intact.

Gates, all at e983eb3f25 (the final commit), re-derived with node scripts/pm/dispatch-gates.mjs rather than from a hand-written list — 13 families, each quoting its own verdict line:

check:changeset-gate-self-tests: 116 assertions
check:docs-image-tag: OK (3/3 enumerated surface(s) read, 8 concrete pin(s) compared)
check:objectui-changeset: all checks passed
check:override-consistency: 8 published-manifest declaration(s) ... resolve to their override targets
check:slot-lookup: baseline key set verified against 9616ffb: no files added
check:test-source-alias OK — 72 packages with tests scanned
check:type-source-resolution OK — 76 packages with a tsconfig.json scanned
check-adr-0087-registration: this PR adds no declared-breaking changeset
check-changeset-fixed: "fixed" group is in sync with 69 public workspace packages
check-changeset-no-major: This diff introduces no `major` bump
check-empty-changeset: 1 declaring changeset(s) added
check-osv-exemptions: zero OSV exemptions
check-affected-docs self-test: 281 cases pass

pnpm --filter @objectstack/cli typecheck reports 0 error TS; pnpm --filter @objectstack/cli test reports Test Files 138 passed (138) / Tests 1543 passed (1543).

A patch changeset is included: nothing user-facing changes behaviourally, but the published tarball no longer carries dist/bin.js, so it is declared rather than passed off as invisible.


Generated by Claude Code

`packages/cli` has built with `tsc -p tsconfig.build.json` since the oclif
migration (bbea22f, 2026-02-18), which in one commit switched `build` from
`tsup` to `tsc`, introduced `oclif.commands.target: "./dist/commands"`, and
pointed the `bin` field at the new `bin/run.js`. The tsup config was left
behind by that commit and has never been invoked since.
It was not inert, though. It declared `clean: true` with only `src/bin.ts` and
`src/index.ts` as entries, so running the obvious `tsup` next to a
`tsup.config.ts` wipes `dist/` and emits no `dist/commands/**` — leaving a CLI
that resolves zero commands, the "command not found" signature
`scripts/cli-build-prerequisite.mjs` exists to classify.
Removed:
- `packages/cli/tsup.config.ts` — invoked by no script, no turbo task, no CI
step and no doc; in no tsc program either (the package tsconfig is
`include: ["src"]`, the root one excludes `packages`).
- `packages/cli/src/bin.ts` — the carcass of the pre-oclif Commander entry
point, gutted to a 13-line re-export by dd1e67b in the same migration.
Its only referrer repo-wide was the tsup entry above.
- the `tsup` devDependency — the config's import was its only use in the
package.
Verified by comparing the command surface oclif actually resolves (via
`Config.load`) before and after: identical, 60 commands and 68 topics, same
flags and aliases. The sole build-output difference is that `dist/bin.js` is
no longer emitted.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019bmVFqoQPq63zhKrxdYG1r
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli, touching 1 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/plugins/index.mdx(via oclif.plugins (literal))
What this run could not see
  • 1 changed file(s) yielded no anchor (packages/cli/tsup.config.ts) — pages documenting those are invisible to this run

Coarse fallback — 23 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 299b85e9d091a392c82fccd06750f666c3986814packageMentionDocs.

Which tree this was computed on

This run read content/docs from b0c408dca7c50e1cd7303c3e5f74688a46ee5da5 — the merge of head e983eb3f2549f7fb53c04a5a1f58a9a64ce810de into base 299b85e9d091a392c82fccd06750f666c3986814, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin b0c408dca7c50e1cd7303c3e5f74688a46ee5da5 && git checkout b0c408dca7c50e1cd7303c3e5f74688a46ee5da5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 299b85e9d091a392c82fccd06750f666c3986814 e983eb3f2549f7fb53c04a5a1f58a9a64ce810de && git checkout -B drift-repro 299b85e9d091a392c82fccd06750f666c3986814 && git merge --no-ff e983eb3f2549f7fb53c04a5a1f58a9a64ce810de
node scripts/docs-audit/affected-docs.mjs --json 299b85e9d091a392c82fccd06750f666c3986814

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 299b85e9d091a392c82fccd06750f666c3986814 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file tooling labels Aug 21, 2026
@os-elon
os-elon marked this pull request as ready for review August 21, 2026 05:17
@os-elon
os-elon added this pull request to the merge queueAug 21, 2026
Merged via the queue into main with commit bde0ab9Aug 21, 2026
33 checks passed
@os-elon
os-elon deleted the claude/issue-10185-retire-cli-tsup-config branch August 21, 2026 05:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependenciesPull requests that update a dependency filedocumentationImprovements or additions to documentationsize/stooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] packages/cli/tsup.config.ts describes a build nothing runs, and running it would delete the command surface oclif resolves

2 participants

@os-elon@claude