ReviewOS

also looking at this

stacks/rpx

feat: imgx integration — on-the-fly image transforms from query params

#2264
Merged glennmichael123 wants to merge feat/imgx-integration into main
15 files +1118 -16
packages/rpx/src/registry.tsmodified+4-1
Changes to packages/rpx/src/registry.ts
@@ -14,7 +14,7 @@
1414 * - `id` is validated against a strict charset to keep it from escaping
1515 * the registry directory.
1616 */
17import type { BasicAuthConfig, LoadBalancerConfig, PathRewrite, ProxyFrom, StaticRouteConfig } from './types'
17import type { BasicAuthConfig, ImgxOptions, LoadBalancerConfig, PathRewrite, ProxyFrom, StaticRouteConfig } from './types'
1818import * as fs from 'node:fs'
1919import * as fsp from 'node:fs/promises'
2020import { homedir } from 'node:os'
@@ -50,6 +50,8 @@ export interface RegistryEntry {
5050 pathRewrites?: PathRewrite[]
5151 cleanUrls?: boolean
5252 changeOrigin?: boolean
53 /** Transform image responses from imgix-style query params — see {@link ImgxOptions}. */
54 imgx?: boolean | ImgxOptions
5355 /** Serve a local directory for this route instead of proxying. */
5456 static?: string | StaticRouteConfig
5557 /** Optional HTTP Basic auth gate for this route. */
@@ -300,6 +302,7 @@ export function watchRegistry(
300302 pathRewrites: entry.pathRewrites,
301303 cleanUrls: entry.cleanUrls,
302304 changeOrigin: entry.changeOrigin,
305 imgx: entry.imgx,
303306 static: entry.static,
304307 loadBalancer: entry.loadBalancer,
305308 }))