Skip to content

Commit 3d02c9d

Browse files
committed
docs: update preview-build content for the registry bridge publish
Preview builds now publish only to the registry bridge, so update the content that still described pkg.pr.new as the publish destination: MAINTENANCE.md's preview section (the direct pkg.pr.new URL install no longer exists for new builds), the upgrade guide, Dockerfile comments, install script and code comments, and the migrate test harness (its manual-register fallback advice is replaced by re-labeling the PR, since a bare registered ref has no artifacts to fall back to anymore). Kept as-is: the pkg.pr.new label and file/flag/env names (muscle memory and API stability), pkg.pr.new-style URL/header descriptors (accurate style descriptions), legacy pkg.pr.new-URL migration tests and fixtures (the migrator still rewrites those specs from existing projects), and historical RFCs.
1 parent c823a32 commit 3d02c9d

11 files changed

Lines changed: 31 additions & 24 deletions

File tree

.claude/skills/test-pkg-pr-new-migrate/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
name: test-pkg-pr-new-migrate
3-
description: Verify a pkg.pr.new build of vite-plus against a real project before release — run `vp migrate` from the pkg.pr.new commit against a local project, deps resolved through the registry bridge. Use when asked to verify/e2e-test a pkg.pr.new build against a project, "test PR #<N> on <project>", or check a prerelease against a repo.
3+
description: Verify a preview (registry bridge) build of vite-plus against a real project before release — run `vp migrate` from the preview commit against a local project, deps resolved through the registry bridge. Use when asked to verify/e2e-test a preview or pkg-pr-new build against a project, "test PR #<N> on <project>", or check a prerelease against a repo.
44
allowed-tools: Bash, Read
55
---
66

7-
# Verify a pkg.pr.new build against one project
7+
# Verify a preview build against one project
88

99
Installs an isolated global `vp` built from a registry bridge commit build and runs `vp migrate` on a specified local project. The global CLI and the migrated project both pin `vite-plus`/`vite` to the clearly-defined `0.0.0-commit.<sha>` build. `vp migrate` itself writes the bridge registry into the project's `.npmrc` (or `.yarnrc.yml` for Yarn Berry) so the deps resolve, during this run and in the project's own CI; this script only force-stages that file past `.gitignore`.
1010

