Repository navigation
chore: adopt the release standard - #101
Open
crcatala-vps wants to merge 3 commits into
Open
crcatala-vps wants to merge 3 commits into
crcatala-vps wants to merge 3 commits into
Conversation
`bun --raw-test` is not a bun flag: it printed bun's help and exited 0, so `bun run test` — used by verify, CI, and the release preflight — never ran a test. Use `bun test` instead. `--isolate` keeps each test file in its own global object: the module mock of `fs` in tests/unit/config.config.test.ts is never restored by bun, so without it every later file that touches node:fs saw the stub. Co-authored-by: Christian Catalan <crcatala@gmail.com>
Copy the canonical release scripts byte for byte (prep-release.sh, check-changelog.sh, release.mjs, build-info.mjs, test-package.sh) and keep this project's own smoke-test checks in scripts/test-package.local.sh, which the canonical script sources: both `tt` and `ttcli` must be installed and report the package.json version exactly. - .release-it.json: stop releasing through release-it's npm plugin (npm.publish: false) so scripts/release.mjs publishes from the released commit; run the changelog check before verify; hooks stay on bun. - package.json: release/release:dry/release:publish/release:prep now go through release.mjs and the shared prep script; the build stamps dist/build-info.json (scripts/build-info.mjs) and "files" ships it. - RELEASING.md: rewritten for the wrapped flow, bun, and the npm/git recovery steps. Co-authored-by: Christian Catalan <crcatala@gmail.com>
`tt --version` / `tt -V` now prints `tt X.Y.Z (sha7 YYYY-MM-DD)`, with `-dirty` when the build came from a tree with uncommitted changes, instead of the bare version. src/cli-meta.ts reads the stamp written by scripts/build-info.mjs for builds, and git for code running from src/ in a checkout, so a stale build never hides newer commits; a build without commit information prints only the version. `tt update [--check] [--force]` updates the CLI the way it was installed: a clone is pulled with `git pull --ff-only` and rebuilt with bun, a global npm install is reinstalled from the registry, npx is told it already runs the latest. `--check` reports only: exit 0 up to date, 1 update available, 2 when it cannot tell. `tt version [--json]` shows the version, full commit, date, dirty state, install method and path. `packageManagerFor` prefers bun.lock over the pnpm lockfile this repository also keeps, so a checkout update installs and builds with bun, like CI does. Docs: the README Install section gains From source and Updating; the changelog has the Unreleased entries. Co-authored-by: Christian Catalan <crcatala@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts the shared release standard: hand-cut releases from a clean
mainthroughscripts/release.mjs, a changelog gate, a stamped--versionline, anupdatecommand,and a from-source install section. No version bump, no release, no publish.
What changed
Canonical files (byte-for-byte copies of the standard's templates)
scripts/prep-release.sh(replaces the old ad-hoc version)scripts/check-changelog.sh(new — the release refuses to start without Unreleased entries)scripts/release.mjs(new — preflight, release-it, then publish from the tagged commit)scripts/build-info.mjs(new — stampsdist/build-info.jsonat the end ofbuild)scripts/test-package.sh(replaces the old smoke test)Project-specific hook
scripts/test-package.local.sh(new) keeps the old smoke test's own checks: bothttandttclimust be installed and must report the exactpackage.jsonversion (plus--help).Adapted (non-canonical) files
.release-it.json:npm.publish: falsesorelease.mjspublishes after the tag;before:initnow runs
scripts/check-changelog.shandbun run verify; hooks callbun run; schema bumped torelease-it 21.
package.json:release,release:dry,release:publishandrelease:prepgo throughrelease.mjs/ the shared prep script;buildends withnode scripts/build-info.mjs;"files"shipsdist/build-info.json. Version unchanged at 0.1.3.RELEASING.md: rewritten for the wrapped flow, bun, and the resume-from-the-failed-step recovery.README.md:## Installnow has registry install, From source (clone,bun install,bun run build,npm link,tt --version) and Updating (tt update --check,tt update);tt update/tt versionadded to the command reference.src/cli-meta.ts(new, adapted from the template) +src/index.ts:tt --version/-Vprintstt X.Y.Z (sha7 YYYY-MM-DD)(-dirtyfor uncommitted builds; version alone when there is nocommit stamp).
tt update [--check] [--force]updates the way the CLI was installed;tt version [--json]reports version, commit, date, dirty state, install method and path.CHANGELOG.md: Unreleased entries for the newupdate/versioncommands and the new--versionformat. No release section was added.
Test runner fix (pre-existing bug, found while verifying)
bun --raw-testis not a bun flag: it printed bun's help and exited 0, sobun run test— usedby
verify, CI and the release preflight — never ran a test. The script is nowbun test --isolate(~485 tests run, 443 pass / 42 skipped).--isolateis needed becausetests/unit/config.config.test.tsmocks thefsmodule and bun never restores it, so laterfiles saw the stub.
tests/unit/cli-meta.test.tsandtests/integration/cli-version.test.tscover theversion line format, install detection, update steps,
--version/-V,version --jsonandupdate --checkexit codes.What was kept that differs from the standard, and why
bun install,bun run …everywhere;npmonly forpack/publish/view/whoami, as the Node reference allows). CI installs withbun install --frozen-lockfile.cli-metaprefersbun.lockoverpnpm-lock.yaml. This repo keeps both lockfiles, but bun isthe package manager, so a source-checkout
updatemust runbun install+bun run build.prepublishOnly: bun run verifykept. It is an extra publish safeguard the repo already hadand it still runs before
npm publishfromrelease.mjs.ttandttcliboth kept. The standard's--versionline usestt(the name the README usesas primary);
ttcliprints the same line with its own name, since it is the same binary.release:dryrefuses without an npm login, becauserelease.mjs's preflight requiresnpm whoamieven for a dry run (canonical behaviour, not modified).RELEASING.mddocuments thedirect
npx release-it --dry-run --ci --no-npm --no-githubpreview for that case.Verification
Run on the branch, from a committed (clean) tree, Node 24.22.1 / Bun 1.4.4 / npm 11.19.1:
bun install --frozen-lockfilebun run lint(CIlint)bun run typecheck(CItypecheck)bun run test(CItest)bun run build(CItest,node-smoke)dist/build-info.jsonstampedbun run test:package(CItest)bun run verify(repoverify)node dist/index.js --version,--help,project edit --help)node dist/index.js --versiontt 0.1.3 (218e598 2026-10-27)— this commit, cleannode dist/index.js update --checktt is up to date (218e598)., exit 0 (0/1/2 accepted)bun run release:dryrelease.mjsis canonical and untouchednpx release-it --dry-run --ci --no-npm --no-github --git.requireBranch=chore/release-standard0.1.3...0.1.4, commitchore: release v0.1.4, tagv0.1.4, push--follow-tags; hooks reported as skipped; tree clean, no tag createdbash scripts/check-changelog.shbash scripts/prep-release.shv0.1.3python3 scripts/audit.py .No real release, tag push,
npm publishor GitHub Release was run; the PR is not merged.