Skip to content

Publish a preview of every package on every push - #50

Merged
stefanoverna merged 1 commit into
mainfrom
feat/continuous-releases
Aug 31, 2026
Merged

Publish a preview of every package on every push#50
stefanoverna merged 1 commit into
mainfrom
feat/continuous-releases

Conversation

@stefanoverna

Copy link
Copy Markdown
Member

Every commit pushed to a branch here now produces installable tarballs of all
five packages, without publishing anything to npm:

npx https://pkg.pr.new/datocms@<commit-sha> environments:list
npm i https://pkg.pr.new/@datocms/cli-plugin-wordpress@<commit-sha>

Why

This is the thing a monorepo cannot give us, because our packages are spread
across several of them. Trying a CLI change against a real project, or letting
someone confirm a fix before we cut a release, currently means either a release
or npm link. Now it's a URL that expires on its own.

Verified on this branch

The run on bff0e30 published all five. Installed into a throwaway project, the
binary runs:

$ ./node_modules/.bin/datocms --version
datocms/4.2.0 darwin-arm64 node-v22.22.3

and the resolution splits exactly where the repo boundary is:

datocms                 → pkg.pr.new     (this repo)
@datocms/cli-utils      → pkg.pr.new     (this repo)
@datocms/cma-client     → registry.npmjs.org   (js-rest-api-clients)
@datocms/cma-client-node→ registry.npmjs.org   (js-rest-api-clients)

So oclif's prepack — build, oclif manifest, oclif readme — survives being
run by npm pack in CI, which was the thing most likely to break here.

Also in this PR

@datocms/cli-utils was the only package without a repository field. It gets
one, so its preview URLs take the short form like the other four (and so npm
shows a source link on its page).

Choices worth reviewing

Pushes only, no fork pull requests. The workflow runs on pushes to branches
of this repo, which only people with write access can make. This is deliberate:
pkg.pr.new URLs carry our namespace and the tarballs are served
unauthenticated, so an unreviewed fork should not be able to mint one.
pkg.pr.new documents an "approved pull requests only" recipe if we want fork
previews later.

This is the repo's first workflow. There is no CI here at all — no lint, no
build, no test on a PR. This one only builds and publishes; adding real CI is a
separate PR and worth doing.

No changeset. Nothing about the published packages changes.

One thing to know

Previews are throwaway and the URLs stop resolving after a while. They must
never end up in a package.json that ships.

A change to the CLI or a plugin can now be run straight from a branch,
without a release:

    npx https://pkg.pr.new/datocms@<commit-sha> environments:list

Nothing reaches npm, no version is spent, and there is nothing to clean
up afterwards. Also gives `@datocms/cli-utils` the `repository` field it
was missing, which is what pkg.pr.new reads to mint the short URL form —
the other four packages already had one.

Runs only on pushes to branches of this repo, so a fork cannot mint a URL
under our namespace without a maintainer pushing the code first.

Claude-Session: https://claude.ai/code/session_01TbxhxyU1XBsSKtoCJXwAoD
@stefanoverna
stefanoverna merged commit a2e15e1 into main Aug 31, 2026
2 checks passed
@stefanoverna
stefanoverna deleted the feat/continuous-releases branch August 31, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant