feat(autorender): add Autorender image CDN provider - #198
Open
vasanth-rb wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: 7d57f2b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 Autorender as an image CDN provider.
URL shape
Autorender serves transformed assets from
assets.autorender.iowith path-segment transformations:Transformations are comma-separated
key_valuetokens. The provider maps the standard operations tow,h,fandq, and exposesc(fill|fit|crop) as a provider-specific operation.f_autois the default so the origin negotiates the best format from the request headers. When bothwidthandheightare given,c_fillis applied so the behaviour matches the cover semantics other providers use.The transformation segment is optional —
extractdetects whether the second path segment is a transformation list or the start of the asset path, so untransformed and nested asset URLs round-trip unchanged. Tokens the library doesn't model are parsed through and preserved ontransform.Scope
assets.autorender.iois recognised. Custom domains aren't a product feature yet, so URLs on other hosts returnnullfromextractrather than being guessed at.generateneeds a workspace: either taken from an existing Autorender URL or passed asoptions.workspacewhen generating from a relative asset path. It throws for source URLs on other hosts, since there's nothing meaningful to build from them.Checks
deno check src/,deno test src/(87 passed, 296 steps),deno lintanddeno fmt --checkall clean on the touched files.deno publish --dry-runpasses.e2e.test.tssteps were verified against production for the demo URL:w_720returns 720px wide, andc_fill,w_100,h_50returns 100×50.One unrelated line:
deno.jsoncwas missing a trailing newline, so adding the export entry also makes it passdeno fmt --check.