Skip to content

Publish a preview of the package on every push - #3

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

Publish a preview of the package on every push#3
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 an installable tarball,
without publishing anything to npm:

npm i https://pkg.pr.new/@datocms/content-link@<commit-sha>

Why

Overlay and stega behaviour can really only be judged in a real project, and
every one of those lives in another repository. Today that means a release or
npm link. Now it's a URL that expires on its own, and a fix can be handed to
whoever reported it before we release.

This is one of ten repos getting the same workflow; the four monorepos are in
datocms/js-rest-api-clients#58 and its siblings.

Verified on this branch

The run on d4c524b published the package; installed into a throwaway project it
resolves and unpacks correctly:

node_modules/@datocms/content-link   → pkg.pr.new
  main: ./dist/index.cjs
  contents: dist/ src/ LICENSE README.md package.json

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.

Node pinned at 22, not a matrix. This job only has to build a tarball, not
prove which Node versions the package supports.

This is the repo's first workflow. There is no CI here at all — no build,
lint or test on a PR. Note npm run build here also runs typecheck, so this
workflow does catch a type error, but that is a side effect, not coverage.
Adding real CI is a separate PR and worth doing.

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.

Every commit pushed to a branch now produces an installable tarball, so
an overlay change can be tried against a real project without a release:

    npm i https://pkg.pr.new/@datocms/content-link@<commit-sha>

Nothing reaches npm, no version is spent, and there is nothing to clean
up afterwards. This replaces `npm link` and pinning a git branch by hand,
and it means a fix can be handed to whoever reported it before we cut a
release.

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 3edfe65 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