You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,6 +278,39 @@ Commit the changeset file with your PR.
278
278
279
279
This monorepo uses [Changesets](https://github.com/changesets/changesets) for version management and publishing.
280
280
281
+
### Preview Packages in a PR (`pkg-pr-new`)
282
+
283
+
You can publish preview versions of changed plugin packages directly from a PR using [`pkg.pr.new`](https://pkg.pr.new).
284
+
285
+
#### How it is triggered
286
+
287
+
The preview workflow runs on PR events **only when the PR has the `trigger: preview` label**.
288
+
289
+
1. Open your PR
290
+
2. Add the `trigger: preview` label
291
+
3. Wait for the `Publish` workflow (`.github/workflows/pkg-pr-new.yml`) to finish
292
+
293
+
#### What gets preview-published
294
+
295
+
The workflow detects changed packages from `.changeset/*.md` files in your PR diff and publishes only matching plugin packages.
296
+
297
+
- It ignores `.changeset/README.md`
298
+
- It supports package names that map to:
299
+
-`@sanity/*` -> `plugins/@sanity/*`
300
+
-`sanity-plugin-*` -> `plugins/sanity-plugin-*`
301
+
302
+
If no valid changesets are found, no packages are published.
303
+
304
+
#### How to use the preview
305
+
306
+
After the workflow runs, it posts (or updates) a PR comment titled **"Preview this PR with pkg.pr.new"** that includes install commands for each published package (for both `pnpm` and `npm`).
307
+
308
+
Use the provided command in another project to test the preview package version, for example:
0 commit comments