Publish a preview of both packages on every push - #52
Merged
Conversation
An SDK change can now be installed into a real plugin straight from a
branch, without a release:
npm i https://pkg.pr.new/datocms-plugin-sdk@<commit-sha>
Nothing reaches npm, no version is spent, and there is nothing to clean
up afterwards. Installing one preview pulls in the other from the same
commit, so a change touching both is tried as one set.
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
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 installable tarballs of both
packages, without publishing anything to npm:
Why
This one matters more than for the other repos: the only real test of an SDK
change is a plugin using it, and every plugin lives in a different repository —
ours in
datocms/plugins, everyone else's in their own. Today that meanscutting a release, or
npm link, which is exactly the friction that makes usbatch SDK changes instead of shipping them.
Now a plugin author can be handed a URL to try a fix before we release it.
Verified on this branch
The run on 71e3354 published both. Installed into a throwaway project:
Installing
datocms-react-uialone pulls in thedatocms-plugin-sdkpreviewbuilt from the same commit, so a change touching both is tried as one set.
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 — plausibly worth it here, given plugin authors do send PRs.
A separate workflow, not a step in
node.js.yml. That one runs a matrix oftwo Node versions; pkg-pr-new must run exactly once per workflow run.
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.jsonthat ships.