Self-hosting guide, MIT license, and removal of the pkg.pr.new fallback#61
Merged
Conversation
Add docs/self-hosting.md, an independent walkthrough for deploying a bridge for another project (fork, configure env, deploy to Void, wire the publish action), using vite-plus as the worked example. Add an MIT LICENSE and the package.json license field, and link both from the README.
The Worker no longer builds preview tarballs in-process or redirects platform binaries to pkg.pr.new. CI publishes every artifact to R2 and the Worker only serves from it, so a version whose bytes are absent now 404s. Drop the PKG_PR_NEW_BASE var and the now-dead MAX_TARBALL_BYTES, the toPkgPrNewUrl / fetchUpstreamTarball / platformInfo modules, and the pkg.pr.new dependency-URL rewriting (rewritePackageJson keeps only batch-pinning). Update tests, rebuild the action bundle, and record the change in the README, self-hosting guide, and RFC 0001.
Member
Author
|
@codex review |
48ea32e to
6516d3c
Compare
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Remove the orphaned isPreviewPackage helper and the PKG_PR_NEW_BASE and MAX_TARBALL_BYTES vars still declared in wrangler.test.jsonc. Make the `batch` argument required on rewritePackageJson / buildPreviewTarball (the CI publish action, the only caller, always passes one) and drop the now-dead `?? PREVIEW_PACKAGES` default. Rebuild the action bundle.
Add a "Why a separate registry" section covering npm's 100 MB packument cap and why the bridge keeps per-commit previews out of it.
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.
Three related changes: a deployment tutorial so other projects can run their own bridge, an MIT license, and the removal of the Worker's pkg.pr.new fallback (the bridge now serves only from R2).
Docs + license
docs/self-hosting.md: an independent, end-to-end walkthrough (fork, configure.env, deploy to Void, attach a domain, wire the upstream project's CI to the publish action, set up OIDC/staging deploys). Uses vite-plus as the worked example alongside a hypotheticalacme-corp/acme-bundler.LICENSE: MIT,Copyright (c) 2026-present, VoidZero Inc.(matches voidzero-dev/vite-plus). Adds thelicensefield topackage.json.Remove PKG_PR_NEW_BASE and the on-demand fallback
The Worker no longer builds preview tarballs in-process or redirects platform binaries to pkg.pr.new. CI publishes every artifact to R2 and the Worker only serves from it, so a version whose bytes are absent now 404s.
src/preview/toPkgPrNewUrl.ts,src/tarball/fetchUpstreamTarball.ts,src/preview/platformInfo.ts.getPreviewBuild.ts:getPreviewMeta/getPreviewTarballBody404 on an R2 miss (no in-Worker build, no upstream redirect).PKG_PR_NEW_BASEand the now-deadMAX_TARBALL_BYTES(they only bounded the fallback's upstream download) fromenv.ts,config.ts,.env.rewritePackageJsonkeeps only batch-pinning (droppedpkgPrNewUrlToVersion/RewriteEnv/ theenvparam);buildPreviewTarballdrops itsenvparam. Action source + committed bundle updated.Typecheck clean, 97 tests pass, action bundle rebuilt.