Skip to content

chore: migrate to pnpm + changesets release flow#511

Merged
gre merged 2 commits into
masterfrom
chore/pnpm-changesets
Jun 12, 2026
Merged

chore: migrate to pnpm + changesets release flow#511
gre merged 2 commits into
masterfrom
chore/pnpm-changesets

Conversation

@gre

@gre gre commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates the monorepo from Yarn 4 → pnpm 10 and replaces the manual scripts/release.sh + tag-push flow with changesets, mirroring the setup of gl-transition-libs: pushes to master open/update an automated "Version Packages" PR with generated changelogs, and merging that PR publishes to npm.

pnpm migration

  • pnpm-workspace.yaml (packages/*, onlyBuiltDependencies: gl, esbuild), packageManager: pnpm@10.34.3
  • resolutionspnpm.overrides (same 8 entries), preinstall guard now requires pnpm
  • Internal workspace deps converted to workspace:^ (changesets rewrites them to real versions at publish). ⚠️ Behavior change: cookbook, cookbook-expo, cookbook-expo-camera previously resolved gl-react@^5.2.x from the registry; they now consume the local workspace packages (v6), which is what the cookbooks should demo anyway.
  • All 4 CI workflows converted to pnpm (pnpm/action-setup@v4 + setup-node pnpm cache); cookbook-expo's double install and NODE_PATH hack removed

changesets

  • @changesets/cli + .changeset/config.jsonaccess: public, private packages (gl-react-cookbook*, gl-react-tests) ignored, independent versioning with updateInternalDependencies: patch (lockstep can be opted into later via the fixed field if preferred)
  • publish.yml rewritten as the Release workflow: on push to master it builds + runs the test suite, then changesets/action either maintains the Version Packages PR or runs pnpm changeset publish (npm trusted publishing via OIDC, npm 11)
  • Filename deliberately kept as publish.yml: npm trusted publisher config is bound to repo + workflow filename, and v6.0.0 published through it — renaming would break publishing until the 5 packages are reconfigured on npmjs.com
  • scripts/release.sh deleted; CLAUDE.md / CONTRIBUTING.md / README.md updated
  • Includes an empty changeset for this PR (no release needed)

⚠️ One repo setting needed

For changesets/action to open the Version Packages PR, enable Settings → Actions → General → "Allow GitHub Actions to create and approve pull requests" (unless already on).

Verification (local, macOS)

  • pnpm install clean; gl native module builds and creates a GL context (onlyBuiltDependencies working)
  • pnpm build: all 5 packages compile ✅
  • pnpm test: 40/40 tests, 3/3 snapshots ✅
  • pnpm exec vite build in cookbook (deploy path) ✅
  • pnpm changeset status correctly detects changed packages ✅
  • examples/next-js untouched (standalone, keeps its own Yarn 1 lockfile)

🤖 Generated with Claude Code

Mirrors the modern setup of gl-transition-libs:

- Replace Yarn 4 with pnpm 10 (pnpm-workspace.yaml, packageManager,
  resolutions -> pnpm.overrides, preinstall guard now requires pnpm)
- Internal workspace deps now use the workspace:^ protocol (replaced
  with real versions at publish time). Note: the cookbook packages
  previously resolved gl-react ^5.2.x from the registry; they now use
  the local workspace packages.
- Add @changesets/cli + .changeset/config.json (private packages
  ignored). Releases now flow through a "Version Packages" PR with
  auto-generated changelogs.
- Rewrite publish.yml as the changesets Release workflow (build + test
  gate, then changesets/action publishes via npm trusted publishing).
  Filename kept as publish.yml because the npm trusted publisher
  config is bound to it.
- Convert all CI workflows to pnpm; drop the cookbook-expo double
  install and NODE_PATH hack
- Delete scripts/release.sh (replaced by changesets), update docs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 12, 2026 20:28
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates the gl-react monorepo from Yarn workspaces to pnpm workspaces and switches the npm publishing flow from a manual script/tag trigger to a Changesets-driven “Version Packages” PR + publish-on-merge workflow.

Changes:

  • Replace Yarn-based workspace/dev commands with pnpm equivalents and add pnpm-workspace.yaml.
  • Introduce Changesets configuration and update the publish workflow to create/update a version PR or publish via trusted publishing.
  • Convert internal deps in packages and cookbooks to workspace:^ and remove the legacy scripts/release.sh.

Reviewed changes

Copilot reviewed 25 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/release.sh Removes the legacy manual release/tag script.
README.md Updates cookbook run instructions to pnpm.
pnpm-workspace.yaml Adds pnpm workspace definition and build dependency allowlist.
packages/tests/package.json Switches internal deps to workspace:^ for local resolution.
packages/gl-react-native/package.json Switches internal deps to workspace:^.
packages/gl-react-headless/package.json Switches internal deps to workspace:^.
packages/gl-react-expo/package.json Switches internal deps to workspace:^.
packages/gl-react-dom/package.json Switches internal deps to workspace:^.
packages/cookbook/package.json Switches cookbook deps to workspace packages and reformats JSON.
packages/cookbook-expo/package.json Switches Expo cookbook deps to workspace packages.
packages/cookbook-expo-camera/package.json Switches Expo camera cookbook deps to workspace packages.
package.json Sets pnpm as package manager, updates scripts, and moves resolutions to pnpm overrides.
CONTRIBUTING.md Updates contributor commands from Yarn to pnpm.
CLAUDE.md Updates repo/tooling guidance to pnpm + documents Changesets release flow.
.yarnrc.yml Removes Yarn config.
.github/workflows/publish.yml Replaces tag-based publish with Changesets release workflow on master.
.github/workflows/deploy-cookbook.yml Migrates cookbook deploy workflow to pnpm.
.github/workflows/ci-tests.yml Migrates test CI workflow to pnpm.
.github/workflows/ci-cookbook.yml Migrates cookbook CI workflow to pnpm.
.github/workflows/ci-cookbook-expo.yml Migrates Expo cookbook CI workflow to pnpm and simplifies install/bundling.
.changeset/six-birds-own.md Adds an empty changeset to record non-release infra change.
.changeset/README.md Adds Changesets generated README.
.changeset/config.json Adds Changesets config (independent versioning, ignored private packages).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
"license": "MIT",
"scripts": {
"preinstall": "node -e \"if (process.env.npm_execpath.indexOf('yarn') === -1) { console.log('\u001b[31mPlease use yarn\u001b[0m'); process.exit(1); }\"",
"preinstall": "node -e \"if (process.env.npm_execpath.indexOf('pnpm') === -1) { console.log('\u001b[31mPlease use pnpm\u001b[0m'); process.exit(1); }\"",
Comment thread CLAUDE.md
Comment on lines +14 to +17
pnpm install # Install dependencies
pnpm build # Babel-compile all packages to lib/ + generate .d.ts
pnpm typecheck # Run TypeScript type checking (tsc --noEmit)
pnpm watch # Watch mode for development
Comment thread CONTRIBUTING.md
Comment on lines 7 to +8
* **Node 6**+
* [yarn](https://yarnpkg.com)
* [pnpm](https://pnpm.io)
@gre gre merged commit 4656739 into master Jun 12, 2026
3 checks passed
@gre gre deleted the chore/pnpm-changesets branch June 24, 2026 11:44
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.

2 participants