Skip to content

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

Description

@os-elon

Measured while implementing #10111 (PR #10181), whose file surface is the CLI's entry points. Not repaired there — different defect class, and that card's fence is invocation loudness. Filed unassigned, severity for triage.

The measurement

Measured on main at 2d3860df9.

packages/cli/package.json builds with tsc:

"build": "if [ -n \"$OS_SKIP_DTS\" ]; then tsc -p tsconfig.build.json --noCheck --declaration false --declarationMap false; else tsc -p tsconfig.build.json; fi"

packages/cli/tsup.config.ts nonetheless exists and declares a different output shape — two entries, src/bin.ts (with a #!/usr/bin/env node banner) and src/index.ts, the first with clean: true:

export default defineConfig([
  { entry: ['src/bin.ts'], format: ['esm'], clean: true, shims: true, banner: { js: '#!/usr/bin/env node' } },
  { entry: ['src/index.ts'], format: ['esm'], dts: !process.env.OS_SKIP_DTS, shims: true },
]);

Nothing invokes it. Grepped over scripts/, .github/, turbo.json and the package's own package.json: no reference to it. tsup is still in the package's devDependencies.

Two things follow, and the second is why this is filed rather than left as tidy-up:

  1. src/bin.ts is reachable from nothing else. It is a one-line export { execute } from '@oclif/core', and the only reference to it in the repo is the dead tsup entry above (the real bin is bin/run.js, which is what package.json bin names). tsc emits dist/bin.js from it on every build; nothing reads that file.
  2. Running the config would break the package, quietly-ish. clean: true wipes dist/, and tsup's two entries emit dist/bin.js + dist/index.js only — no dist/commands/**. package.json declares oclif.commands.target: "./dist/commands", so the result is a CLI that resolves no commands, which is the "command not found" symptom scripts/cli-build-prerequisite.mjs exists to classify. A config file sitting next to a package is a standing invitation to run it (pnpm --filter @objectstack/cli exec tsup), and this one looks like the package's build.

Directions (not a decision)

  • Delete tsup.config.ts and src/bin.ts if neither is wanted, and drop tsup from the package's devDependencies if nothing else there uses it. Cheapest, and it removes the trap rather than documenting it.
  • Or, if the tsup shape is a deliberate future direction, say so in the file and make it produce dist/commands/** so running it is not destructive.

Either way the choice is a domain:cli call and needs someone to confirm the tsup path is genuinely unwanted before deleting it.

Dedupe

search_issues for "packages/cli tsup.config.ts unused build config, the CLI package builds with tsc not tsup, dead build configuration" returns 6 results, none about this: #7849 (missing vitest.config.ts letting a stale dist decide verdicts), #9307 (closed, build-console.sh pre-building outside turbo), and four closed packages/spec / packages/qa tsconfig-coverage cards. Grep over the repo for a reference to this config found only the file itself.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions