refactor: structure as a monorepo and migrate to Changesets#370
Draft
stipsan wants to merge 5 commits into
Draft
refactor: structure as a monorepo and migrate to Changesets#370stipsan wants to merge 5 commits into
stipsan wants to merge 5 commits into
Conversation
Move the published library from the repo root into `packages/react-rx` and turn the root into a private pnpm workspace root (`react-rx-monorepo`). The `website` app stays at the repo root so the Vercel deployment (root directory `website`) keeps working. - Move `src`, build/test config, README and CHANGELOG into `packages/react-rx` - Split manifests: library deps/build in `packages/react-rx/package.json`, shared tooling (eslint, prettier, typescript) + Changesets tooling in the root `package.json` - Add `.changeset/config.json` (changelog-github, baseBranch `current`) - Replace semantic-release with Changesets: drop `.releaserc.json`, `semantic-release` and `@sanity/semantic-release-preset`; add `@changesets/cli`, `@changesets/changelog-github`, `setup-npm-trusted-publish` and a `release` script - Update `ci.yml` to a build+test workflow using a shared `setup` composite action (the release job is handled by the new release workflow) - Point the website at the moved package (`next.config.ts`, `Sandpack.tsx`) - Widen eslint/prettier ignores for nested `dist` Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
- `release.yml`: on push to `current`, calls the shared `sanity-io/.github` Changesets workflow to open/update the "Version Packages" PR and publish to npm via OIDC trusted publishing - `changesets-from-conventional-commits.yml`: auto-adds changesets to Renovate and squiggler-legacy (React Compiler) dependency PRs - `setup-trusted-publish.yml`: helper to register a new package on npm with trusted publishing for this repo Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
Replace `pnpm/action-setup` + `actions/setup-node` + `pnpm install` in the shared `setup` composite action with a single `pnpm/setup@v1` step, which installs pnpm, the Node.js runtime and dependencies in one go. `pnpm/setup` manages the Node.js runtime via `pnpm runtime`, which requires pnpm >= 11.1.0, so bump the workspace to `pnpm@11.9.0`. pnpm 11 also needs explicit build-script and hoist configuration: - `allowBuilds` for the deps that ship install scripts (esbuild/sharp/es5-ext) - `publicHoistPattern` for `*eslint*`/`*prettier*` so @sanity/pkg-utils can resolve `prettier-plugin-packagejson` during the build Other changes: - CI test matrix now selects the runtime (`node@lts` / `node@latest`) - Remove the `concurrency` group from the CI workflow - Delete the `setup-trusted-publish` workflow and its now-unused `setup-npm-trusted-publish` dependency Co-authored-by: Cody Olsen <stipsan@users.noreply.github.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
Restructures
react-rxinto a proper pnpm monorepo and replaces thesemantic-releaserelease flow with Changesets, mirroring the setup used in thesanity-io/pluginsmonorepo. Releases now publish to npm through the shared reusable Changesets workflow using npm Trusted Publishing (OIDC) — which is already configured on npm for therelease.ymlworkflow in this repo.Monorepo structure
The published library moved from the repo root into
packages/react-rx, and the root became a private workspace root (react-rx-monorepo).packages/react-rx/package.json; shared tooling (eslint, prettier, typescript) and Changesets tooling live in the root.build,test,watch→react-rx;dev→react-rx-website;lint/formatrun across the workspace;release→changeset publish.Changesets migration
.changeset/config.json(@changesets/changelog-github,access: public,baseBranch: current,privatePackages: false).semantic-release: deleted.releaserc.jsonand droppedsemantic-release+@sanity/semantic-release-preset; added@changesets/cliand@changesets/changelog-github..github/workflows/release.yml— on push tocurrent, callssanity-io/.github/.github/workflows/changesets.yml@mainto open/update the "Version Packages" PR and publish via OIDC trusted publishing (secrets: inherit,id-token: write)..github/workflows/changesets-from-conventional-commits.yml— auto-adds changesets to Renovate (renovate[bot]) and React Compiler (squiggler-legacy[bot]) dependency PRs based on their conventional-commit titles, preserving the previous "dependencyfix:updates trigger a release" behavior..github/workflows/ci.yml— trimmed to build + test (the release job is gone); both jobs use a shared.github/actions/setupcomposite action.Release flow after this PR
pnpm changeset.current,release.ymlopens/updates a "Version Packages" PR.react-rxto npm via trusted publishing (no npm token needed).This PR itself contains no changeset — it's a repo restructure that doesn't change the published package's code or version (
4.2.2), so merging it won't trigger a release.CI / tooling modernization
pnpm/setup@v1— the sharedsetupcomposite action now uses a singlepnpm/setup@v1step in place ofpnpm/action-setup+actions/setup-node+pnpm install. Sincepnpm/setupmanages the Node.js runtime viapnpm runtime(which needs pnpm ≥ 11.1.0), the workspace is bumped topnpm@11.9.0. The CI test matrix selects the runtime (node@lts/node@latest).pnpm-workspace.yaml:allowBuilds(esbuild/sharp/es5-ext install scripts) andpublicHoistPattern(*eslint*/*prettier*, so@sanity/pkg-utilscan resolveprettier-plugin-packagejsonat build time).concurrencygroup fromci.yml.setup-trusted-publish.ymland its now-unusedsetup-npm-trusted-publishdependency.prettier.yml→format-if-needed.yml(to ease a future move to oxfmt).Verification
pnpm install(frozen, CI-equivalent) ✅ under pnpm 11.9.0pnpm build✅ →packages/react-rx/distpnpm lint✅pnpm test✅ (48 tests,default+react-compilerprojects)pnpm --filter react-rx-website build✅ (verifies the website resolves the moved package +distraw import)Notes
websitestays at the repo root (not moved underapps/) to avoid breaking the Vercel deployment, whose root directory iswebsite. It's still a workspace member and now references the package atpackages/react-rx. Moving it can be a follow-up alongside a Vercel root-directory change.semantic-releaseconfig also released a prerelease channel fromcrx-749(branch no longer exists) and a2.xmaintenance channel fromv2(dormant since Aug 2023). Like the plugins monorepo, this setup releases only fromcurrent; a 2.x maintenance release would need a separate workflow/Changesets pre-release setup if ever required.vitest.workspace.tsdeprecation warning is pre-existing (unrelated to this change).