@@ -16,7 +16,7 @@ Required inputs: a `<PR-or-SHA>` (the build to verify) and a `<project-path>`. I
1616
.github/scripts/test-pkg-pr-new-migrate.sh 1891 /path/to/npmx.dev --no-interactive
1717
```
1818

19-
- First arg is a PR number or commit SHA; the script resolves the immutable commit via the bridge `x-commit-key` header and verifies the bridge serves it (the pkg.pr.new publish workflow registers each commit).
19+
- First arg is a PR number or commit SHA; the script resolves the immutable commit via the bridge `x-commit-key` header and verifies the bridge serves it (the preview publish workflow, triggered by the `pkg.pr.new` label, registers each commit).
2020
- Never touches `~/.vite-plus`; clears only the workspace ROOT lockfile + `node_modules` before migrating; refuses a dirty worktree unless `ALLOW_DIRTY=1`; prints the project's `git status`/`diff` at the end — inspect that to confirm the migration result.
2121

2222
**The build under test must include the "migrate writes the bridge registry" feature** (this session's work / current branch head onward). The harness no longer writes the registry itself — it relies on `vp migrate` doing it. Testing an older build with this harness would leave the project with no bridge registry, so its deps resolve from npmjs (`ERR_PNPM_NO_MATCHING_VERSION` on the `0.0.0-commit.<sha>` version). Always verify a fresh build of the branch, not a stale published commit.

.github/scripts/test-pkg-pr-new-migrate.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,14 @@ resolved_ref="$available_commit"
108108
commit_version="0.0.0-commit.$resolved_ref"
109109
vite_core_spec="npm:@voidzero-dev/vite-plus-core@$commit_version"
110110

111-
# The bridge only serves commit builds it has been told about (registered by the
112-
# pkg.pr.new publish workflow). Fail early with an actionable message instead of
113-
# letting the project install hit an opaque registry miss.
111+
# The bridge only serves commit builds published by the preview publish
112+
# workflow (triggered by the `pkg.pr.new` label). Fail early with an actionable
113+
# message instead of letting the project install hit an opaque registry miss.
114114
if ! curl -fsS "${bridge_registry}@voidzero-dev/vite-plus-core" 2>/dev/null |
115115
grep -q "0.0.0-commit.$resolved_ref"; then
116116
echo "error: the registry bridge has no build for commit $resolved_ref" >&2
117-
echo "Ensure the pkg.pr.new publish workflow registered it, or register it manually:" >&2
118-
echo " curl -fsS -X POST -H \"authorization: Bearer \$PKG_PR_BRIDGE_ADMIN_TOKEN\" \\" >&2
119-
echo " -H 'content-type: application/json' -d '{\"ref\":\"commit.$resolved_ref\"}' \\" >&2
120-
echo " ${bridge_registry}-/refs" >&2
117+
echo "Publish it by re-adding the pkg.pr.new label to the PR (the preview publish" >&2
118+
echo "workflow packs, uploads, and registers each labeled commit)." >&2
121119
exit 1
122120
fi
123121

.github/workflows/reusable-release-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
set -euo pipefail
6565
# Stamp ${VERSION} as the [package] version so CARGO_PKG_VERSION matches
6666
# the version that gets published/installed (the release version, or
67-
# 0.0.0-commit.<sha> for pkg.pr.new). Anchored to the line-start
67+
# 0.0.0-commit.<sha> for preview builds). Anchored to the line-start
6868
# `version = "..."` so crate dependency versions are never touched.
6969
for f in crates/vite_global_cli/Cargo.toml packages/cli/binding/Cargo.toml; do
7070
node -e 'const fs=require("fs"),f=process.argv[1];fs.writeFileSync(f,fs.readFileSync(f,"utf8").replace(/^version = "[^"]*"/m,`version = "${process.env.VERSION}"`))' "$f"

MAINTENANCE.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22

33
## Publishing Preview Packages
44

5-
Publish to https://pkg.pr.new/~/voidzero-dev/vite-plus
5+
Add the `pkg.pr.new` label to the PR (the label name predates the registry
6+
bridge). Each labeled commit is published to the
7+
[registry bridge](https://registry-bridge.viteplus.dev/-/refs) as the npm
8+
version `0.0.0-commit.<sha>`; the PR gets a sticky comment with the exact
9+
version and install steps.
610

7-
Add the `pkg.pr.new` label to the PR.
11+
Install a preview build with the install script (PR number or commit sha):
812

9-
Use the commit sha, e.g.:
13+
```sh
14+
curl -fsSL https://vite.plus | VP_PR_VERSION=1569 bash
15+
```
16+
17+
Or pin it in a project through the bridge registry (`.npmrc`:
18+
`registry=https://registry-bridge.viteplus.dev/`):
1019

1120
```sh
12-
pnpm add https://pkg.pr.new/voidzero-dev/vite-plus@sha
21+
pnpm add vite-plus@0.0.0-commit.<sha>
1322
```

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LABEL org.opencontainers.image.source="https://github.com/voidzero-dev/vite-plus
2020
# docker build --build-arg VP_VERSION=1.4.2 .
2121
ARG VP_VERSION=latest
2222

23-
# Optional: build a preview image from a pkg.pr.new build instead of npm.
23+
# Optional: build a preview image from a registry bridge build instead of npm.
2424
# Set to a PR number or commit SHA; when set it overrides VP_VERSION.
2525
# docker build --build-arg VP_PR_VERSION=1569 .
2626
ARG VP_PR_VERSION=
@@ -50,7 +50,7 @@ ENV VP_HOME=/home/vp/.vite-plus \
5050
PATH=/home/vp/.vite-plus/bin:$PATH
5151

5252
# Install the vp global CLI. The installer downloads the platform package from
53-
# npm (or from pkg.pr.new when VP_PR_VERSION is set). Node.js itself is
53+
# npm (or from the registry bridge when VP_PR_VERSION is set). Node.js itself is
5454
# provisioned per-project by vp at build time, honoring `.node-version` /
5555
# `engines.node` / `devEngines.runtime`.
5656
#

docs/guide/upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Then set the `vitest` override to that exact version, or rerun `vp migrate` to u
6262

6363
Some Vite+ pull requests publish temporary packages for testing before an npm release. Treat these as nightly or bleeding-edge builds: they are useful when you want to verify a specific fix, test a fresh upstream dependency bump, or confirm a change before the next release. For day-to-day work, prefer the published `latest` release.
6464

