Publish a preview of the package on every push - #111
Merged
Conversation
Every commit pushed to a branch now produces an installable tarball, so
a rendering change can be tried in a real Nuxt site without a release:
npm i https://pkg.pr.new/datocms/vue-datocms@<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.
Also replaces the `git://` in `repository.url` with `git+https://`. GitHub
stopped serving `git://` in 2022, so the field was stale either way; it is
also what pkg.pr.new reads — from the npm registry, not from here — to
decide whether it can mint the shorter URL form. So the short form starts
working one release from now, and until then the URL above is the one to
use.
Claude-Session: https://claude.ai/code/session_01TbxhxyU1XBsSKtoCJXwAoD
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every commit pushed to a branch here now produces an installable tarball,
without publishing anything to npm:
Why
Every consumer of this package lives in another repository — the Nuxt starter
kit, the demos, customer sites. Judging a rendering change means running it in
one of them, which today costs a release or
npm link. Now it's a URL thatexpires 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 64440a2 published the package, and the exact URL documented in the
README installs into a throwaway project.
The README's table of contents is hand-maintained here (
npm run toconlycovers
src/), so the new heading is listed by hand.Also in this PR:
git://→git+https://repository.urlstill usedgit://, which GitHub stopped serving in 2022, sothe field was stale regardless. It also happens to be what pkg.pr.new reads to
decide whether it can mint the short URL form — but it reads the npm
registry, not this repo, so the short form only starts working one release
from now. Until then the long URL above is the one to use, and it keeps working
afterwards either way.
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.
Node pinned at 22, not the matrix
node.js.ymlruns. This job only has tobuild a tarball, not prove which Node versions the package supports.
One thing to know
Previews are throwaway and the URLs stop resolving after a while. They must
never end up in a
package.jsonthat ships.