Skip to content

chore: publish pkg.pr.new preview packages on labeled pull requests - #3262

Merged
pepahlavacek merged 1 commit into
mainfrom
chore_add_pr_previews
Sep 10, 2026
Merged

chore: publish pkg.pr.new preview packages on labeled pull requests#3262
pepahlavacek merged 1 commit into
mainfrom
chore_add_pr_previews

Conversation

@pepahlavacek

Copy link
Copy Markdown
Contributor

Description

Add a "Publish Preview Packages" workflow that runs on pull requests carrying the trigger: preview label, builds packages/*, and hands them to pkg-pr-new publish. 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; the app posts the PR 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 installed alongside it. The README documents this.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6320f5d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
portable-text-editor-documentation Ready Ready Preview Sep 10, 2026 12:02pm UTC
portable-text-example-basic Ready Ready Preview Sep 10, 2026 12:02pm UTC
portable-text-playground Ready Ready Preview Sep 10, 2026 12:02pm UTC

Request Review

@socket-security

socket-security Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpkg-pr-new@​0.0.881001007097100

View full report

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Bundle Stats

✅ No significant changes.

All scenario measurements (7)

🗺️ @portabletext/editor / @portabletext/editor · @portabletext/editor / @portabletext/editor/behaviors · @portabletext/editor / @portabletext/editor/plugins · @portabletext/editor / @portabletext/editor/selectors · @portabletext/editor / @portabletext/editor/traversal · @portabletext/editor / @portabletext/editor/utils · @portabletext/markdown / @portabletext/markdown · Artifacts

Scenario Kind Bundle (raw / gzip) Gzip change Import time Import change
⚪ @portabletext/editor / @portabletext/editor export 1.09 MB / 254.3 KB None 68 ms -0 ms, -0.0%
⚪ @portabletext/editor / @portabletext/editor/behaviors export 4.0 KB / 1.4 KB None 2 ms +0 ms, +1.5%
⚪ @portabletext/editor / @portabletext/editor/plugins export 5.1 KB / 1.8 KB None 7 ms -0 ms, -2.4%
⚪ @portabletext/editor / @portabletext/editor/selectors export 94.7 KB / 21.7 KB None 8 ms +0 ms, +3.2%
⚪ @portabletext/editor / @portabletext/editor/traversal export 42.8 KB / 11.2 KB None 6 ms +0 ms, +3.0%
⚪ @portabletext/editor / @portabletext/editor/utils export 33.8 KB / 9.1 KB None 6 ms +0 ms, +2.5%
⚪ @portabletext/markdown / @portabletext/markdown export 313.4 KB / 90.9 KB None 42 ms -1 ms, -2.9%

Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time.

@pepahlavacek pepahlavacek added the trigger: preview Publish previews of the packages this PR changes label Sep 10, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

@portabletext/block-tools

npm i https://pkg.pr.new/@portabletext/block-tools@3262

@portabletext/editor

npm i https://pkg.pr.new/@portabletext/editor@3262

@portabletext/html

npm i https://pkg.pr.new/@portabletext/html@3262

@portabletext/keyboard-shortcuts

npm i https://pkg.pr.new/@portabletext/keyboard-shortcuts@3262

@portabletext/markdown

npm i https://pkg.pr.new/@portabletext/markdown@3262

@portabletext/patches

npm i https://pkg.pr.new/@portabletext/patches@3262

@portabletext/plugin-character-pair-decorator

npm i https://pkg.pr.new/@portabletext/plugin-character-pair-decorator@3262

@portabletext/plugin-dnd

npm i https://pkg.pr.new/@portabletext/plugin-dnd@3262

@portabletext/plugin-emoji-picker

npm i https://pkg.pr.new/@portabletext/plugin-emoji-picker@3262

@portabletext/plugin-input-rule

npm i https://pkg.pr.new/@portabletext/plugin-input-rule@3262

@portabletext/plugin-list-index

npm i https://pkg.pr.new/@portabletext/plugin-list-index@3262

@portabletext/plugin-markdown-shortcuts

npm i https://pkg.pr.new/@portabletext/plugin-markdown-shortcuts@3262

@portabletext/plugin-one-line

npm i https://pkg.pr.new/@portabletext/plugin-one-line@3262

@portabletext/plugin-paste-link

npm i https://pkg.pr.new/@portabletext/plugin-paste-link@3262

@portabletext/plugin-sdk-value

npm i https://pkg.pr.new/@portabletext/plugin-sdk-value@3262

@portabletext/plugin-table

npm i https://pkg.pr.new/@portabletext/plugin-table@3262

@portabletext/plugin-typeahead-picker

npm i https://pkg.pr.new/@portabletext/plugin-typeahead-picker@3262

@portabletext/plugin-typography

npm i https://pkg.pr.new/@portabletext/plugin-typography@3262

racejar

npm i https://pkg.pr.new/racejar@3262

@portabletext/sanity-bridge

npm i https://pkg.pr.new/@portabletext/sanity-bridge@3262

@portabletext/schema

npm i https://pkg.pr.new/@portabletext/schema@3262

@portabletext/test

npm i https://pkg.pr.new/@portabletext/test@3262

@portabletext/toolbar

npm i https://pkg.pr.new/@portabletext/toolbar@3262

commit: 6320f5d

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>

@christianhg christianhg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice

@pepahlavacek pepahlavacek added the trigger: preview-all Publish previews of every package label Sep 10, 2026
@pepahlavacek
pepahlavacek merged commit ab6fa7b into main Sep 10, 2026
21 checks passed
@pepahlavacek
pepahlavacek deleted the chore_add_pr_previews branch September 10, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger: preview Publish previews of the packages this PR changes trigger: preview-all Publish previews of every package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants