Skip to content

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

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

Publish a preview of every package on every push#40
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
ten packages, without publishing anything to npm:

npm i https://pkg.pr.new/datocms-structured-text-utils@<commit-sha>

Why

This is the thing a monorepo cannot give us, because our packages are spread
across several of them. The consumers of these renderers — react-datocms,
vue-datocms, the demos, customer sites — all live elsewhere, so trying a
rendering change against one currently means a release or npm link.

Verified on this branch

The run on 32c6ed5 published all ten. Installing just the top of the chain in a
throwaway project brings the whole chain from the same commit:

datocms-structured-text-to-html-string        → pkg.pr.new
datocms-structured-text-generic-html-renderer → pkg.pr.new
datocms-structured-text-utils                 → pkg.pr.new

and it runs:

render({ schema: 'dast', document: /* … */ })  // → <p>ok</p>

That chain is the reason this is worth having here specifically: the renderers
all sit on utils and generic-html-renderer, and with independent versioning
a change usually spans several of them. A preview of one package alone would
have been useless.

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.

A separate workflow, not a step in node.js.yml. That one runs a matrix of
two Node versions; pkg-pr-new must run exactly once per workflow run.

Actions pinned at v4, matching node.js.yml. The other repos are on v6/v7 —
bumping all of them is a separate, unrelated PR.

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 renderer or util change can now be installed into a real site straight
from a branch, without a release:

    npm i https://pkg.pr.new/datocms-structured-text-utils@<commit-sha>

Nothing reaches npm, no version is spent, and there is nothing to clean
up afterwards. Installing one preview pulls in the previews of its
siblings from the same commit, which matters here: the renderers all sit
on top of `utils` and `generic-html-renderer`.

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 691b261 into main Aug 31, 2026
4 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