chore: publish pkg.pr.new preview packages on labeled pull requests - #3262
Conversation
|
|
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.
|
Bundle Stats✅ No significant changes. All scenario measurements (7)🗺️
Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time. |
@portabletext/block-tools
@portabletext/editor
@portabletext/html
@portabletext/keyboard-shortcuts
@portabletext/markdown
@portabletext/patches
@portabletext/plugin-character-pair-decorator
@portabletext/plugin-dnd
@portabletext/plugin-emoji-picker
@portabletext/plugin-input-rule
@portabletext/plugin-list-index
@portabletext/plugin-markdown-shortcuts
@portabletext/plugin-one-line
@portabletext/plugin-paste-link
@portabletext/plugin-sdk-value
@portabletext/plugin-table
@portabletext/plugin-typeahead-picker
@portabletext/plugin-typography
racejar
@portabletext/sanity-bridge
@portabletext/schema
@portabletext/test
@portabletext/toolbar
commit: |
Add a "Publish Preview Packages" workflow that runs on pull requests carrying a preview label and hands the selected packages to `pkg-pr-new publish`. `trigger: preview` selects the package directories the pull request touches, derived from `git diff --name-only base...HEAD`; `trigger: preview-all` selects every package and wins when both labels are present. When the diff touches no package directory the job emits a notice and skips the build and publish steps rather than falling back to publishing everything, which would make the label mean two different things depending on the diff. The selection step resolves both branches to an explicit list of directories, so the build filters Turbo down to those packages and their workspace dependencies instead of building all 23, and the publish step stays a single `pkg-pr-new` invocation, which is how pkg.pr.new keys its spam prevention. The CLI is a root devDependency executed from the lockfile rather than fetched with `pnpm dlx`, so the version that runs in CI is pinned. `--pnpm` is required because the workspace uses `catalog:` specifiers, which `npm pack` cannot resolve. The CLI authenticates through the pkg.pr.new GitHub App using the workflow run metadata and the app posts the pull request comment, so the job needs no `GITHUB_TOKEN` and only `contents: read`. Peer dependencies are not rewritten to preview URLs, so a plugin preview still resolves `@portabletext/editor` from npm unless the editor preview is published alongside it. The README documents this. Co-authored-by: Cursor <cursoragent@cursor.com>
9fe9a64 to
6320f5d
Compare
Description
Add a "Publish Preview Packages" workflow that runs on pull requests carrying the
trigger: previewlabel, buildspackages/*, and hands them topkg-pr-new publish. The CLI is a root devDependency executed from the lockfile rather than fetched withpnpm dlx, so the version that runs in CI is pinned.--pnpmis required because the workspace usescatalog:specifiers, whichnpm packcannot resolve.The CLI authenticates through the pkg.pr.new GitHub App using the workflow run metadata; the app posts the PR comment, so the job needs no
GITHUB_TOKENand onlycontents: read.Peer dependencies are not rewritten to preview URLs, so a plugin preview still resolves
@portabletext/editorfrom npm unless the editor preview is installed alongside it. The README documents this.