example(cloudflare-pr-package): pr-package upload/download/auth example#638
Open
Mkassabov wants to merge 1 commit into
Open
example(cloudflare-pr-package): pr-package upload/download/auth example#638Mkassabov wants to merge 1 commit into
Mkassabov wants to merge 1 commit into
Conversation
Rename the `cloudflare-worker-auth` example to `cloudflare-pr-package` — it demonstrates the `@alchemy.run/pr-package` library specifically, so the name should say so. The worker is `PrPackage.handler()` and the bearer token comes from `PrPackage.AuthTokenValue`. Integration tests against a real deploy: - bearer auth: valid -> 200, invalid / missing / "<redacted>" -> 401 - upload a bundle and download the exact bytes back (direct + via tag) - garbage collection: a bundle is removed once its last tag pointer is deleted Bumps the distilled submodule pin to include the Cloudflare error-class tree-shaking fix (distilled#352) so the Worker bundle no longer ships a dangling `import "@distilled.cloud/cloudflare/flagship"`. The pin is one commit past v0.25.2 and not yet a published release; re-pin to the tagged release once distilled cuts it.
Contributor
|
Install the packages built from this commit: alchemy bun add alchemy@https://pkg.ing/alchemy/ad9666e@alchemy.run/better-auth bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/ad9666e@alchemy.run/pr-package bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/ad9666e |
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.
An example demonstrating the
@alchemy.run/pr-packagelibrary end to end, with integration tests against a real deploy.Renamed from
cloudflare-worker-auth— the example is specifically about@alchemy.run/pr-package, so the name now says so. The worker isPrPackage.handler()and the stack output's bearer token comes fromPrPackage.AuthTokenValue.Tests (
test/integ.test.ts)Deployed once via
beforeAll, driven over HTTP:200; invalid / missing / literal"<redacted>"all401PUTa bundle, then download the exact bytes back both directly byresourceIdand via the tag (which302-redirects to the package)KV is eventually consistent and cold bindings can return transient
5xx, so reads/uploads poll until the converged status (pollUntilStatus). Upload retries are safe because the R2 bucket self-empties on destroy.Distilled pin
Bumps the
distilledsubmodule to include the Cloudflare error-class tree-shaking fix (distilled#352) — without it the Worker bundle keeps a danglingimport "@distilled.cloud/cloudflare/flagship"and Cloudflare rejects the upload withScriptModuleNotFound.The pin is one commit past
v0.25.2and not yet a published release. Re-pin to the tagged release once distilled cutsv0.25.3, before the nextalchemynpm publish.