65-
Each commit on an eligible pull request is published to [pkg.pr.new](https://pkg.pr.new) and registered with the [registry bridge](https://registry-bridge.viteplus.dev/). The bridge serves these builds as ordinary npm versions of the form `0.0.0-commit.<sha>` and proxies every other package to the npm registry. That means you install a preview with normal version specs instead of mutable URLs, and the same versions resolve in CI.
65+
Each commit on an eligible pull request is published to the [registry bridge](https://registry-bridge.viteplus.dev/). The bridge serves these builds as ordinary npm versions of the form `0.0.0-commit.<sha>` and proxies every other package to the npm registry. That means you install a preview with normal version specs instead of mutable URLs, and the same versions resolve in CI.
6666

6767
Both `vite-plus` and `@voidzero-dev/vite-plus-core` publish under the same `0.0.0-commit.<sha>` version. Each pull request carries a comment listing the exact version for its latest commit, along with ready-to-copy install steps.
6868

packages/cli/install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $LocalTgz = $env:VP_LOCAL_TGZ
2626
$LocalBinary = $env:VP_LOCAL_BINARY
2727
# PR number or commit SHA to install as a test build (registry bridge mode)
2828
$PrVersion = $env:VP_PR_VERSION
29-
# Registry bridge that serves pkg.pr.new builds as clearly-versioned packages.
29+
# Registry bridge that serves PR preview builds as clearly-versioned packages.
3030
# The pkg.pr.new-style download URL (BridgeDownloadBase) 302-redirects to a
3131
# canonical 0.0.0-commit.<sha> tarball; the registry (BridgeRegistry) resolves
3232
# those commit versions (and proxies everything else to npmjs) so a full install

packages/cli/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LOCAL_TGZ="${VP_LOCAL_TGZ:-}"
3737
LOCAL_BINARY="${VP_LOCAL_BINARY:-}"
3838
# PR number or commit SHA to install as a test build (registry bridge mode)
3939
PR_VERSION="${VP_PR_VERSION:-}"
40-
# Registry bridge that serves pkg.pr.new builds as clearly-versioned packages.
40+
# Registry bridge that serves PR preview builds as clearly-versioned packages.
4141
# The pkg.pr.new-style download URL (BRIDGE_DOWNLOAD_BASE) 302-redirects to a
4242
# canonical 0.0.0-commit.<sha> tarball; the registry (BRIDGE_REGISTRY) resolves
4343
# those commit versions (and proxies everything else to npmjs) so a full install

packages/cli/src/migration/migrator/package-json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export function rewritePackageJson(
159159
if (isForceOverrideMode()) {
160160
for (const { dependencies } of dependencyGroups) {
161161
if (dependencies?.[VITE_PLUS_NAME]) {
162-
// The referenced catalog entry is rewritten to the pkg.pr.new target
162+
// The referenced catalog entry is rewritten to the preview target
163163
// separately. Preserve named/default catalog references so projects
164164
// such as Vize do not gain an unnecessary default catalog.
165165
if (

packages/cli/src/migration/migrator/vite-plus-bootstrap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ function ensureVitePlusDependencySpecs(
807807
}
808808
// Catalog writers update every existing managed entry in place. Keep a
809809
// package's deliberate named/default reference instead of collapsing all
810-
// packages onto the workspace's preferred catalog, including pkg.pr.new
810+
// packages onto the workspace's preferred catalog, including preview
811811
// force-override runs.
812812
if (version.startsWith('catalog:') && spec.startsWith('catalog:')) {
813813
continue;
@@ -823,7 +823,7 @@ function ensureVitePlusDependencySpecs(
823823
// Plain (non-protocol-pinned) range like `^0.1.24` → rewrite to the target
824824
// (`catalog:` for catalog-supporting projects, otherwise the concrete
825825
// version). Already-`catalog:` / other protocol pins are left untouched,
826-
// except in force-override mode where ecosystem/pkg.pr.new validation must
826+
// except in force-override mode where ecosystem/preview validation must
827827
// replace every prior target with the requested artifact.
828828
if (isForceOverrideMode() || !isProtocolPinnedSpec(spec)) {
829829
dependencies[VITE_PLUS_NAME] = version;

0 commit comments

Comments
 (0)