Skip to content

feat(autorender): add Autorender image CDN provider - #198

Open
vasanth-rb wants to merge 1 commit into
ascorbic:mainfrom
vasanth-rb:feat/autorender-provider
Open

feat(autorender): add Autorender image CDN provider#198
vasanth-rb wants to merge 1 commit into
ascorbic:mainfrom
vasanth-rb:feat/autorender-provider

Conversation

@vasanth-rb

Copy link
Copy Markdown

Adds Autorender as an image CDN provider.

URL shape

Autorender serves transformed assets from assets.autorender.io with path-segment transformations:

https://assets.autorender.io/{workspace}/{transformations}/{asset-path}
https://assets.autorender.io/cQQ9C4UxSb/c_fill,w_720,h_480,f_auto/ar-juice.jpg

Transformations are comma-separated key_value tokens. The provider maps the standard operations to w, h, f and q, and exposes c (fill | fit | crop) as a provider-specific operation. f_auto is the default so the origin negotiates the best format from the request headers. When both width and height are given, c_fill is applied so the behaviour matches the cover semantics other providers use.

The transformation segment is optional — extract detects 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 on transform.

Scope

  • Only assets.autorender.io is recognised. Custom domains aren't a product feature yet, so URLs on other hosts return null from extract rather than being guessed at.
  • generate needs a workspace: either taken from an existing Autorender URL or passed as options.workspace when 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 lint and deno fmt --check all clean on the touched files.
  • deno publish --dry-run passes.
  • Both e2e.test.ts steps were verified against production for the demo URL: w_720 returns 720px wide, and c_fill,w_100,h_50 returns 100×50.

One unrelated line: deno.jsonc was missing a trailing newline, so adding the export entry also makes it pass deno fmt --check.

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d57f2b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
unpic Minor

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

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