Skip to content

Commit 8c002ff

Browse files
Merge pull request #10 from ScriptedAlchemy/docs/preview-packages
docs: explain installing pkg.pr.new preview packages
2 parents e0d9c87 + 31dfbe1 commit 8c002ff

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

‎.github/workflows/package-preview.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ name: Package preview
22

33
on:
44
pull_request:
5+
push:
6+
branches: [main]
57

68
permissions: {}
79

810
concurrency:
9-
group: package-preview-${{ github.event.pull_request.number }}
11+
group: package-preview-${{ github.event.pull_request.number || github.ref }}
1012
cancel-in-progress: true
1113

1214
jobs:

‎docs/preview-packages.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Preview packages (pkg.pr.new)
2+
3+
Nothing is published to npm yet. Every CI package-preview run publishes real,
4+
installable tarballs of both workspace packages to [pkg.pr.new](https://pkg.pr.new)
5+
— a free continuous-release registry keyed by commit SHA and pull request.
6+
These are the packages to install until a first npm release is cut.
7+
8+
## Install the latest preview
9+
10+
Reference a pull request number to track its most recent build:
11+
12+
```sh
13+
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@1
14+
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@1
15+
```
16+
17+
`@1` resolves to the last preview published for PR #1 — commit `5685521` at the
18+
time of its merge, which is the state that landed on `main`.
19+
20+
## Pin an exact commit
21+
22+
Any commit that had a package-preview run can be installed by SHA (short SHAs
23+
work), which is the right form for lockfiles and reproducible setups:
24+
25+
```sh
26+
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@5685521
27+
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@5685521
28+
```
29+
30+
pnpm and yarn accept the same URLs (`pnpm add <url>`, `yarn add agent-bundle@<url>`).
31+
32+
## Where previews come from
33+
34+
`.github/workflows/package-preview.yml` runs
35+
`pnpm preview:publish` (`pkg-pr-new publish './packages/agent-bundle'
36+
'./packages/rsc-runtime'`) after a full build, on every pull request and on
37+
every push to `main`. The "Publish pkg.pr.new preview" check on a PR or commit
38+
links to the exact URLs for that build. Previews are built from the same
39+
`pnpm build` output the release gates verify; they are not npm releases and
40+
carry preview version strings.

0 commit comments

Comments
 (0)