From e983eb3f2549f7fb53c04a5a1f58a9a64ce810de Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 04:47:48 +0000 Subject: [PATCH] chore(cli): retire the abandoned tsup build path (#10185) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `packages/cli` has built with `tsc -p tsconfig.build.json` since the oclif migration (bbea22f350, 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 dd1e67bbda 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 Claude-Session: https://claude.ai/code/session_019bmVFqoQPq63zhKrxdYG1r --- .../cli-retire-abandoned-tsup-config.md | 21 +++++++++++++++++ packages/cli/package.json | 1 - packages/cli/src/bin.ts | 13 ----------- packages/cli/tsup.config.ts | 23 ------------------- pnpm-lock.yaml | 3 --- 5 files changed, 21 insertions(+), 40 deletions(-) create mode 100644 .changeset/cli-retire-abandoned-tsup-config.md delete mode 100644 packages/cli/src/bin.ts delete mode 100644 packages/cli/tsup.config.ts diff --git a/.changeset/cli-retire-abandoned-tsup-config.md b/.changeset/cli-retire-abandoned-tsup-config.md new file mode 100644 index 0000000000..10a4cbad73 --- /dev/null +++ b/.changeset/cli-retire-abandoned-tsup-config.md @@ -0,0 +1,21 @@ +--- +"@objectstack/cli": patch +--- + +Remove the abandoned tsup build path from `packages/cli` (#10185): the +`tsup.config.ts`, the orphaned `src/bin.ts` it was the only referrer of, and +the now-unused `tsup` devDependency. + +The package has built with `tsc -p tsconfig.build.json` since the oclif +migration, which also introduced `oclif.commands.target: "./dist/commands"` +and moved the `bin` field onto `bin/run.js`. The tsup config was left behind +by that commit and never invoked again — but it was not inert. It declared +`clean: true` with only `src/bin.ts` and `src/index.ts` as entries, so anyone +running the obvious `tsup` next to a `tsup.config.ts` would wipe `dist/` and +emit no `dist/commands/**` at all, leaving a CLI that resolves zero commands. +Deleting it removes the trap rather than documenting it. + +No published behaviour changes: the resolved oclif command surface is +identical before and after (60 commands, 68 topics). The only build-output +difference is that `dist/bin.js` — a re-export of `execute` from +`@oclif/core` that nothing imported — is no longer emitted. diff --git a/packages/cli/package.json b/packages/cli/package.json index f3416f2012..6549dd0738 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -119,7 +119,6 @@ "@oclif/plugin-plugins": "^5.4.87", "@types/better-sqlite3": "^7.6.13", "@types/node": "^26.2.0", - "tsup": "^8.5.1", "typescript": "^6.0.3", "vitest": "^4.1.10" }, diff --git a/packages/cli/src/bin.ts b/packages/cli/src/bin.ts deleted file mode 100644 index 7e7f9d6f63..0000000000 --- a/packages/cli/src/bin.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. - -/** - * ObjectStack CLI — oclif-based entry point. - * - * All commands are auto-discovered from `src/commands/` by oclif. - * Plugins extend the CLI via oclif's built-in plugin system - * (configured in package.json under "oclif.plugins"). - * - * Run `os --help` for available commands. - */ - -export { execute } from '@oclif/core'; diff --git a/packages/cli/tsup.config.ts b/packages/cli/tsup.config.ts deleted file mode 100644 index a26047d4ff..0000000000 --- a/packages/cli/tsup.config.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. - -import { defineConfig } from 'tsup'; - -export default defineConfig([ - // CLI binary entry — needs shebang - { - entry: ['src/bin.ts'], - format: ['esm'], - clean: true, - shims: true, - banner: { - js: '#!/usr/bin/env node', - }, - }, - // Library entry — no shebang, with types - { - entry: ['src/index.ts'], - format: ['esm'], - dts: !process.env.OS_SKIP_DTS, - shims: true, - }, -]); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e56c87dd68..704b88939e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -599,9 +599,6 @@ importers: '@types/node': specifier: ^26.2.0 version: 26.2.0 - tsup: - specifier: ^8.5.1 - version: 8.5.1(jiti@2.7.0)(postcss@8.5.26)(tsx@4.23.12)(typescript@6.0.3)(yaml@2.9.0) typescript: specifier: ^6.0.3 version: 6.0.3