Skip to content

chore: move the release scripts to a cl-release workspace package - #267

Merged
pviti merged 1 commit into
monorepofrom
chore/release-package
Oct 2, 2026
Merged

pviti merged 1 commit into
monorepofrom
chore/release-package

Conversation

@pviti

@pviti pviti commented Oct 2, 2026

Copy link
Copy Markdown
Member

The release scripts become a private workspace package, @commercelayer/cli-release (packages/release), on the model of cli-generator.

Changes

  • cl-release <command>. Commands version, tag, try, labels, resolve, notes, publish and manifest, one module each in src/commands, plus shared helpers in src/workspace.ts.
    • TypeScript run through tsx (bin/cl-release.mjs), no build step.
    • Options parsed with node:util parseArgs; every command has --help, and an unknown option is an error.
    • Runs at the workspace root wherever it is started from.
  • Root scripts. Unchanged for the user (pnpm release:version, release:tag, release:config, release:publish, release:try); they now call cl-release. The release libraries move from the root devDependencies to the package.
  • Workflows. They call pnpm exec cl-release resolve|notes|publish|manifest|labels. release.yml installs @commercelayer/cli-monorepo..., so it also gets cl-release and its dependencies.
  • Test helpers in packages/test-utils.
    • oclif-root.cjs: the 17 .mocharc.json now point to ../../packages/test-utils/oclif-root.cjs.
    • bin/live-sweep.mjs: used by integration.yml and mentioned in the README.
  • check-packages stays in scripts/ and no longer imports from the removed scripts/lib.
  • Unit tests (20) for the pure parts: tag resolution, previous release, dependency order, bump, the dependencies added to a release and to a publish, command-surface diff, maintenance note, labeler, release:try selection.

Equivalence check

I ran the old scripts and cl-release on the same tree (origin/monorepo) and compared their outputs and exit codes. All identical:

  • version --base monorepo --yes --dry-run (18 packages);
  • tag --base monorepo --dry-run;
  • resolve on valid tags (tags-v2.2.6, cli-v6.9.9, orders-v5.7.0) and invalid ones (prerelease, mismatch, unknown folder, private package, no prefix);
  • notes on the same tags, also with an explicit previous tag;
  • publish --dry-run: error for a dependency without a tag, and a full run with cli-core and cli-ux published first;
  • manifest (--warn, --against, packages without commands, private, missing).

labels changes only the header of .github/labeler.yml, and release:try tags installs and runs the sandbox CLI.

🤖 Generated with Claude Code

The release scripts become @commercelayer/cli-release (packages/release,
private): TypeScript run through tsx, like cl-generate, one module per
command, unit tests for the pure parts. The root scripts and the
workflows call `cl-release <command>`; the outputs are unchanged.

The test helpers move to packages/test-utils: oclif-root.cjs (mocha
setup) and bin/live-sweep.mjs. check-packages stays in scripts/,
self-contained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant