Skip to content

chore: migrate to Yarn 4 monorepo#266

Open
zivl wants to merge 6 commits intomasterfrom
move-to-yarn
Open

chore: migrate to Yarn 4 monorepo#266
zivl wants to merge 6 commits intomasterfrom
move-to-yarn

Conversation

@zivl
Copy link
Copy Markdown
Owner

@zivl zivl commented Mar 26, 2026

Summary

  • Yarn 4 via corepack (packageManager: yarn@4.13.0, nodeLinker: node-modules) — replaces npm and all package-lock.json files with a single yarn.lock at the root
  • Proper monorepo layout with Yarn workspaces:
    • packages/sentry-testkit/ — main publishable package (moved from root)
    • packages/sentry-testkit-docs/ — Docusaurus site (was website/)
    • apps/expo-react-native-test-app/ — React Native test harness (was expo-react-native-test-app/)
  • Replace browser/package.json subpath hack with a proper "exports" map in packages/sentry-testkit/package.jsonsentry-testkit/browser now resolves via the standard Node.js exports field; the manual browser.d.ts is removed (TypeScript auto-generates dist/browser.d.ts)
  • Delete legacy docs/ (old Docsify site, superseded by Docusaurus in packages/sentry-testkit-docs/)
  • Update all GitHub Actions workflows for Yarn 4 + monorepo paths:
    • npm ciyarn install --immutable with corepack enable
    • npm run build/testyarn workspace sentry-testkit build/test
    • npm publishyarn workspace sentry-testkit npm publish + YARN_NPM_AUTH_TOKEN
    • deploy-docs / test-deploy-docs point to packages/sentry-testkit-docs/
    • Fixed test-deploy-docs.yml which was incorrectly targeting main instead of master

Test plan

  • Run yarn install at repo root — should generate yarn.lock and install all workspaces
  • Run yarn workspace sentry-testkit build — should compile packages/sentry-testkit/src/dist/
  • Run yarn workspace sentry-testkit test — all existing tests should pass
  • Verify require('sentry-testkit/browser') resolves via new exports map (no browser/ dir needed)
  • Run yarn workspace expo-react-native-test-app test — Expo RN tests should pass
  • Run yarn workspace sentry-testkit-docs build — Docusaurus site should build cleanly
  • CI: all GitHub Actions workflows should pass on this branch

🤖 Generated with Claude Code

zivl and others added 6 commits March 26, 2026 21:46
- Switch from npm to Yarn 4 (corepack, nodeLinker: node-modules)
- Restructure into proper monorepo layout:
  - packages/sentry-testkit/   (main publishable package)
  - packages/sentry-testkit-docs/  (Docusaurus site, was website/)
  - apps/expo-react-native-test-app/  (RN test harness)
- Replace legacy browser/ subpath hack with proper exports map in package.json
- Delete old Docsify docs/ folder
- Remove all package-lock.json files; yarn.lock at root
- Update all GitHub Actions workflows:
  - npm → yarn (--immutable, corepack enable)
  - workspace-scoped build/test/publish commands
  - Fix test-deploy-docs.yml targeting main instead of master
  - Use YARN_NPM_AUTH_TOKEN for publish

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Import sentry-testkit via workspace package instead of relative ../../src
- Import commonTests via correct relative path to packages/sentry-testkit/__tests__
- Add sentry-testkit workspace:* to expo app devDependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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