ci: publish pkg.pr.new previews on every PR / push#7
Merged
Conversation
Adds a `preview` job (gated on tests passing) that publishes a commit-SHA-pinned preview of the tool via pkg.pr.new and posts a sticky PR comment with an install URL: `npm i https://pkg.pr.new/@juspay/rescript-bindgen@<sha>`. Lets anyone test the exact build of a PR/commit in another project without a real release or npm link. Requires the pkg-pr-new GitHub App on the repo (installed). PUBLISHING.md documents it.
Adds a "Preview builds" section under Install — how to `npm i` a commit-pinned preview (https://pkg.pr.new/@juspay/rescript-bindgen@<sha>) to test an unreleased change, and that previews don't affect the normal latest/beta install.
commit: |
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.
Adds per-PR/commit preview builds of the tool itself via pkg.pr.new, mirroring blend's #1358 but adapted for this repo (npm, single package, no build step).
What it does
A new
previewjob inci.yml(gated on the smoke + golden tests passing) runsnpx pkg-pr-new publishon every PR and every push tomain. The bot posts a sticky PR comment with an install URL:Why
Right now, testing an unreleased fix means using local source or
npm link. With previews, anyone cannpm ithe exact build of a PR/commit into another project and runnpx rescript-bindgen …— no clone, no link, no waiting for a real release. (This is exactly the gap we hit testing the @types/react fix.)Previews live on pkg.pr.new's domain (not npmjs.org), are commit-pinned and ephemeral, and don't touch
latest/beta.Setup
The pkg-pr-new GitHub App is already installed on the repo (no token to manage).
PUBLISHING.mddocuments the preview flow.Notes
filesallowlist (src/, types.d.ts, README, …), so the preview ships the working CLI.main(includes Type-mapping correctness + golden test suite + mapping reference + prerelease publishing #4/Fix two compile-breaking bugs: @unboxed in record cycles + prototype-safe lookups #5/Fix forwardRef no-props + CSSProperties/ReactNode widening (co-install @types/react) #6); tests green.