Skip to content

Self-hosting guide, MIT license, and removal of the pkg.pr.new fallback#61

Merged
fengmk2 merged 7 commits into
mainfrom
docs/self-hosting-guide
Jul 9, 2026
Merged

Self-hosting guide, MIT license, and removal of the pkg.pr.new fallback#61
fengmk2 merged 7 commits into
mainfrom
docs/self-hosting-guide

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jul 9, 2026

Copy link
Copy Markdown
Member

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 hypothetical acme-corp/acme-bundler.
  • LICENSE: MIT, Copyright (c) 2026-present, VoidZero Inc. (matches voidzero-dev/vite-plus). Adds the license field to package.json.
  • README: links the new guide and adds a License section.

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.

  • Deleted src/preview/toPkgPrNewUrl.ts, src/tarball/fetchUpstreamTarball.ts, src/preview/platformInfo.ts.
  • getPreviewBuild.ts: getPreviewMeta / getPreviewTarballBody 404 on an R2 miss (no in-Worker build, no upstream redirect).
  • Removed PKG_PR_NEW_BASE and the now-dead MAX_TARBALL_BYTES (they only bounded the fallback's upstream download) from env.ts, config.ts, .env.
  • rewritePackageJson keeps only batch-pinning (dropped pkgPrNewUrlToVersion / RewriteEnv / the env param); buildPreviewTarball drops its env param. Action source + committed bundle updated.
  • Tests updated (the two fallback tests now assert 404 / omitted version; the in-Worker-rebuild suite removed). README, self-hosting guide, and RFC 0001 note the change.

Typecheck clean, 97 tests pass, action bundle rebuilt.

@fengmk2 fengmk2 changed the title docs: add self-hosting guide and MIT license Self-hosting guide, MIT license, and removal of the pkg.pr.new fallback Jul 9, 2026
fengmk2 added 5 commits July 9, 2026 11:53
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.
@fengmk2

fengmk2 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@codex review

@fengmk2 fengmk2 force-pushed the docs/self-hosting-guide branch from 48ea32e to 6516d3c Compare July 9, 2026 03:54
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 48ea32e7bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

fengmk2 added 2 commits July 9, 2026 12:05
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.
@fengmk2 fengmk2 marked this pull request as ready for review July 9, 2026 05:41
@fengmk2 fengmk2 merged commit f57eaa9 into main Jul 9, 2026
4 checks passed
@fengmk2 fengmk2 deleted the docs/self-hosting-guide branch July 9, 2026 05:41
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