Skip to content

chore(release): create a new release pull request script - #3233

Merged
interactivellama merged 3 commits into
masterfrom
chore/create-release-pr
Oct 30, 2026
Merged

interactivellama merged 3 commits into
masterfrom
chore/create-release-pr

Conversation

@interactivellama

@interactivellama interactivellama commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Additional description

Adds npm run release-pr, a script that does the mechanical part of a release: bump the version, commit, push, and open the release PR. Before this, those steps were done by hand.

Usage

npm run release-pr -- next                # 11.0.0-alpha.3 -> 11.0.0-alpha.4
npm run release-pr -- 11.0.0-alpha.5      # explicit version
npm run release-pr -- next --dry-run      # print the plan, change nothing

What it does

  1. Preflight checks. It stops if any of these fail:
    • tracked files are dirty
    • origin isn't salesforce/design-system-react (releases are pushed from the main repo, not a fork)
    • gh isn't authenticated
    • the target version equals master's current version, or the tag v<version> already exists
    • the version isn't x.y.z or x.y.z-<alpha|beta|rc>.N
  2. Reads the current version from origin/master, not the working branch. next increments the trailing prerelease number and is rejected for stable versions.
  3. Creates chore/release-<version> from origin/master, so unrelated work on the current branch doesn't end up in the release.
  4. Rewrites package.json, preserving key order. It changes only version and publishConfig.tag. The tag is alpha, beta or rc for prereleases and is removed for stable releases, so they publish as latest. The script aborts if any other file changed.
  5. Commits as chore(release): update version to <version>, pushes, and opens a PR against master. The PR body lists the commits since the previous tag.
  6. Switches back to the branch you started on.

Implementation

  • scripts/release.ts is TypeScript, run with tsx (added as a devDependency; the lockfile change is the tsx entry only).
  • tsconfig.scripts.json puts scripts/ under npm run typecheck.
  • scripts/__tests__/release.test.mjs runs the script against throwaway git repos with a stub gh and checks the version bump, branch, PR arguments and refusal cases. Nothing real is pushed or opened.
  • AGENTS.md describes the command.

CONTRIBUTOR checklist (do not remove)

Please complete for every pull request.

Green gate — all of these must pass locally (CI runs the same):

  • npm run lint passes with 0 errors (npm run lint:fix to auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.
  • npm run typecheck is clean (tsc --noEmit).
  • npm test -- --run passes — this runs both Vitest projects (jsdom unit + real-browser browser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots with npm test -- --run -u and review the diff.
  • npm run build succeeds (type-check + Vite library build + .d.ts + entry shims).

Behavior & docs:

  • First-time contributors: sign the CLA (a bot will comment with instructions).
  • Added/updated Vitest + React Testing Library tests for the change (template: components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a *.browser.test.jsx file (the browser project); everything else is jsdom.
  • Reviewed the component's Storybook stories: npm run storybook → http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).
  • Story/example code uses the component's real prop API (e.g. render-props like onRenderContent / onRenderVisualPicker, icon props, events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check against components/<name>/__examples__.
  • Storybook Accessibility (a11y) panel shows no new violations for the affected stories.
  • If you added or changed a type, remember runtime PropTypes were removed in the TS migration — types are the contract. Ship accurate .d.ts (they're generated by the build); JS consumers rely on them via editor type-acquisition.

REVIEWER checklist (do not remove)

  • CI is green (GitHub Actions CI workflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.
  • Change has adequate test coverage; bug fixes include a regression test.
  • Reviewed the affected Storybook stories and their a11y panels.
  • Rendered markup still conforms to SLDS — check the story HTML snapshot diff (components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).
  • Public API / package surface: if exports changed, the deep-import contract still holds (@salesforce/design-system-react/components/<name> and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change → feat!:/BREAKING CHANGE: and a major version bump.

@interactivellama
interactivellama marked this pull request as ready for review October 6, 2026 18:39
@interactivellama interactivellama changed the title chore(release): create release pull request script chore(release): create a new release pull request script Oct 6, 2026
interactivellama and others added 3 commits October 29, 2026 17:23
Runs repo scripts written in TypeScript. The lockfile change adds only the
tsx entry.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
`npm run release-pr` bumps the version on a branch cut from origin/master,
pushes it, and opens the PR. The script is TypeScript and runs with tsx;
tsconfig.scripts.json puts scripts/ under `npm run typecheck`.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread tsconfig.scripts.json
Comment on lines +2 to +3
// Repo tooling in `scripts/` (run with `tsx`). The build config only covers
// `components/`, `utilities/` and `types/`; `npm run typecheck` runs this too.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment syntax isn't compatible in JSON

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind. TypeScript compiler allows comments

@interactivellama
interactivellama merged commit 05d4f88 into master Oct 30, 2026
10 checks passed
@interactivellama
interactivellama deleted the chore/create-release-pr branch October 30, 2026 16:19
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.

4 participants