Skip to content

chore: adopt the release standard - #71

Open
crcatala-vps wants to merge 3 commits into
mainfrom
chore/release-standard
Open

crcatala-vps wants to merge 3 commits into
mainfrom
chore/release-standard

Conversation

@crcatala-vps

Copy link
Copy Markdown
Collaborator

Summary

Applies the shared release standard to raindrop-cli: canonical release scripts byte for byte, vX.Y.Z tags released by hand from a clean main with publishing last from the tag, the rd X.Y.Z (sha7[-dirty] YYYY-MM-DD) version line, a real rd update command, an install-from-source section, and RELEASING.md. No version bump, no release, no publish.

What changed

Canonical copies (byte for byte, scripts/)

  • scripts/prep-release.sh, scripts/check-changelog.sh (replaced the repo's own versions)
  • scripts/release.mjs (wraps release-it: preflight → bump/changelog/commit/tag/push/GitHub Release → publish from the tag)
  • scripts/build-info.mjs (stamps dist/build-info.json at the end of build)
  • scripts/test-package.sh (packs, installs the tarball as a user would, checks every bin answers --help and prints the standard --version line)

Project-specific checks moved to scripts/test-package.local.sh (sourced by the canonical smoke test, nothing dropped):

  • exactly one shebang in dist/cli.js
  • rd --version reports this package's package.json version
  • a real Axios request from the project root emits no Node DeprecationWarning

package.json

  • files ships dist/build-info.json; build ends with node scripts/build-info.mjs
  • release / release:dry / release:prep point at the wrapped scripts; new release:publish
  • package manager stays bun (prepack, verify, hooks)

.release-it.json

  • npm.publish: false (release.mjs publishes after the tag, so the published build carries the release commit and a clean tree); schema bumped to release-it 21; hooks keep bun run verify / bun run test:package

CLI (src/cli-meta.ts, src/cli/program.ts)

  • --version / -V print rd X.Y.Z (sha7[-dirty] YYYY-MM-DD); dist/ reports the build stamp, src/ reads git
  • rd update (no ID) updates the way it was installed: checkout (git pull --ff-only, install, build; refuses when dirty or not on main), npm/pnpm/bun global, mise, npx; --check reports only (0 up to date / 1 available / 2 unknown), --force reinstalls when current
  • rd update <id> … and rd update --help still reach rd bookmarks update, so the existing bookmark shortcut is unchanged

Docs

  • README ## Installation: registry install, new From source (clone, bun install, bun run build, bun link, rd --version) and Updating sections; the Node requirement now matches engines (22+)
  • README ## Releasing now points at the new RELEASING.md, which carries the maintainer prerequisites (npm login, GITHUB_TOKEN, ggshield), the changelog workflow and per-step recovery
  • CHANGELOG: ## [Unreleased] gained entries for the new rd update command and the new --version format (no release sections added)

Tests

  • --version tests assert the new format (subprocess and in-process)
  • new src/cli-meta.test.ts covers formatVersion, versionLine, compareVersions, and the git URL helpers
  • new integration tests: rd update --check exits 0/1/2, rd update <id> still delegates, rd update --help shows the bookmark form
  • src/release-prep.test.ts follows the canonical prep-release wording

Kept non-standard, and why

  • ggshield scans stay in prepublishOnly, not prepack. The standard puts build-output scans in prepack so they see a fresh dist/. Here CI runs the package smoke test, and the canonical smoke test runs npm pack, which fires prepack — CI has no ggshield installed, so moving the scan there would fail CI. prepublishOnly already builds and then scans both the source tree and that fresh dist/ in one command, and prepack rebuilds the same tree for the tarball, so the publish gate still scans the published content. Both original scans are preserved.
  • release:dry needs npm whoami. The canonical release.mjs preflight refuses to plan a release without an npm login (correct — the publish step needs it); this machine has no npm login, so bun run release:dry stops with not logged in to npm. The wrapped release-it --dry-run … was run directly instead (see Verification).
  • src/cli-meta.ts is reformatted with Prettier (it is an adapted, non-canonical template) to satisfy prettier --check src/**/*.ts; only line wrapping changed.
  • The repo's own verify (tests, lint, typecheck, format, package smoke test, all in parallel via scripts/verify.ts) and its bun package manager are unchanged.

Verification

Run locally on chore/release-standard (clean tree, HEAD c2e90d9):

Command Result
bun run verify all checks passed — 595 tests, lint, typecheck, format, package smoke test
bun run test:verbose -- --coverage (CI test command) 595 pass, 0 fail (plus the uninstrumented nock-enforcement run: 1 pass)
bun run lint:verbose / typecheck:verbose / format:check:verbose exit 0 (lint: 9 pre-existing warnings, none in the changed files)
bun run build ok; dist/build-info.json = {version: 0.3.1, commit: c2e90d9…, date: 2026-10-27, dirty: false}
bun run test:package Package smoke test passed. (3 bins: --help + standard --version, plus the local checks)
./dist/cli.js --version and -V rd 0.3.1 (c2e90d9 2026-10-27) — this commit
./dist/cli.js update --check rd is up to date (c2e90d9)., exit 0
./dist/cli.js update not-a-number --title x Invalid bookmark ID…, exit 2 (bookmark shortcut intact, no API call)
./dist/cli.js update --help Usage: rd bookmarks update …, exit 0
bun run release:dry refused as designed: not logged in to npm (run npm login) — expected here, no login exists and release.mjs was not modified
npx release-it --dry-run --ci --no-npm --no-github --git.requireBranch=chore/release-standard planned 0.3.1…0.3.2, changelog from Unreleased, git commit --message chore: release v0.3.2, git tag --annotate --message Release 0.3.2 v0.3.2, git push --follow-tags; 🏁 Done; working tree left clean, no tags created
python3 …/audit.py . 0 failing, 0 warnings, 27 checks

crcatala-vps and others added 3 commits October 27, 2026 17:48
Copy the canonical release scripts byte for byte from the release standard
(prep-release.sh, check-changelog.sh, release.mjs, build-info.mjs,
test-package.sh) and keep the project-specific package checks in
scripts/test-package.local.sh, which the canonical smoke test sources:
the single-shebang check, the version-equals-package.json check, and the
Axios deprecation-warning check.

- release-it no longer publishes; scripts/release.mjs publishes after the
  tag so the published build carries the release commit
- add release:publish and point release/release:dry/release:prep at the
  wrapped scripts
- build stamps dist/build-info.json, shipped through package.json "files"
- ggshield stays in prepublishOnly: CI runs `npm pack` (prepack) but has no
  ggshield installed, so moving the scan into prepack would break CI

The prep-release.sh wording changed with the canonical copy, so the release
prep test now asserts the new line.

Co-authored-by: Christian Catalan <crcatala@gmail.com>
- --version / -V now print `rd X.Y.Z (sha7[-dirty] YYYY-MM-DD)`: the
  build stamp when running from dist/, git when running from src/
- `rd update` with no bookmark ID updates rd the way it was installed
  (source checkout, npm/pnpm/bun global, mise, npx); `--check` reports
  only (exit 0 up to date, 1 update available, 2 unknown) and `--force`
  reinstalls when current
- `rd update <id> [options]` and `rd update --help` still reach
  `rd bookmarks update`, so the existing bookmark shortcut is unchanged
- tests cover the version line format, the update --check exit codes, the
  bookmark delegation, and the path helpers used by the update command

Co-authored-by: Christian Catalan <crcatala@gmail.com>
- README Install: registry install, a From source section (clone, bun
  install, build, link, verify the commit on PATH) and an Updating section;
  the Node requirement now matches package.json (22+)
- the README Releasing section points at the new RELEASING.md, which keeps
  the maintainer prerequisites (npm login, GITHUB_TOKEN, ggshield), the
  changelog workflow and the recovery steps per failed release step
- CHANGELOG: Unreleased entries for the new `rd update` command and the
  new --version format

Co-authored-by: Christian Catalan <crcatala@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant