rari 0.17.9 → 0.17.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cli.d.mts +4 -7
  2. package/dist/cli.mjs +49 -40
  3. package/dist/define-BIL9PMLh.mjs +1 -0
  4. package/dist/{define-BafO1-XT.d.mts → define-DCZgXfOp.d.mts} +0 -2
  5. package/dist/fly-BZsz03bn.mjs +59 -0
  6. package/dist/font/google-catalog.d.mts +15 -0
  7. package/dist/font/google.d.mts +1 -3
  8. package/dist/font/local.d.mts +2 -4
  9. package/dist/font.d.mts +1 -1
  10. package/dist/get-client-component-DVAbynLr.mjs +1 -0
  11. package/dist/headers.d.mts +1 -3
  12. package/dist/image/runtime-config.d.mts +1 -3
  13. package/dist/image/static.d.mts +1 -1
  14. package/dist/image.d.mts +1 -5
  15. package/dist/image.mjs +1 -1
  16. package/dist/index.d.mts +2 -4
  17. package/dist/mdx/define.d.mts +1 -1
  18. package/dist/mdx/define.mjs +1 -1
  19. package/dist/mdx/registry.d.mts +1 -3
  20. package/dist/mdx.d.mts +1 -5
  21. package/dist/mdx.mjs +1 -1
  22. package/dist/og.d.mts +0 -2
  23. package/dist/platform.d.mts +1 -3
  24. package/dist/{preload-modules-BDQFWAlZ.mjs → preload-modules-0iyuP4Vs.mjs} +2 -2
  25. package/dist/proxy/RariRequest.d.mts +2 -4
  26. package/dist/proxy/RariResponse.d.mts +1 -1
  27. package/dist/proxy/executor.d.mts +1 -3
  28. package/dist/railway-DUCTAuA9.mjs +10 -0
  29. package/dist/{react-helpers-GTRYJwF2.d.mts → react-helpers-CZtKqfS6.d.mts} +0 -2
  30. package/dist/render-DawwdqvN.mjs +14 -0
  31. package/dist/{router-kf_rLP_F.mjs → router-861SNPMt.mjs} +1 -1
  32. package/dist/router.d.mts +0 -8
  33. package/dist/router.mjs +1 -1
  34. package/dist/runtime/AppRouterProvider.d.mts +1 -5
  35. package/dist/runtime/AppRouterProvider.mjs +1 -1
  36. package/dist/runtime/ClientRouter.d.mts +1 -3
  37. package/dist/runtime/ClientRouter.mjs +3 -3
  38. package/dist/runtime/ErrorBoundaryWrapper.d.mts +0 -2
  39. package/dist/runtime/ErrorBoundaryWrapper.mjs +1 -1
  40. package/dist/runtime/action-flight-refresh.d.mts +0 -2
  41. package/dist/runtime/action-revalidation-kind.d.mts +1 -3
  42. package/dist/runtime/call-server.d.mts +1 -3
  43. package/dist/runtime/entry-client.d.mts +2 -4
  44. package/dist/runtime/entry-client.mjs +3 -3
  45. package/dist/runtime/merge-flight-refresh.d.mts +2 -4
  46. package/dist/runtime/rsc-client-runtime.d.mts +1 -5
  47. package/dist/runtime/rsc-client-runtime.mjs +1 -1
  48. package/dist/runtime/rsc-references.d.mts +0 -2
  49. package/dist/{sitemap-DIL-PFSt.mjs → sitemap-ByPlT2YN.mjs} +1 -1
  50. package/dist/{static-modules-BnpA9S9v.d.mts → static-modules-DmO7M_cF.d.mts} +0 -4
  51. package/dist/{types-DAdRjhuk.d.mts → types-CSDt4P_t.d.mts} +0 -4
  52. package/dist/{types-C8N3Hc8I.d.mts → types-Cw2SI7r7.d.mts} +0 -2
  53. package/dist/{types-yeW6ju9Y.d.mts → types-DNk27dqJ.d.mts} +0 -10
  54. package/dist/{types-CkZPEEdi.d.mts → types-DeWes1rB.d.mts} +0 -2
  55. package/dist/{utils-YdvPzSET-Cbo6Ofmz.mjs → utils-DZWuxUA--BobVI1xy.mjs} +1 -37
  56. package/dist/vite.d.mts +2 -26
  57. package/dist/vite.mjs +77 -75
  58. package/package.json +14 -14
  59. package/dist/define-Dsj1lR4C.mjs +0 -1
  60. package/dist/get-client-component-D2K213pV.mjs +0 -1
  61. package/dist/railway-CE3nqaKt.mjs +0 -67
  62. package/dist/render-D0eMtn5L.mjs +0 -73
package/dist/cli.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/cli/build-target.d.ts
2
1
  type ViteAppCommand = 'build' | 'dev' | 'preview' | 'pack';
3
2
  export declare function readDefaultPackageTarget(configSource: string, command?: ViteAppCommand): string | null;
4
3
  export declare function readBuildOutDir(configSource: string): string | null;
@@ -8,16 +7,14 @@ export declare function resolveViteBuildPackageRoot(cwd: string, viteBin?: 'vp'
8
7
  export declare function resolveConfiguredBuildOutDir(packageRoot: string): string;
9
8
  export declare function findImageConfigPath(packageRoot: string): string | null;
10
9
  export declare function outDirFromImageConfigPath(imageConfigPath: string, packageRoot: string): string;
11
- //#endregion
12
- //#region src/cli/index.d.ts
13
10
  type PackageManager = 'pnpm' | 'yarn' | 'bun' | 'npm';
14
11
  declare function detectPackageManager(): PackageManager;
15
- declare function isRailwayEnvironment(): boolean;
16
- declare function isRenderEnvironment(): boolean;
12
+ declare const isRailwayEnvironment: () => boolean;
13
+ declare const isRenderEnvironment: () => boolean;
14
+ declare const isFlyEnvironment: () => boolean;
17
15
  declare function getDeploymentConfig(): {
18
16
  port: string;
19
17
  mode: string;
20
18
  host: string;
21
19
  };
22
- //#endregion
23
- export { detectPackageManager, getDeploymentConfig, isRailwayEnvironment, isRenderEnvironment };
20
+ export { detectPackageManager, getDeploymentConfig, isFlyEnvironment, isRailwayEnvironment, isRenderEnvironment };
package/dist/cli.mjs CHANGED
@@ -1,64 +1,73 @@
1
1
  #!/usr/bin/env node
2
- import{b as e,d as t,x as n,y as r}from"./type-guards-BLY2PlGR.mjs";import{n as i,t as a}from"./dist-paths-C4EV064W.mjs";import{getBinaryPath as o,getInstallationInstructions as s}from"./platform.mjs";import{spawn as c}from"node:child_process";import{existsSync as l,readFileSync as u,readdirSync as d,realpathSync as f,rmSync as p}from"node:fs";import{basename as m,dirname as h,isAbsolute as g,join as _,resolve as v}from"node:path";import y from"node:process";import{fileURLToPath as b}from"node:url";import{once as ee}from"node:events";import{parseArgs as x,styleText as S}from"node:util";function C(e){console.warn(`${S(`blue`,`info`)} ${e}`)}function w(e){console.warn(`${S(`green`,`✓`)} ${e}`)}function T(e){console.error(`${S(`red`,`✗`)} ${e}`)}function E(e){console.warn(`${S(`yellow`,`⚠`)} ${e}`)}const te=[`vite.config.ts`];function D(e,t=`build`){let n=/(?:^|[,{\s])defaultPackage\s*:\s*['"]([^'"]+)['"]/.exec(e);if(n?.[1]!=null&&n[1]!==``)return n[1];let r=/(?:^|[,{\s])defaultPackage\s*:\s*\{([^}]*)\}/.exec(e);if(r?.[1]==null)return null;let i=RegExp(`(?:^|[,\\s])${t}\\s*:\\s*['"]([^'"]+)['"]`).exec(r[1])?.[1];return i!=null&&i!==``?i:null}function O(e){let t=/(?:^|[,{\s])outDir\s*:\s*['"]([^'"]+)['"]/.exec(e)?.[1];return t!=null&&t!==``?t:null}function k(e){let t=/(?:^|[,{\s])root\s*:\s*['"]([^'"]+)['"]/.exec(e)?.[1];return t!=null&&t!==``?t:null}function A(e){for(let t of te){let n=v(e,t);if(l(n))try{return u(n,`utf8`)}catch{return null}}return null}function j(e,t){return g(t)?t:v(e,t)}function M(e,t){let n=t==null?null:k(t);return n==null||n===``?e:j(e,n)}function N(e,t=`vp`,n=`build`){if(t!==`vp`)return e;let r=A(e);if(r==null)return e;let i=D(r,n);if(i==null||i===``)return e;let a=v(e,i);return l(a)?a:e}function P(e){let t=A(e),n=M(e,t),r=t==null?null:O(t);return r==null||r===``?v(n,a):j(n,r)}function ne(e){return m(e)===`client`?h(e):e}function F(e){let t=P(e),n=[_(ne(t),`server`,`image.json`),_(t,`server`,`image.json`),_(e,i,`server`,`image.json`)];for(let e of n)if(l(e))return e;let r;try{r=d(e)}catch{return null}for(let t of r){if(t===`node_modules`||t===`dist`||t.startsWith(`.`))continue;let n=_(e,t,`server`,`image.json`);if(l(n))return n}return null}function I(e,t){let n=h(e),i=h(n),a=M(t,A(t)),o=r(u(e,`utf8`))?.outDir;return typeof o==`string`&&o!==``?g(o)?o:v(a,o):_(i,`client`)}let L=null;function R(e){let t=l(e)?new Set(z(e)):/* @__PURE__ */ new Set;return t.has(`pnpm-lock.yaml`)?`pnpm`:t.has(`yarn.lock`)?`yarn`:t.has(`bun.lockb`)||t.has(`bun.lock`)?`bun`:t.has(`package-lock.json`)?`npm`:re(e)}function z(e){try{return d(e)}catch{return[]}}function re(t){try{let n=v(t,`package.json`);if(!l(n))return null;let i=r(u(n,`utf-8`));return i?e(i):null}catch{}return null}function ie(e){try{let t=v(e,`package.json`);if(!l(t))return null;let i=r(u(t,`utf-8`));return i?n(i):null}catch{}return null}function ae(e){let t=e,n=null,r=null;for(;t!==v(t,`..`)&&(n??=R(t),r??=ie(t),!(n&&r));)t=v(t,`..`);return{cwd:e,packageManager:n??`npm`,viteBin:r??`vite`}}function B(){let e=y.cwd();return L?.cwd===e||(L=ae(e)),L}function oe(){return B().packageManager}function V(){let e=B().packageManager,t=y.platform===`win32`;switch(e){case`bun`:return t?`bun.cmd`:`bun`;case`pnpm`:return t?`pnpm.cmd`:`pnpm`;case`yarn`:return t?`yarn.cmd`:`yarn`;case`npm`:return t?`npx.cmd`:`npx`;default:return t?`npx.cmd`:`npx`}}function H(e,t=y.cwd()){let n=y.platform===`win32`,r=t;for(;r!==v(r,`..`);){let t=v(r,`node_modules`,`.bin`),i=n?[v(t,`${e}.cmd`),v(t,`${e}.exe`),v(t,e)]:[v(t,e)];for(let e of i)if(l(e))return e;r=v(r,`..`)}return null}function U(e,t,n={}){let r=y.platform===`win32`;if(e===`npx`){let e=V();if(e.includes(`bun`))return c(r?`bunx.cmd`:`bunx`,t,{...n,shell:r});if(e.includes(`pnpm`))return c(e,[`exec`,...t],{...n,shell:r});if(e.includes(`yarn`)){let[i,...a]=t,o=i===`vp`?[`dlx`,`-p`,`vite-plus`,`vp`,...a]:[`dlx`,...t];return c(e,o,{...n,shell:r})}}return r&&e===`npx`?c(`npx.cmd`,t,{...n,shell:!0}):c(e,t,n)}function W(e,t,n={}){let r=H(e);if(r!=null&&r!==``){let e=y.platform===`win32`&&r.endsWith(`.cmd`);return c(r,t,e?{...n,shell:!0}:n)}return U(`npx`,[e,...t],n)}async function G(e,t={}){try{let[t]=await ee(e,`close`);return t}catch(e){if(t.tolerateErrors)return E(K(e)),1;throw e}}function K(e){if(t(e))return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function se(){let e=v(y.cwd(),`.env`);l(e)&&y.loadEnvFile(e)}function ce(e){let{values:t,positionals:n}=x({args:e,options:{help:{type:`boolean`,short:`h`,default:!1}},allowPositionals:!0,strict:!1});if(t.help===!0)return{command:`help`,args:[]};let[r=`help`,...i]=n;return{command:r,args:i}}function q(){return y.env.RAILWAY_ENVIRONMENT!=null&&y.env.RAILWAY_ENVIRONMENT!==``||y.env.RAILWAY_PROJECT_ID!=null&&y.env.RAILWAY_PROJECT_ID!==``||y.env.RAILWAY_SERVICE_ID!=null&&y.env.RAILWAY_SERVICE_ID!==``}function J(){return y.env.RENDER!=null&&y.env.RENDER!==``||y.env.RENDER_SERVICE_ID!=null&&y.env.RENDER_SERVICE_ID!==``||y.env.RENDER_SERVICE_NAME!=null&&y.env.RENDER_SERVICE_NAME!==``}function Y(){return q()||J()}function X(){return q()?`Railway`:J()?`Render`:`local`}function Z(){return{port:y.env.PORT!=null&&y.env.PORT!==``?y.env.PORT:y.env.RSC_PORT!=null&&y.env.RSC_PORT!==``?y.env.RSC_PORT:`3000`,mode:y.env.NODE_ENV!=null&&y.env.NODE_ENV!==``?y.env.NODE_ENV:`production`,host:y.env.RARI_HOST!=null&&y.env.RARI_HOST!==``?y.env.RARI_HOST:Y()?`0.0.0.0`:`127.0.0.1`}}async function Q(){$();let e=B().viteBin;C(`Type checking...`);let t=await G(W(`tsc`,[],{stdio:`inherit`,cwd:y.cwd()}));if(t===0)w(`Type check passed`);else throw T(`Type check failed with code ${t}`),Error(`Type check failed with code ${t}`);C(`Building for production...`);let n=await G(W(e,[`build`],{stdio:`inherit`,cwd:y.cwd()}));if(n===0)w(`Build complete`);else throw T(`Build failed with code ${n}`),Error(`Build failed with code ${n}`);await le()}async function le(){let e=y.cwd(),{viteBin:t}=B(),n=N(e,t),i=F(n);if(i==null)return;let a=I(i,n),s=h(i),d=`assets`;try{let e=r(u(i,`utf-8`));e&&typeof e.assetsDir==`string`&&e.assetsDir.length>0&&(d=e.assetsDir.replaceAll(/^\/+|\/+$/g,``))}catch{}let f=v(n,`public`),p=v(a,d),m=v(s,`static-image-sources.json`);if(l(f)||l(p)||l(m))try{let e=o(),t=await G(c(e,[`optimize-images`,`--config`,i],{stdio:`inherit`,cwd:n,shell:!1}),{tolerateErrors:!0});t!==0&&E(`Image pre-optimization exited with code ${t}`)}catch(e){E(`Could not pre-optimize images: ${K(e)}`)}}async function ue(){let e=B().viteBin,t=v(y.cwd(),`dist`);if(!l(t)){C(`First run detected - building project...`);let t=await G(W(e,[`build`,`--mode`,`development`],{stdio:`inherit`,cwd:y.cwd()}));if(t===0)w(`Initial build complete`);else throw T(`Build failed with code ${t}`),Error(`Build failed with code ${t}`)}C(`Starting Vite${e===`vp`?`+`:``} dev server...`);let n=W(e,[`dev`],{stdio:`inherit`,cwd:y.cwd()}),r=()=>{C(`Shutting down dev server...`),n.kill(`SIGTERM`)};return y.on(`SIGINT`,r),y.on(`SIGTERM`,r),n.on(`error`,e=>{T(`Failed to start Vite: ${e.message}`),y.exit(1)}),n.on(`exit`,e=>{e!==0&&e!==null&&(T(`Vite exited with code ${e}`),y.exit(e))}),new Promise(()=>{})}async function de(){let e;try{e=o()}catch{T(`Failed to obtain rari binary`),T(s()),y.exit(1)}let{port:t,mode:n,host:r}=Z();if(Y()){let i=X();C(`${i} environment detected`),C(`Starting rari server for ${i} deployment...`),C(`Mode: ${n}, Host: ${r}, Port: ${t}`),C(`using binary: ${e}`)}let i=[`--mode`,n,`--port`,t,`--host`,r],a=y.platform!==`win32`&&y.stdin.isTTY,l=c(e,i,{stdio:`inherit`,cwd:y.cwd(),detached:a,env:{...y.env,RUST_LOG:y.env.RUST_LOG!=null&&y.env.RUST_LOG!==``?y.env.RUST_LOG:`error`}}),u=!1,d,f=()=>{u||(u=!0,C(`shutting down...`),l.kill(`SIGTERM`),d=setTimeout(()=>{l.kill(`SIGKILL`),y.exit(1)},5e3),d.unref())};return y.on(`SIGINT`,f),y.on(`SIGTERM`,f),y.on(`exit`,()=>{try{l.kill(`SIGKILL`)}catch{}}),l.on(`error`,e=>{T(`Failed to start rari server: ${e.message}`),e.message.includes(`ENOENT`)&&T(`Binary not found. Please ensure rari is properly installed.`),y.exit(1)}),l.on(`exit`,(e,t)=>{d&&clearTimeout(d),t!=null&&t!==``?(u&&(C(`server stopped by signal ${t}`),y.exit(0)),T(`server stopped unexpectedly by signal ${t}`),y.exit(1)):e===0?(w(`server stopped successfully`),y.exit(0)):(T(`server exited with code ${e}`),y.exit(e!=null&&e!==0?e:1))}),new Promise(()=>{})}async function fe(){C(`Setting up Railway deployment...`),Y()&&(T(`Already running in ${X()} environment. Use "rari start" instead.`),y.exit(1));let{createRailwayDeployment:e}=await import(`./railway-CE3nqaKt.mjs`);e()}async function pe(){C(`Setting up Render deployment...`),Y()&&(T(`Already running in ${X()} environment. Use "rari start" instead.`),y.exit(1));let{createRenderDeployment:e}=await import(`./render-D0eMtn5L.mjs`);e()}function $(){let e=v(y.cwd(),`dist`);l(e)?(C(`Cleaning dist folder...`),p(e,{recursive:!0,force:!0}),w(`Cleaned dist folder`)):C(`No dist folder to clean`)}function me(){console.warn(`${S(`bold`,`rari CLI`)}
2
+ import{b as e,d as t,x as n,y as r}from"./type-guards-BLY2PlGR.mjs";import{n as i,t as a}from"./dist-paths-C4EV064W.mjs";import{getBinaryPath as o,getInstallationInstructions as s}from"./platform.mjs";import{spawn as c}from"node:child_process";import{existsSync as l,readFileSync as u,readdirSync as d,realpathSync as f,rmSync as p}from"node:fs";import{basename as m,dirname as h,isAbsolute as g,join as _,resolve as v}from"node:path";import y from"node:process";import{fileURLToPath as ee}from"node:url";import{once as b}from"node:events";import{parseArgs as te,styleText as x}from"node:util";function S(e){console.warn(`${x(`blue`,`info`)} ${e}`)}function C(e){console.warn(`${x(`green`,`✓`)} ${e}`)}function w(e){console.error(`${x(`red`,`✗`)} ${e}`)}function T(e){console.warn(`${x(`yellow`,`⚠`)} ${e}`)}const E=[`vite.config.ts`];function D(e,t=`build`){let n=/(?:^|[,{\s])defaultPackage\s*:\s*['"]([^'"]+)['"]/.exec(e);if(n?.[1]!=null&&n[1]!==``)return n[1];let r=/(?:^|[,{\s])defaultPackage\s*:\s*\{([^}]*)\}/.exec(e);if(r?.[1]==null)return null;let i=RegExp(`(?:^|[,\\s])${t}\\s*:\\s*['"]([^'"]+)['"]`).exec(r[1])?.[1];return i!=null&&i!==``?i:null}function O(e){let t=/(?:^|[,{\s])outDir\s*:\s*['"]([^'"]+)['"]/.exec(e)?.[1];return t!=null&&t!==``?t:null}function k(e){let t=/(?:^|[,{\s])root\s*:\s*['"]([^'"]+)['"]/.exec(e)?.[1];return t!=null&&t!==``?t:null}function A(e){for(let t of E){let n=v(e,t);if(l(n))try{return u(n,`utf8`)}catch{return null}}return null}function j(e,t){return g(t)?t:v(e,t)}function M(e,t){let n=t==null?null:k(t);return n==null||n===``?e:j(e,n)}function N(e,t=`vp`,n=`build`){if(t!==`vp`)return e;let r=A(e);if(r==null)return e;let i=D(r,n);if(i==null||i===``)return e;let a=v(e,i);return l(a)?a:e}function P(e){let t=A(e),n=M(e,t),r=t==null?null:O(t);return r==null||r===``?v(n,a):j(n,r)}function F(e){return m(e)===`client`?h(e):e}function I(e){let t=P(e),n=[_(F(t),`server`,`image.json`),_(t,`server`,`image.json`),_(e,i,`server`,`image.json`)];for(let e of n)if(l(e))return e;let r;try{r=d(e)}catch{return null}for(let t of r){if(t===`node_modules`||t===`dist`||t.startsWith(`.`))continue;let n=_(e,t,`server`,`image.json`);if(l(n))return n}return null}function L(e,t){let n=h(e),i=h(n),a=M(t,A(t)),o=r(u(e,`utf8`))?.outDir;return typeof o==`string`&&o!==``?g(o)?o:v(a,o):_(i,`client`)}let R=null;function ne(e){let t=l(e)?new Set(re(e)):/* @__PURE__ */ new Set;return t.has(`pnpm-lock.yaml`)?`pnpm`:t.has(`yarn.lock`)?`yarn`:t.has(`bun.lockb`)||t.has(`bun.lock`)?`bun`:t.has(`package-lock.json`)?`npm`:ie(e)}function re(e){try{return d(e)}catch{return[]}}function ie(t){try{let n=v(t,`package.json`);if(!l(n))return null;let i=r(u(n,`utf-8`));return i?e(i):null}catch{}return null}function ae(e){try{let t=v(e,`package.json`);if(!l(t))return null;let i=r(u(t,`utf-8`));return i?n(i):null}catch{}return null}function oe(e){let t=e,n=null,r=null;for(;t!==v(t,`..`)&&(n??=ne(t),r??=ae(t),!(n&&r));)t=v(t,`..`);return{cwd:e,packageManager:n??`npm`,viteBin:r??`vite`}}function z(){let e=y.cwd();return R?.cwd===e||(R=oe(e)),R}function se(){return z().packageManager}function B(){let e=z().packageManager,t=y.platform===`win32`;switch(e){case`bun`:return t?`bun.cmd`:`bun`;case`pnpm`:return t?`pnpm.cmd`:`pnpm`;case`yarn`:return t?`yarn.cmd`:`yarn`;case`npm`:return t?`npx.cmd`:`npx`;default:return t?`npx.cmd`:`npx`}}function V(e,t=y.cwd()){let n=y.platform===`win32`,r=t;for(;r!==v(r,`..`);){let t=v(r,`node_modules`,`.bin`),i=n?[v(t,`${e}.cmd`),v(t,`${e}.exe`),v(t,e)]:[v(t,e)];for(let e of i)if(l(e))return e;r=v(r,`..`)}return null}function H(e,t,n={}){let r=y.platform===`win32`;if(e===`npx`){let e=B();if(e.includes(`bun`))return c(r?`bunx.cmd`:`bunx`,t,{...n,shell:r});if(e.includes(`pnpm`))return c(e,[`exec`,...t],{...n,shell:r});if(e.includes(`yarn`)){let[i,...a]=t,o=i===`vp`?[`dlx`,`-p`,`vite-plus`,`vp`,...a]:[`dlx`,...t];return c(e,o,{...n,shell:r})}}return r&&e===`npx`?c(`npx.cmd`,t,{...n,shell:!0}):c(e,t,n)}function U(e,t,n={}){let r=V(e);if(r!=null&&r!==``){let e=y.platform===`win32`&&r.endsWith(`.cmd`);return c(r,t,e?{...n,shell:!0}:n)}return H(`npx`,[e,...t],n)}async function W(e,t={}){try{let[t]=await b(e,`close`);return t}catch(e){if(t.tolerateErrors)return T(G(e)),1;throw e}}function G(e){if(t(e))return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function ce(){let e=v(y.cwd(),`.env`);l(e)&&y.loadEnvFile(e)}function le(e){let{values:t,positionals:n}=te({args:e,options:{help:{type:`boolean`,short:`h`,default:!1}},allowPositionals:!0,strict:!1});if(t.help===!0)return{command:`help`,args:[]};let[r=`help`,...i]=n;return{command:r,args:i}}function K(e){let t=y.env[e];return t!=null&&t!==``?t:void 0}function q(e){return K(e)!==void 0}const J=[{id:`railway`,name:`Railway`,envVars:[`RAILWAY_ENVIRONMENT`,`RAILWAY_PROJECT_ID`,`RAILWAY_SERVICE_ID`],setup:async()=>{let{createRailwayDeployment:e}=await import(`./railway-DUCTAuA9.mjs`);e()}},{id:`render`,name:`Render`,envVars:[`RENDER`,`RENDER_SERVICE_ID`,`RENDER_SERVICE_NAME`],setup:async()=>{let{createRenderDeployment:e}=await import(`./render-DawwdqvN.mjs`);e()}},{id:`fly`,name:`Fly.io`,envVars:[`FLY_APP_NAME`,`FLY_MACHINE_ID`,`FLY_ALLOC_ID`],setup:async()=>{let{createFlyDeployment:e}=await import(`./fly-BZsz03bn.mjs`);e()}}];function Y(e){return J.find(t=>t.id===e)?.envVars.some(q)??!1}function X(){return J.find(e=>e.envVars.some(q))}const ue=()=>Y(`railway`),de=()=>Y(`render`),fe=()=>Y(`fly`);function Z(){return{port:K(`PORT`)??K(`RSC_PORT`)??`3000`,mode:K(`NODE_ENV`)??`production`,host:K(`RARI_HOST`)??(X()?`0.0.0.0`:`127.0.0.1`)}}async function pe(){$();let e=z().viteBin;S(`Type checking...`);let t=await W(U(`tsc`,[],{stdio:`inherit`,cwd:y.cwd()}));if(t===0)C(`Type check passed`);else throw w(`Type check failed with code ${t}`),Error(`Type check failed with code ${t}`);S(`Building for production...`);let n=await W(U(e,[`build`],{stdio:`inherit`,cwd:y.cwd()}));if(n===0)C(`Build complete`);else throw w(`Build failed with code ${n}`),Error(`Build failed with code ${n}`);await me()}async function me(){let e=y.cwd(),{viteBin:t}=z(),n=N(e,t),i=I(n);if(i==null)return;let a=L(i,n),s=h(i),d=`assets`;try{let e=r(u(i,`utf-8`));e&&typeof e.assetsDir==`string`&&e.assetsDir.length>0&&(d=e.assetsDir.replaceAll(/^\/+|\/+$/g,``))}catch{}let f=v(n,`public`),p=v(a,d),m=v(s,`static-image-sources.json`);if(l(f)||l(p)||l(m))try{let e=o(),t=await W(c(e,[`optimize-images`,`--config`,i],{stdio:`inherit`,cwd:n,shell:!1}),{tolerateErrors:!0});t!==0&&T(`Image pre-optimization exited with code ${t}`)}catch(e){T(`Could not pre-optimize images: ${G(e)}`)}}async function he(){let e=z().viteBin,t=v(y.cwd(),`dist`);if(!l(t)){S(`First run detected - building project...`);let t=await W(U(e,[`build`,`--mode`,`development`],{stdio:`inherit`,cwd:y.cwd()}));if(t===0)C(`Initial build complete`);else throw w(`Build failed with code ${t}`),Error(`Build failed with code ${t}`)}S(`Starting Vite${e===`vp`?`+`:``} dev server...`);let n=U(e,[`dev`],{stdio:`inherit`,cwd:y.cwd()}),r=()=>{S(`Shutting down dev server...`),n.kill(`SIGTERM`)};return y.on(`SIGINT`,r),y.on(`SIGTERM`,r),n.on(`error`,e=>{w(`Failed to start Vite: ${e.message}`),y.exit(1)}),n.on(`exit`,e=>{e!==0&&e!==null&&(w(`Vite exited with code ${e}`),y.exit(e))}),new Promise(()=>{})}async function ge(){let e;try{e=o()}catch{w(`Failed to obtain rari binary`),w(s()),y.exit(1)}let{port:t,mode:n,host:r}=Z(),i=X();if(i){let a=i.name;S(`${a} environment detected`),S(`Starting rari server for ${a} deployment...`),S(`Mode: ${n}, Host: ${r}, Port: ${t}`),S(`using binary: ${e}`)}let a=[`--mode`,n,`--port`,t,`--host`,r],l=y.platform!==`win32`&&y.stdin.isTTY,u=c(e,a,{stdio:`inherit`,cwd:y.cwd(),detached:l,env:{...y.env,RUST_LOG:y.env.RUST_LOG!=null&&y.env.RUST_LOG!==``?y.env.RUST_LOG:`error`}}),d=!1,f,p=()=>{d||(d=!0,S(`shutting down...`),u.kill(`SIGTERM`),f=setTimeout(()=>{u.kill(`SIGKILL`),y.exit(1)},5e3),f.unref())};return y.on(`SIGINT`,p),y.on(`SIGTERM`,p),y.on(`exit`,()=>{try{u.kill(`SIGKILL`)}catch{}}),u.on(`error`,e=>{w(`Failed to start rari server: ${e.message}`),e.message.includes(`ENOENT`)&&w(`Binary not found. Please ensure rari is properly installed.`),y.exit(1)}),u.on(`exit`,(e,t)=>{f&&clearTimeout(f),t!=null&&t!==``?(d&&(S(`server stopped by signal ${t}`),y.exit(0)),w(`server stopped unexpectedly by signal ${t}`),y.exit(1)):e===0?(C(`server stopped successfully`),y.exit(0)):(w(`server exited with code ${e}`),y.exit(e!=null&&e!==0?e:1))}),new Promise(()=>{})}async function Q(e){let t=J.find(t=>t.id===e);t||(w(`Unknown deployment target. Available: ${J.map(e=>e.id).join(`, `)}`),y.exit(1)),S(`Setting up ${t.name} deployment...`);let n=X();n&&(w(`Already running in ${n.name} environment. Use "rari start" instead.`),y.exit(1)),await t.setup()}function $(){let e=v(y.cwd(),`dist`);l(e)?(S(`Cleaning dist folder...`),p(e,{recursive:!0,force:!0}),C(`Cleaned dist folder`)):S(`No dist folder to clean`)}function _e(){console.warn(`${x(`bold`,`rari CLI`)}
3
3
 
4
- ${S(`bold`,`Usage:`)}
5
- ${S(`cyan`,`rari dev`)} Start the development server with Vite
6
- ${S(`cyan`,`rari build`)} Build for production
7
- ${S(`cyan`,`rari start`)} Start the rari server (defaults to production)
8
- ${S(`cyan`,`rari clean`)} Remove the dist folder
9
- ${S(`cyan`,`rari deploy railway`)} Setup Railway deployment
10
- ${S(`cyan`,`rari deploy render`)} Setup Render deployment
11
- ${S(`cyan`,`rari help`)} Show this help message
4
+ ${x(`bold`,`Usage:`)}
5
+ ${x(`cyan`,`rari dev`)} Start the development server with Vite
6
+ ${x(`cyan`,`rari build`)} Build for production
7
+ ${x(`cyan`,`rari start`)} Start the rari server (defaults to production)
8
+ ${x(`cyan`,`rari clean`)} Remove the dist folder
9
+ ${x(`cyan`,`rari deploy railway`)} Setup Railway deployment
10
+ ${x(`cyan`,`rari deploy render`)} Setup Render deployment
11
+ ${x(`cyan`,`rari deploy fly`)} Setup Fly.io deployment
12
+ ${x(`cyan`,`rari help`)} Show this help message
12
13
 
13
- ${S(`bold`,`Environment Variables:`)}
14
- ${S(`yellow`,`PORT`)} Server port (default: 3000)
15
- ${S(`yellow`,`RSC_PORT`)} Alternative server port
16
- ${S(`yellow`,`NODE_ENV`)} Environment (default: production for start, development for dev)
17
- ${S(`yellow`,`RUST_LOG`)} Rust logging level (default: info)
14
+ ${x(`bold`,`Environment Variables:`)}
15
+ ${x(`yellow`,`PORT`)} Server port (default: 3000)
16
+ ${x(`yellow`,`RSC_PORT`)} Alternative server port
17
+ ${x(`yellow`,`RARI_HOST`)} Address the server binds to (default: 0.0.0.0 on platforms, 127.0.0.1 locally)
18
+ ${x(`yellow`,`NODE_ENV`)} Environment (default: production for start, development for dev)
19
+ ${x(`yellow`,`RUST_LOG`)} Rust logging level (default: info)
18
20
 
19
- ${S(`bold`,`Examples:`)}
20
- ${S(`gray`,`# Start development server with Vite`)}
21
- ${S(`cyan`,`rari dev`)}
21
+ ${x(`bold`,`Examples:`)}
22
+ ${x(`gray`,`# Start development server with Vite`)}
23
+ ${x(`cyan`,`rari dev`)}
22
24
 
23
- ${S(`gray`,`# Build for production`)}
24
- ${S(`cyan`,`rari build`)}
25
+ ${x(`gray`,`# Build for production`)}
26
+ ${x(`cyan`,`rari build`)}
25
27
 
26
- ${S(`gray`,`# Clean dist folder`)}
27
- ${S(`cyan`,`rari clean`)}
28
+ ${x(`gray`,`# Clean dist folder`)}
29
+ ${x(`cyan`,`rari clean`)}
28
30
 
29
- ${S(`gray`,`# Start production server (default)`)}
30
- ${S(`cyan`,`rari start`)}
31
+ ${x(`gray`,`# Start production server (default)`)}
32
+ ${x(`cyan`,`rari start`)}
31
33
 
32
- ${S(`gray`,`# Start in development mode`)}
33
- ${S(`cyan`,`NODE_ENV=development rari start`)}
34
+ ${x(`gray`,`# Start in development mode`)}
35
+ ${x(`cyan`,`NODE_ENV=development rari start`)}
34
36
 
35
- ${S(`gray`,`# Start production server on port 8080`)}
36
- ${S(`cyan`,`PORT=8080 rari start`)}
37
+ ${x(`gray`,`# Start production server on port 8080`)}
38
+ ${x(`cyan`,`PORT=8080 rari start`)}
37
39
 
38
- ${S(`gray`,`# Setup Railway deployment`)}
39
- ${S(`cyan`,`rari deploy railway`)}
40
+ ${x(`gray`,`# Start production server reachable from other hosts (e.g. Docker)`)}
41
+ ${x(`cyan`,`RARI_HOST=0.0.0.0 rari start`)}
40
42
 
41
- ${S(`gray`,`# Setup Render deployment`)}
42
- ${S(`cyan`,`rari deploy render`)}
43
+ ${x(`gray`,`# Setup Railway deployment`)}
44
+ ${x(`cyan`,`rari deploy railway`)}
43
45
 
44
- ${S(`gray`,`# Start with debug logging`)}
45
- ${S(`cyan`,`RUST_LOG=debug rari start`)}
46
+ ${x(`gray`,`# Setup Render deployment`)}
47
+ ${x(`cyan`,`rari deploy render`)}
46
48
 
47
- ${S(`bold`,`Deployment:`)}
48
- ${S(`cyan`,`rari deploy railway`)} Creates Railway deployment files
49
- ${S(`cyan`,`rari deploy render`)} Creates Render deployment files
49
+ ${x(`gray`,`# Setup Fly.io deployment`)}
50
+ ${x(`cyan`,`rari deploy fly`)}
51
+
52
+ ${x(`gray`,`# Start with debug logging`)}
53
+ ${x(`cyan`,`RUST_LOG=debug rari start`)}
54
+
55
+ ${x(`bold`,`Deployment:`)}
56
+ ${x(`cyan`,`rari deploy railway`)} Creates Railway deployment files
57
+ ${x(`cyan`,`rari deploy render`)} Creates Render deployment files
58
+ ${x(`cyan`,`rari deploy fly`)} Creates Fly.io deployment files
50
59
 
51
60
  Platform deployment automatically detects the environment and configures:
52
- - Host binding (0.0.0.0 for platforms, 127.0.0.1 for local)
61
+ - Host binding (0.0.0.0 for platforms, 127.0.0.1 for local, or RARI_HOST if set)
53
62
  - Port from platform's PORT environment variable
54
63
  - Production mode optimization
55
64
 
56
- ${S(`bold`,`Binary Resolution:`)}
65
+ ${x(`bold`,`Binary Resolution:`)}
57
66
  1. Platform-specific package (rari-{platform}-{arch})
58
67
  2. Global binary in PATH
59
68
  3. Install from source with Cargo
60
69
 
61
- ${S(`bold`,`Notes:`)}
70
+ ${x(`bold`,`Notes:`)}
62
71
  - 'rari start' defaults to production mode unless NODE_ENV is set
63
72
  - 'rari dev' runs in development mode with Vite hot reload
64
73
  - 'rari build' cleans, type checks, and builds for production
@@ -66,4 +75,4 @@ ${S(`bold`,`Notes:`)}
66
75
  - Platform deployment is automatically detected and configured
67
76
  - Use Ctrl+C to stop the server gracefully
68
77
 
69
- `)}async function he(){se();let{command:e,args:t}=ce(y.argv.slice(2));if(e==null||e===`help`)me();else switch(e){case`dev`:await ue();break;case`build`:await Q();break;case`start`:await de();break;case`clean`:$();break;case`deploy`:t[0]===`railway`?await fe():t[0]===`render`?await pe():(T(`Unknown deployment target. Available: railway, render`),y.exit(1));break;default:console.error(`${S(`bold`,`Unknown command:`)} ${e}`),console.warn(`Run "${S(`cyan`,`rari help`)}" for available commands`),y.exit(1)}}function ge(){let e=y.argv[1]?f(v(y.argv[1])):``,t=f(b(import.meta.url));return!!e&&t===e}ge()&&he().catch(e=>{T(`CLI Error: ${K(e)}`),console.error(e),y.exit(1)});export{oe as detectPackageManager,F as findImageConfigPath,Z as getDeploymentConfig,q as isRailwayEnvironment,J as isRenderEnvironment,I as outDirFromImageConfigPath,O as readBuildOutDir,D as readDefaultPackageTarget,k as readViteRoot,P as resolveConfiguredBuildOutDir,M as resolveEffectiveViteRoot,N as resolveViteBuildPackageRoot};
78
+ `)}async function ve(){ce();let{command:e,args:t}=le(y.argv.slice(2));if(e==null||e===`help`)_e();else switch(e){case`dev`:await he();break;case`build`:await pe();break;case`start`:await ge();break;case`clean`:$();break;case`deploy`:await Q(t[0]);break;default:console.error(`${x(`bold`,`Unknown command:`)} ${e}`),console.warn(`Run "${x(`cyan`,`rari help`)}" for available commands`),y.exit(1)}}function ye(){let e=y.argv[1]?f(v(y.argv[1])):``,t=f(ee(import.meta.url));return!!e&&t===e}ye()&&ve().catch(e=>{w(`CLI Error: ${G(e)}`),console.error(e),y.exit(1)});export{se as detectPackageManager,I as findImageConfigPath,Z as getDeploymentConfig,fe as isFlyEnvironment,ue as isRailwayEnvironment,de as isRenderEnvironment,L as outDirFromImageConfigPath,O as readBuildOutDir,D as readDefaultPackageTarget,k as readViteRoot,P as resolveConfiguredBuildOutDir,M as resolveEffectiveViteRoot,N as resolveViteBuildPackageRoot};
@@ -0,0 +1 @@
1
+ import{g as e}from"./type-guards-BLY2PlGR.mjs";import{t}from"./names-CLmM0CPi.mjs";import{registerClientReference as n}from"./runtime/rsc-references.mjs";import{r}from"./rari-global-5vGzhToD.mjs";import{s as i}from"./regex-constants-DzXwNGh2.mjs";function a(e,t,a=`default`){let o=`${t}#${a}`;if(typeof globalThis<`u`){let n=r(),s=t.replace(i,``).split(`/`).pop(),c=s!=null&&s!==``?s:a,l={id:a==="default"?c:a,path:t,type:`client`,component:e,registered:!0};n[o]=l,n[c]=l,n[t]=l}function s(){throw Error(`Attempted to call ${a}() from the server but ${a} is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.`)}return n(s,t,a)}function o(e){let t={};for(let[n,{component:r,id:i,exportName:o=`default`}]of Object.entries(e))t[n]=a(r,i,o);return t}function s(t){return e(t)&&typeof t.id==`string`&&`component`in t}function c(e){return Array.isArray(e)?[...e]:Object.entries(e).map(([e,t])=>{if(s(t))return{component:t.component,id:t.id,exportName:t.exportName,name:e,client:t.client??!0};throw Error(`[rari/mdx] Component "${e}" is missing module metadata. Pass components to defineMdxComponents({ ... }) in a file processed by the rari vite plugin.`)})}function l(e){let n=c(e);return e=>{let r={},i={},a=new Set(t(e));for(let e of n)a.has(e.name)&&(e.client===!1?r[e.name]=e.component:i[e.name]={component:e.component,id:e.id,exportName:e.exportName});return{...r,...o(i)}}}export{l as t};
@@ -1,5 +1,4 @@
1
1
  import { ComponentType } from "react";
2
- //#region src/mdx/components/define.d.ts
3
2
  interface MdxComponentEntry {
4
3
  readonly name: string;
5
4
  readonly component: ComponentType<any>;
@@ -9,5 +8,4 @@ interface MdxComponentEntry {
9
8
  }
10
9
  type MdxComponentsInput = Readonly<Record<string, ComponentType<any> | MdxComponentEntry>>;
11
10
  declare function defineMdxComponents(input: readonly MdxComponentEntry[] | MdxComponentsInput): (content: string) => Record<string, any>;
12
- //#endregion
13
11
  export { defineMdxComponents as n, MdxComponentEntry as t };
@@ -0,0 +1,59 @@
1
+ import{i as e,n as t,o as n,r,s as i,t as a}from"./utils-DZWuxUA--BobVI1xy.mjs";import{appendFileSync as o,existsSync as s,readFileSync as c,writeFileSync as l}from"node:fs";import{join as u}from"node:path";import d from"node:process";import{styleText as f}from"node:util";function p(){let r=d.cwd();n(`Creating Fly.io deployment configuration...`);let i=a(r,{providerName:`Fly`,deployScript:`fly deploy`}),o=h(r);m(r),g(r,o),v(r,o.copy.split(` `)),t(`Fly.io`,[...i?[`${f(`cyan`,e(r))} (updates your lockfile for rari)`]:[],`Install the Fly CLI: ${f(`cyan`,`https://fly.io/docs/flyctl/install/`)}`,f(`cyan`,`fly auth login`),f(`cyan`,`fly launch --no-deploy`),f(`cyan`,`fly deploy`)],[`Run in a Node 24 Docker container`,`Bind to 0.0.0.0 on port 8080`,`Health check on /_rari/health`])}function m(e){r(e,`fly.toml`,`app = "rari-app"
2
+ primary_region = "iad"
3
+
4
+ [build]
5
+
6
+ [http_service]
7
+ internal_port = 8080
8
+ force_https = true
9
+ auto_stop_machines = "stop"
10
+ auto_start_machines = true
11
+ min_machines_running = 0
12
+
13
+ [[http_service.checks]]
14
+ grace_period = "30s"
15
+ interval = "15s"
16
+ method = "GET"
17
+ path = "/_rari/health"
18
+ timeout = "5s"
19
+
20
+ [[vm]]
21
+ memory = "512mb"
22
+ cpu_kind = "shared"
23
+ cpus = 1
24
+ `)}function h(e){let t=t=>s(u(e,t));return t(`pnpm-lock.yaml`)?{copy:t(`pnpm-workspace.yaml`)?`package.json pnpm-lock.yaml pnpm-workspace.yaml`:`package.json pnpm-lock.yaml`,install:[`ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0`,`RUN corepack enable`,`RUN pnpm install --frozen-lockfile`]}:t(`yarn.lock`)?{copy:`package.json yarn.lock`,install:[`ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0`,`ENV YARN_NODE_LINKER=node-modules`,`RUN corepack enable`,`RUN yarn install`]}:t(`bun.lock`)||t(`bun.lockb`)?{copy:`package.json ${t(`bun.lock`)?`bun.lock`:`bun.lockb`}`,install:[`RUN npm install -g bun`,`RUN bun install --frozen-lockfile`]}:t(`package-lock.json`)?{copy:`package.json package-lock.json`,install:[`RUN npm ci`]}:{copy:`package.json`,install:[`RUN npm install`]}}function g(e,{copy:t,install:n}){let i=`FROM node:24-slim
25
+
26
+ RUN apt-get update && apt-get install -y libfontconfig1 && rm -rf /var/lib/apt/lists/*
27
+
28
+ WORKDIR /app
29
+
30
+ COPY ${t} ./
31
+ ${n.join(`
32
+ `)}
33
+
34
+ COPY . .
35
+ RUN npx rari build
36
+
37
+ ENV NODE_ENV=production
38
+ ENV PORT=8080
39
+ ENV RARI_HOST=0.0.0.0
40
+ ENV RUST_LOG=info
41
+
42
+ EXPOSE 8080
43
+
44
+ CMD ["npm", "start"]
45
+ `;r(e,`Dockerfile`,i)}function _(e,t){let n=c(e,`utf-8`),r=new Set(n.split(`
46
+ `).map(e=>e.trim())),a=t.filter(e=>!r.has(`!${e}`));if(a.length===0)return;let s=n===``||n.endsWith(`
47
+ `)?``:`
48
+ `;o(e,`${s}${a.map(e=>`!${e}`).join(`
49
+ `)}\n`),i(`Updated .dockerignore so the Docker build can copy ${a.join(`, `)}`)}function v(e,t){let n=u(e,`.dockerignore`);s(n)?_(n,t):(l(n,`node_modules
50
+ .git
51
+ .env
52
+ .env.*
53
+ !.env.example
54
+ dist
55
+ *.log
56
+ .DS_Store
57
+ .vscode
58
+ .idea
59
+ `),i(`Created .dockerignore configuration`))}export{p as createFlyDeployment};
@@ -18,6 +18,7 @@ export declare const Afacad: GoogleFontFn
18
18
  export declare const Afacad_Flux: GoogleFontFn
19
19
  export declare const Agbalumo: GoogleFontFn
20
20
  export declare const Agdasima: GoogleFontFn
21
+ export declare const Agrave_Pro: GoogleFontFn
21
22
  export declare const Agu_Display: GoogleFontFn
22
23
  export declare const Aguafina_Script: GoogleFontFn
23
24
  export declare const Akatab: GoogleFontFn
@@ -350,6 +351,7 @@ export declare const Chokokutai: GoogleFontFn
350
351
  export declare const Chonburi: GoogleFontFn
351
352
  export declare const Cinzel: GoogleFontFn
352
353
  export declare const Cinzel_Decorative: GoogleFontFn
354
+ export declare const Clarity_City: GoogleFontFn
353
355
  export declare const Clicker_Script: GoogleFontFn
354
356
  export declare const Climate_Crisis: GoogleFontFn
355
357
  export declare const Coda: GoogleFontFn
@@ -520,6 +522,7 @@ export declare const Fira_Mono: GoogleFontFn
520
522
  export declare const Fira_Sans: GoogleFontFn
521
523
  export declare const Fira_Sans_Condensed: GoogleFontFn
522
524
  export declare const Fira_Sans_Extra_Condensed: GoogleFontFn
525
+ export declare const Firjar: GoogleFontFn
523
526
  export declare const Fjalla_One: GoogleFontFn
524
527
  export declare const Fjord_One: GoogleFontFn
525
528
  export declare const Flamenco: GoogleFontFn
@@ -712,6 +715,7 @@ export declare const Iosevka_Charon: GoogleFontFn
712
715
  export declare const Iosevka_Charon_Mono: GoogleFontFn
713
716
  export declare const Irish_Grover: GoogleFontFn
714
717
  export declare const Island_Moments: GoogleFontFn
718
+ export declare const Isometra: GoogleFontFn
715
719
  export declare const Istok_Web: GoogleFontFn
716
720
  export declare const Italiana: GoogleFontFn
717
721
  export declare const Italianno: GoogleFontFn
@@ -806,6 +810,7 @@ export declare const Kotta_One: GoogleFontFn
806
810
  export declare const Koulen: GoogleFontFn
807
811
  export declare const Kranky: GoogleFontFn
808
812
  export declare const Kreon: GoogleFontFn
813
+ export declare const Kripa: GoogleFontFn
809
814
  export declare const Kristi: GoogleFontFn
810
815
  export declare const Krona_One: GoogleFontFn
811
816
  export declare const Krub: GoogleFontFn
@@ -857,6 +862,7 @@ export declare const Libre_Barcode_39_Text: GoogleFontFn
857
862
  export declare const Libre_Barcode_EAN13_Text: GoogleFontFn
858
863
  export declare const Libre_Baskerville: GoogleFontFn
859
864
  export declare const Libre_Bodoni: GoogleFontFn
865
+ export declare const Libre_Caslon_Condensed: GoogleFontFn
860
866
  export declare const Libre_Caslon_Display: GoogleFontFn
861
867
  export declare const Libre_Caslon_Text: GoogleFontFn
862
868
  export declare const Libre_Franklin: GoogleFontFn
@@ -1543,6 +1549,13 @@ export declare const Red_Hat_Text: GoogleFontFn
1543
1549
  export declare const Red_Rose: GoogleFontFn
1544
1550
  export declare const Redacted: GoogleFontFn
1545
1551
  export declare const Redacted_Script: GoogleFontFn
1552
+ export declare const Redaction: GoogleFontFn
1553
+ export declare const Redaction_10: GoogleFontFn
1554
+ export declare const Redaction_100: GoogleFontFn
1555
+ export declare const Redaction_20: GoogleFontFn
1556
+ export declare const Redaction_35: GoogleFontFn
1557
+ export declare const Redaction_50: GoogleFontFn
1558
+ export declare const Redaction_70: GoogleFontFn
1546
1559
  export declare const Reddit_Mono: GoogleFontFn
1547
1560
  export declare const Reddit_Sans: GoogleFontFn
1548
1561
  export declare const Reddit_Sans_Condensed: GoogleFontFn
@@ -1808,6 +1821,7 @@ export declare const Tilt_Warp: GoogleFontFn
1808
1821
  export declare const Timmana: GoogleFontFn
1809
1822
  export declare const Tinos: GoogleFontFn
1810
1823
  export declare const Tiny5: GoogleFontFn
1824
+ export declare const Tiny5_Duo: GoogleFontFn
1811
1825
  export declare const Tiro_Bangla: GoogleFontFn
1812
1826
  export declare const Tiro_Devanagari_Hindi: GoogleFontFn
1813
1827
  export declare const Tiro_Devanagari_Marathi: GoogleFontFn
@@ -1900,6 +1914,7 @@ export declare const Wix_Madefor_Text: GoogleFontFn
1900
1914
  export declare const Work_Sans: GoogleFontFn
1901
1915
  export declare const Workbench: GoogleFontFn
1902
1916
  export declare const Xanh_Mono: GoogleFontFn
1917
+ export declare const Xmind: GoogleFontFn
1903
1918
  export declare const Yaldevi: GoogleFontFn
1904
1919
  export declare const Yanone_Kaffeesatz: GoogleFontFn
1905
1920
  export declare const Yantramanav: GoogleFontFn
@@ -1,6 +1,4 @@
1
- import { n as FontDisplay, r as GoogleFontOptions, t as Font } from "../types-CkZPEEdi.mjs";
2
- //#region src/font/google.d.ts
1
+ import { n as FontDisplay, r as GoogleFontOptions, t as Font } from "../types-DeWes1rB.mjs";
3
2
  export type GoogleFontFn = (options?: GoogleFontOptions) => Font;
4
3
  export declare function googleFont(): Font;
5
- //#endregion
6
4
  export type { Font, FontDisplay, GoogleFontOptions };
@@ -1,4 +1,2 @@
1
- import { i as LocalFontOptions, t as Font } from "../types-CkZPEEdi.mjs";
2
- //#region src/font/local.d.ts
3
- export default function localFont(_options: LocalFontOptions): Font;
4
- //#endregion
1
+ import { i as LocalFontOptions, t as Font } from "../types-DeWes1rB.mjs";
2
+ export default function localFont(_options: LocalFontOptions): Font;
package/dist/font.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { a as LocalFontSrc, i as LocalFontOptions, n as FontDisplay, r as GoogleFontOptions, t as Font } from "./types-CkZPEEdi.mjs";
2
1
  import localFont from "./font/local.mjs";
2
+ import { a as LocalFontSrc, i as LocalFontOptions, n as FontDisplay, r as GoogleFontOptions, t as Font } from "./types-DeWes1rB.mjs";
3
3
  export { type Font, type FontDisplay, type GoogleFontOptions, type LocalFontOptions, type LocalFontSrc, localFont };
@@ -0,0 +1 @@
1
+ import{o as e}from"./path-CTEC1xmy.mjs";import{S as t,g as n,m as r,u as i}from"./type-guards-BLY2PlGR.mjs";import{n as a,r as o,t as s}from"./rari-global-5vGzhToD.mjs";import{createElement as c}from"react";function l(e){return e.startsWith(`./`)?[e,e.slice(2)]:[e,`./${e}`]}function u(t){let n=e(t),r=/* @__PURE__ */ new Set([n]),i=n.indexOf(`/src/`);i!==-1&&r.add(n.slice(i+1));let a=n.indexOf(`/components/`);return a!==-1&&r.add(n.slice(a+1)),[...r]}function d(e,t){if(t!==void 0)return t;let n=e.exportName;if(n!=null&&n!==``)return n}function f(t,n){let r=e(t),i=e(n);return!!(r===i||i.includes(`/`)&&r.endsWith(`/${i}`)||r.includes(`/`)&&i.endsWith(`/${r}`))}function p(e,t,n){for(let r of u(e))for(let e of l(r)){let r=Object.values(n).find(t=>typeof t.path!=`string`||t.path===``?!1:f(t.path,e));if(r)return{info:r,exportName:d(r,t)}}return null}function m(e){return e.loading=!0,e.loadPromise=e.loader().then(t=>(e.component=t,e.registered=!0,e.loading=!1,t)).catch(t=>{throw console.error(`[rari] Failed to load component ${e.id}:`,t),e.loading=!1,e.loadError=t,e.loadPromise=void 0,t}),e.loadPromise}async function h(e,t){return e.component==null?e.loadPromise?(await e.loadPromise,g(e,t)):e.loader?await m(e)==null?null:g(e,t):null:g(e,t)}function g(e,t){let i=e.component;if(i==null)return null;if(r(i))return i;if(!n(i))return null;if(t==null||t===``||t==="default")return i.default??i;if(t in i)return i[t];let a=i.default;return n(a)&&t in a?a[t]:null}function _(t){let n=e(t);return n===t?[n]:[n,t]}function v(t){let n=o(),r=a(),i=s(),c=e(t),l=y(t,n);if(l!=null)return l;let u=c.indexOf(`#`),d=u===-1?c:c.slice(0,u),f=u===-1?void 0:c.slice(u+1);return b(t,f,n)??x(t,d,f,n,r,i)??p(d,f,n)}function y(e,t){for(let n of _(e)){if(!(n in t))continue;let e=t[n],r=n.indexOf(`#`);return{info:e,exportName:d(e,r===-1?void 0:n.slice(r+1))}}return null}function b(e,t,n){for(let r of _(e)){let e=r.indexOf(`#`),i=e===-1?r:r.slice(0,e);if(i in n)return{info:n[i],exportName:d(n[i],t)}}return null}function x(t,n,r,i,a,o){let s=e(t)===t?[n]:[n,t.includes(`#`)?t.slice(0,t.indexOf(`#`)):t];for(let e of s){let t=S(e,r,i,a);if(t!=null)return t;let n=C(e,r,i,o);if(n!=null)return n}return null}function S(e,t,n,r){for(let i of l(e)){if(!(i in r))continue;let e=r[i];if(e!==``&&e in n)return{info:n[e],exportName:d(n[e],t)}}return null}function C(e,t,n,r){if(!(e in r))return null;let i=r[e];return i===``||!(i in n)?null:{info:n[i],exportName:d(n[i],t)}}function w(e){return e.component!=null||e.loader==null?e.loadPromise:e.loadError==null?e.loadPromise?e.loadPromise:m(e):Promise.reject(t(e.loadError))}function T(e,t,i){let a=d(e,i),o=g({...e,component:t},a);if(o==null)return n(t)&&(`default`in t||`__esModule`in t)?t:r(t)?{default:t,[a!=null&&a!==``?a:`default`]:t,__esModule:!0}:t;let s=a!=null&&a!==``?a:`default`;return{...n(t)?t:{},default:o,[s]:o,__esModule:!0}}function E(e,n,r,a){let o=d(e,a),s=o!=null&&o!==``?o:`default`,l=a=>{if(e.loadError!=null)throw t(e.loadError);if(e.component!=null){let t=g(e,o);if(t==null)throw Error(`[rari] Lazy component "${n}" loaded but export "${s}" is missing`);if(!i(t))throw Error(`[rari] Lazy component "${n}" export "${s}" is not a component`);return c(t,a)}throw r};return l.displayName=`Lazy(${e.displayName??e.exportName??n})`,{default:l,[s]:l,__esModule:!0}}function D(e){let t=v(e);if(!t)return import.meta.env.DEV&&console.warn(`[rari] __rari_rsc_require__: component "${e}" not found in registry`),{};let{info:n,exportName:r}=t;if(n.component!=null)return T(n,n.component,r);if(n.loader){if(n.loadError!=null)return E(n,e,Promise.resolve(),r);let t=w(n);if(t)return E(n,e,t,r)}return{}}async function O(e){let t=v(e);return t?h(t.info,t.exportName):null}function k(){if(typeof window>`u`)return;let t=t=>{let n=o(),r=e(t);return t in n?n[t]:r in n?n[r]:Object.values(n).find(e=>e.path===t||e.path===r)};Reflect.set(globalThis,`__rari_get_script_filename__`,n=>{let r=t(n)?.path??e(n),i=e(r);if(i.startsWith(`http://`)||i.startsWith(`https://`))return i;let a=i.indexOf(`/src/`);return a===-1?i.startsWith(`src/`)?`/${i}`:i.startsWith(`/`)?i:`/${i}`:i.slice(a)}),Reflect.set(globalThis,`__rari_chunk_load__`,async e=>{let n=t(e);if(n&&n.component==null&&n.loader!=null){let e=w(n);if(e)return e.then(()=>void 0)}return n?.loadPromise==null?Promise.resolve():n.loadPromise.then(()=>void 0)})}export{k as n,D as r,O as t};
@@ -1,6 +1,4 @@
1
- import { i as ReadonlyHeaders, n as CookieStore, r as ReadonlyCookie, t as CookieOptions } from "./types-C8N3Hc8I.mjs";
2
- //#region src/headers.d.ts
1
+ import { i as ReadonlyHeaders, n as CookieStore, r as ReadonlyCookie, t as CookieOptions } from "./types-Cw2SI7r7.mjs";
3
2
  export declare function cookies(): Promise<CookieStore>;
4
3
  export declare function headers(): Promise<ReadonlyHeaders>;
5
- //#endregion
6
4
  export type { CookieOptions, CookieStore, ReadonlyCookie, ReadonlyHeaders };
@@ -1,4 +1,3 @@
1
- //#region src/image/runtime-config.d.ts
2
1
  export declare function configureImageSizes(options: {
3
2
  readonly deviceSizes?: readonly number[];
4
3
  readonly imageSizes?: readonly number[];
@@ -6,5 +5,4 @@ export declare function configureImageSizes(options: {
6
5
  export declare function getImageDeviceSizes(): readonly number[];
7
6
  export declare function getImageSizes(): readonly number[];
8
7
  export declare function getAllImageSizes(): readonly number[];
9
- export declare function getMaxOptimizedWidth(): number;
10
- //#endregion
8
+ export declare function getMaxOptimizedWidth(): number;
@@ -1 +1 @@
1
- import "../static-modules-BnpA9S9v.mjs";
1
+ import "../static-modules-DmO7M_cF.mjs";
package/dist/image.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import { n as ImageProps, r as StaticImageData, t as Image$1 } from "./static-modules-BnpA9S9v.mjs";
1
+ import { n as ImageProps, r as StaticImageData, t as Image$1 } from "./static-modules-DmO7M_cF.mjs";
2
2
  import { configureImageSizes } from "./image/runtime-config.mjs";
3
- //#region src/image/constants.d.ts
4
3
  type ImageFormat = 'avif' | 'webp' | 'jpeg';
5
4
  export declare const MAX_OPTIMIZED_OUTPUT_WIDTH = 3840;
6
5
  export declare const DEFAULT_DEVICE_SIZES: number[];
@@ -10,11 +9,8 @@ export declare const DEFAULT_QUALITY_LEVELS: number[];
10
9
  export declare const DEFAULT_MINIMUM_CACHE_TTL = 60;
11
10
  export declare const BLUR_PLACEHOLDER_WIDTH = 16;
12
11
  export declare const BLUR_PLACEHOLDER_QUALITY = 25;
13
- //#endregion
14
- //#region src/image/index.d.ts
15
12
  declare const Image: typeof Image$1 & {
16
13
  $$typeof?: symbol;
17
14
  $$id?: string;
18
15
  };
19
- //#endregion
20
16
  export { Image, type ImageFormat, type ImageProps, type StaticImageData, configureImageSizes };
package/dist/image.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./constants-C6nBL5YX.mjs";import{configureImageSizes as c}from"./image/runtime-config.mjs";import{c as l}from"react/compiler-runtime";import{useEffect as u,useLayoutEffect as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{preload as g}from"react-dom";import{getAllImageSizes as _,getImageDeviceSizes as v,getMaxOptimizedWidth as y}from"rari/image/runtime-config";import"virtual:rari-image-config";function b(e){return Math.min(Math.max(e,1),y())}function x(e){let t=_(),n=b(e);return t.find(e=>e>=n)??t[t.length-1]}function S(e){let t=/(^|[,\s])(1?\d?\d)vw/g,n=[];for(let r=t.exec(e);r!=null;r=t.exec(e))n.push(Number.parseInt(r[2],10));let r=_();if(n.length===0)return[...r];let i=Math.min(...n)*.01,a=v()[0]*i;return r.filter(e=>e>=a)}function C(e){let{fill:t,width:n,intrinsicWidth:r,sizes:i}=e,a=v();if(t)return{defaultWidth:y(),widths:a};let o=n!=null&&n!==0?n:r!=null&&r!==0?r:void 0;if(i!=null&&i!==``){let e=S(i);return{defaultWidth:o==null?e.at(-1)??1920:x(o),widths:e}}if(o==null)return{defaultWidth:1920,widths:a};let s=[...new Set([o,o*2].map(e=>x(e)))];return s.sort((e,t)=>e-t),{defaultWidth:s[0],widths:s}}function w(e,t,n,r){let i=new URLSearchParams;return i.set(`url`,e),i.set(`w`,t.toString()),i.set(`q`,n.toString()),r&&i.set(`f`,r),`/_rari/image?${i}`}function T(e,t,n,r,i){return e==null?w(t,n,r,i):e({src:t,width:n,quality:r})}function ee(e,t,n=!1,r){if(e!=null&&e!==``)return e;if(n)return`100vw`;if(t)return r!=null&&r!==0?`${r}px`:`100vw`}function te(e){if(e==null&&n.length===1&&n[0]===`avif`)return`avif`}function ne(e){if(!e.enabled)return;let{finalSrc:t,defaultWidth:n,widths:r,quality:i,sizes:a,loader:o,unoptimized:s,shouldUseSrcSet:c,format:l}=e;if(s){g(o==null?t:o({src:t,width:n,quality:i}),{as:`image`,fetchPriority:`high`});return}let u=T(o,t,n,i,l);c?g(u,{as:`image`,fetchPriority:`high`,imageSrcSet:A(o,t,r,i,l),...a==null?{}:{imageSizes:a},...l===`avif`?{type:`image/avif`}:{}}):g(u,{as:`image`,fetchPriority:`high`,...l===`avif`?{type:`image/avif`}:{}})}function E(e,t,n){if(e!=null&&e!==0)return e;if(!t&&n!=null&&n!==0)return n}function re(e){let{src:t,width:n,height:r,fill:i,placeholder:a,blurDataURL:o,loader:s}=e,c=typeof t==`string`?t:t.src,l=typeof t==`string`?void 0:t.width,u=typeof t==`string`?void 0:t.height,d=o!=null&&o!==``?o:typeof t==`string`?void 0:t.blurDataURL,f=d!=null&&d!==``?d:void 0,p=a===`blur`&&f==null?T(s,c,16,25,`jpeg`):void 0;return{imgSrc:c,imgWidth:E(n,i,l),imgHeight:E(r,i,u),inlineBlurDataURL:f,optimizerBlurUrl:p}}function D(e){return{position:`absolute`,inset:0,width:`100%`,height:`100%`,objectFit:e?.objectFit??`cover`}}function O(e){return{backgroundImage:`url("${e}")`,backgroundSize:`cover`,backgroundPosition:`center`,filter:`blur(20px)`,transition:`filter 0.3s ease-out`}}function k(e){return e.complete&&e.naturalWidth>0}function ie(e){let{style:t,fill:n,placeholder:r,imgBlurDataURL:i,blurComplete:a}=e,o=r===`blur`&&i!=null&&i!==``&&!a,s=r===`blur`&&a;return{...t,...n?D(t):null,...o?O(i):null,...s?{filter:`none`,transition:`filter 0.3s ease-out`}:null}}function A(e,t,n,r,i){return n.map(n=>`${T(e,t,n,r,i)} ${n}w`).join(`, `)}function ae(e){let{unoptimized:t,loader:n,finalSrc:r,width:i,quality:a,format:o}=e;return t?n==null?r:n({src:r,width:i,quality:a}):T(n,r,i,a,o)}function j(e,t,n){if(!t||e==null)return;let r=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(n(),r.disconnect())},{rootMargin:`200px`});return r.observe(e),()=>{r.disconnect()}}function M(e){let{imgElement:t,loader:r,finalSrc:i,widths:a,quality:o,sizes:s}=e;return/* @__PURE__ */ h(`picture`,{children:[n.includes(`avif`)&&/* @__PURE__ */ m(`source`,{type:`image/avif`,srcSet:A(r,i,a,o,`avif`),sizes:s}),n.includes(`webp`)&&/* @__PURE__ */ m(`source`,{type:`image/webp`,srcSet:A(r,i,a,o,`webp`),sizes:s}),t]})}function oe(e){let t=l(19),{finalSrc:n,shouldEagerBlur:r,inlineBlurDataURL:i,optimizerBlurUrl:a,placeholder:o}=e,[s,c]=p(!1),[m,h]=p(n),[g,_]=p(r),v=f(null);m!==n&&(h(n),_(r),c(!1));let y;t[0]===o?y=t[1]:(y=()=>{if(o!==`blur`)return;let e=v.current;e!=null&&k(e)&&c(!0)},t[0]=o,t[1]=y);let b;t[2]!==n||t[3]!==o?(b=[o,n],t[2]=n,t[3]=o,t[4]=b):b=t[4],d(y,b);let x;t[5]!==g||t[6]!==a||t[7]!==o||t[8]!==r?(x=()=>j(v.current,!r&&!g&&a!=null&&o===`blur`,()=>{_(!0)}),t[5]=g,t[6]=a,t[7]=o,t[8]=r,t[9]=x):x=t[9];let S;t[10]!==n||t[11]!==g||t[12]!==a||t[13]!==o||t[14]!==r?(S=[r,g,a,o,n],t[10]=n,t[11]=g,t[12]=a,t[13]=o,t[14]=r,t[15]=S):S=t[15],u(x,S);let C=i??(r||g?a:void 0),w;return t[16]!==s||t[17]!==C?(w={imgRef:v,blurComplete:s,setBlurComplete:c,activeBlurUrl:C},t[16]=s,t[17]=C,t[18]=w):w=t[18],w}function N(e){let t=l(16),{src:n,alt:r,width:i,height:a,quality:o,preload:s,loading:c,placeholder:d,blurDataURL:h,fill:g,sizes:_,style:v,className:y,onLoad:b,onError:x,unoptimized:S,loader:w,overrideSrc:T,decoding:E}=e,D=o===void 0?75:o,O=s!==void 0&&s,k=c===void 0?`lazy`:c,j=d===void 0?`empty`:d,N=g!==void 0&&g,P=S!==void 0&&S,{imgSrc:F,imgWidth:I,imgHeight:se,inlineBlurDataURL:ce,optimizerBlurUrl:le}=re({src:n,width:i,height:a,fill:N,placeholder:j,blurDataURL:h,loader:w}),L=T!=null&&T!==``?T:F,ue=E??(O?`sync`:`async`),R=C({fill:N,width:i,intrinsicWidth:typeof n==`string`?void 0:n.width,sizes:_}),z=R.widths.length>1||R.widths[0]!==R.defaultWidth,B=O||k===`eager`,V=te(w),[de,fe]=p(!1),H=f(b),{imgRef:pe,blurComplete:U,setBlurComplete:W,activeBlurUrl:G}=oe({finalSrc:L,shouldEagerBlur:B,inlineBlurDataURL:ce,optimizerBlurUrl:le,placeholder:j}),K,q;t[0]===b?(K=t[1],q=t[2]):(K=()=>{H.current=b},q=[b],t[0]=b,t[1]=K,t[2]=q),u(K,q);let J;t[3]!==j||t[4]!==W?(J=e=>{let t=e.currentTarget;(t.currentSrc===``?t.src:t.currentSrc)!==``&&t.complete&&(j===`blur`&&W(!0),H.current&&H.current(e))},t[3]=j,t[4]=W,t[5]=J):J=t[5];let me=J,Y;t[6]!==x||t[7]!==j||t[8]!==W?(Y=e=>{fe(!0),j===`blur`&&W(!0),x&&x(e)},t[6]=x,t[7]=j,t[8]=W,t[9]=Y):Y=t[9];let he=Y,X;t[10]!==G||t[11]!==U||t[12]!==N||t[13]!==j||t[14]!==v?(X=ie({style:v,fill:N,placeholder:j,imgBlurDataURL:G,blurComplete:U}),t[10]=G,t[11]=U,t[12]=N,t[13]=j,t[14]=v,t[15]=X):X=t[15];let ge=X,_e=ae({unoptimized:P,loader:w,finalSrc:L,width:R.defaultWidth,quality:D,format:V}),Z=ee(_,z,N,i??I??R.defaultWidth),Q=!P&&z?A(w,L,R.widths,D,V):void 0;ne({enabled:O,finalSrc:L,defaultWidth:R.defaultWidth,widths:R.widths,quality:D,sizes:Z,loader:w,unoptimized:P,shouldUseSrcSet:z,format:V});let $=/* @__PURE__ */ m(`img`,{ref:pe,src:_e,srcSet:Q,sizes:Q==null?void 0:Z,alt:de?r:``,width:N?void 0:I,height:N?void 0:se,loading:O?`eager`:k,fetchPriority:O?`high`:`auto`,decoding:ue,onLoad:j===`blur`||b!=null?me:void 0,onError:he,style:ge,className:y});return P||!z?$:M({imgElement:$,loader:w,finalSrc:L,widths:R.widths,quality:D,sizes:Z})}const P=typeof window>`u`,F=N;P&&(F.$$typeof=Symbol.for(`react.client.reference`),F.$$id=`rari/image#Image`);export{s as BLUR_PLACEHOLDER_QUALITY,r as BLUR_PLACEHOLDER_WIDTH,a as DEFAULT_DEVICE_SIZES,n as DEFAULT_FORMATS,e as DEFAULT_IMAGE_SIZES,i as DEFAULT_MINIMUM_CACHE_TTL,o as DEFAULT_QUALITY_LEVELS,F as Image,t as MAX_OPTIMIZED_OUTPUT_WIDTH,c as configureImageSizes};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./constants-C6nBL5YX.mjs";import{configureImageSizes as c}from"./image/runtime-config.mjs";import{c as l}from"react/compiler-runtime";import{useEffect as u,useLayoutEffect as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{preload as g}from"react-dom";import{getAllImageSizes as _,getImageDeviceSizes as v,getMaxOptimizedWidth as y}from"rari/image/runtime-config";import"virtual:rari-image-config";function b(e){return Math.min(Math.max(e,1),y())}function x(e){let t=_(),n=b(e);return t.find(e=>e>=n)??t[t.length-1]}function S(e){let t=/(^|[,\s])(1?\d?\d)vw/g,n=[];for(let r=t.exec(e);r!=null;r=t.exec(e))n.push(Number.parseInt(r[2],10));let r=_();if(n.length===0)return[...r];let i=Math.min(...n)*.01,a=v()[0]*i;return r.filter(e=>e>=a)}function C(e){let{fill:t,width:n,intrinsicWidth:r,sizes:i}=e,a=v();if(t)return{defaultWidth:y(),widths:a};let o=n!=null&&n!==0?n:r!=null&&r!==0?r:void 0;if(i!=null&&i!==``){let e=S(i);return{defaultWidth:o==null?e.at(-1)??1920:x(o),widths:e}}if(o==null)return{defaultWidth:1920,widths:a};let s=[...new Set([o,o*2].map(e=>x(e)))];return s.sort((e,t)=>e-t),{defaultWidth:s[0],widths:s}}function w(e,t,n,r){let i=new URLSearchParams;return i.set(`url`,e),i.set(`w`,t.toString()),i.set(`q`,n.toString()),r&&i.set(`f`,r),`/_rari/image?${i}`}function T(e,t,n,r,i){return e==null?w(t,n,r,i):e({src:t,width:n,quality:r})}function ee(e,t,n=!1,r){if(e!=null&&e!==``)return e;if(n)return`100vw`;if(t)return r!=null&&r!==0?`${r}px`:`100vw`}function te(e){if(e==null&&n.length===1&&n[0]===`avif`)return`avif`}function ne(e){if(!e.enabled)return;let{finalSrc:t,defaultWidth:n,widths:r,quality:i,sizes:a,loader:o,unoptimized:s,shouldUseSrcSet:c,format:l}=e;if(s){g(o==null?t:o({src:t,width:n,quality:i}),{as:`image`,fetchPriority:`high`});return}let u=T(o,t,n,i,l);c?g(u,{as:`image`,fetchPriority:`high`,imageSrcSet:A(o,t,r,i,l),...a==null?{}:{imageSizes:a},...l===`avif`?{type:`image/avif`}:{}}):g(u,{as:`image`,fetchPriority:`high`,...l===`avif`?{type:`image/avif`}:{}})}function E(e,t,n){if(e!=null&&e!==0)return e;if(!t&&n!=null&&n!==0)return n}function re(e){let{src:t,width:n,height:r,fill:i,placeholder:a,blurDataURL:o,loader:s}=e,c=typeof t==`string`?t:t.src,l=typeof t==`string`?void 0:t.width,u=typeof t==`string`?void 0:t.height,d=o!=null&&o!==``?o:typeof t==`string`?void 0:t.blurDataURL,f=d!=null&&d!==``?d:void 0,p=a===`blur`&&f==null?T(s,c,16,25,`jpeg`):void 0;return{imgSrc:c,imgWidth:E(n,i,l),imgHeight:E(r,i,u),inlineBlurDataURL:f,optimizerBlurUrl:p}}function D(e){return{position:`absolute`,inset:0,width:`100%`,height:`100%`,objectFit:e?.objectFit??`cover`}}function O(e){return{backgroundImage:`url("${e}")`,backgroundSize:`cover`,backgroundPosition:`center`,filter:`blur(20px)`,transition:`filter 0.3s ease-out`}}function k(e){return e.complete&&e.naturalWidth>0}function ie(e){let{style:t,fill:n,placeholder:r,imgBlurDataURL:i,blurComplete:a}=e,o=r===`blur`&&i!=null&&i!==``&&!a,s=r===`blur`&&a;return{...t,...n?D(t):null,...o?O(i):null,...s?{filter:`none`,transition:`filter 0.3s ease-out`}:null}}function A(e,t,n,r,i){return n.map(n=>`${T(e,t,n,r,i)} ${n}w`).join(`, `)}function ae(e){let{unoptimized:t,loader:n,finalSrc:r,width:i,quality:a,format:o}=e;return t?n==null?r:n({src:r,width:i,quality:a}):T(n,r,i,a,o)}function j(e,t,n){if(!t||e==null)return;let r=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(n(),r.disconnect())},{rootMargin:`200px`});return r.observe(e),()=>{r.disconnect()}}function oe(e){let{imgElement:t,loader:r,finalSrc:i,widths:a,quality:o,sizes:s}=e;return/* @__PURE__ */ h(`picture`,{children:[n.includes(`avif`)&&/* @__PURE__ */ m(`source`,{type:`image/avif`,srcSet:A(r,i,a,o,`avif`),sizes:s}),n.includes(`webp`)&&/* @__PURE__ */ m(`source`,{type:`image/webp`,srcSet:A(r,i,a,o,`webp`),sizes:s}),t]})}function se(e){let t=l(19),{finalSrc:n,shouldEagerBlur:r,inlineBlurDataURL:i,optimizerBlurUrl:a,placeholder:o}=e,[s,c]=p(!1),[m,h]=p(n),[g,_]=p(r),v=f(null);m!==n&&(h(n),_(r),c(!1));let y;t[0]===o?y=t[1]:(y=()=>{if(o!==`blur`)return;let e=v.current;e!=null&&k(e)&&c(!0)},t[0]=o,t[1]=y);let b;t[2]!==n||t[3]!==o?(b=[o,n],t[2]=n,t[3]=o,t[4]=b):b=t[4],d(y,b);let x;t[5]!==g||t[6]!==a||t[7]!==o||t[8]!==r?(x=()=>j(v.current,!r&&!g&&a!=null&&o===`blur`,()=>{_(!0)}),t[5]=g,t[6]=a,t[7]=o,t[8]=r,t[9]=x):x=t[9];let S;t[10]!==n||t[11]!==g||t[12]!==a||t[13]!==o||t[14]!==r?(S=[r,g,a,o,n],t[10]=n,t[11]=g,t[12]=a,t[13]=o,t[14]=r,t[15]=S):S=t[15],u(x,S);let C=i??(r||g?a:void 0),w;return t[16]!==s||t[17]!==C?(w={imgRef:v,blurComplete:s,setBlurComplete:c,activeBlurUrl:C},t[16]=s,t[17]=C,t[18]=w):w=t[18],w}function M(e){let t=l(16),{src:n,alt:r,width:i,height:a,quality:o,preload:s,loading:c,placeholder:d,blurDataURL:p,fill:h,sizes:g,style:_,className:v,onLoad:y,onError:b,unoptimized:x,loader:S,overrideSrc:w,decoding:T}=e,E=o===void 0?75:o,D=s!==void 0&&s,O=c===void 0?`lazy`:c,k=d===void 0?`empty`:d,j=h!==void 0&&h,M=x!==void 0&&x,{imgSrc:N,imgWidth:P,imgHeight:F,inlineBlurDataURL:I,optimizerBlurUrl:L}=re({src:n,width:i,height:a,fill:j,placeholder:k,blurDataURL:p,loader:S}),R=w!=null&&w!==``?w:N,ce=T??(D?`sync`:`async`),z=C({fill:j,width:i,intrinsicWidth:typeof n==`string`?void 0:n.width,sizes:g}),B=z.widths.length>1||z.widths[0]!==z.defaultWidth,le=D||O===`eager`,V=te(S),H=f(y),{imgRef:ue,blurComplete:U,setBlurComplete:W,activeBlurUrl:G}=se({finalSrc:R,shouldEagerBlur:le,inlineBlurDataURL:I,optimizerBlurUrl:L,placeholder:k}),K,q;t[0]===y?(K=t[1],q=t[2]):(K=()=>{H.current=y},q=[y],t[0]=y,t[1]=K,t[2]=q),u(K,q);let J;t[3]!==k||t[4]!==W?(J=e=>{let t=e.currentTarget;(t.currentSrc===``?t.src:t.currentSrc)!==``&&t.complete&&(k===`blur`&&W(!0),H.current&&H.current(e))},t[3]=k,t[4]=W,t[5]=J):J=t[5];let de=J,Y;t[6]!==b||t[7]!==k||t[8]!==W?(Y=e=>{k===`blur`&&W(!0),b&&b(e)},t[6]=b,t[7]=k,t[8]=W,t[9]=Y):Y=t[9];let fe=Y,X;t[10]!==G||t[11]!==U||t[12]!==j||t[13]!==k||t[14]!==_?(X=ie({style:_,fill:j,placeholder:k,imgBlurDataURL:G,blurComplete:U}),t[10]=G,t[11]=U,t[12]=j,t[13]=k,t[14]=_,t[15]=X):X=t[15];let pe=X,me=ae({unoptimized:M,loader:S,finalSrc:R,width:z.defaultWidth,quality:E,format:V}),Z=ee(g,B,j,i??P??z.defaultWidth),Q=!M&&B?A(S,R,z.widths,E,V):void 0;ne({enabled:D,finalSrc:R,defaultWidth:z.defaultWidth,widths:z.widths,quality:E,sizes:Z,loader:S,unoptimized:M,shouldUseSrcSet:B,format:V});let $=/* @__PURE__ */ m(`img`,{ref:ue,src:me,srcSet:Q,sizes:Q==null?void 0:Z,alt:r,width:j?void 0:P,height:j?void 0:F,loading:D?`eager`:O,fetchPriority:D?`high`:void 0,decoding:ce,onLoad:k===`blur`||y!=null?de:void 0,onError:fe,style:pe,className:v});return M||!B?$:oe({imgElement:$,loader:S,finalSrc:R,widths:z.widths,quality:E,sizes:Z})}const N=typeof window>`u`,P=M;N&&(P.$$typeof=Symbol.for(`react.client.reference`),P.$$id=`rari/image#Image`);export{s as BLUR_PLACEHOLDER_QUALITY,r as BLUR_PLACEHOLDER_WIDTH,a as DEFAULT_DEVICE_SIZES,n as DEFAULT_FORMATS,e as DEFAULT_IMAGE_SIZES,i as DEFAULT_MINIMUM_CACHE_TTL,o as DEFAULT_QUALITY_LEVELS,P as Image,t as MAX_OPTIMIZED_OUTPUT_WIDTH,c as configureImageSizes};
package/dist/index.d.mts CHANGED
@@ -1,9 +1,7 @@
1
- import { D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, T as ApiResponse, _ as LayoutProps, a as Sitemap, c as SitemapVideo, i as RobotsRule, n as FeedEntry, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, t as Feed, x as PageProps, y as Metadata } from "./types-yeW6ju9Y.mjs";
2
- import { c as RariURL, d as RariResponse, n as ProxyConfig, r as ProxyFunction, s as RariFetchEvent } from "./types-DAdRjhuk.mjs";
1
+ import { D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, T as ApiResponse, _ as LayoutProps, a as Sitemap, c as SitemapVideo, i as RobotsRule, n as FeedEntry, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, t as Feed, x as PageProps, y as Metadata } from "./types-DNk27dqJ.mjs";
3
2
  import { RariRequest } from "./proxy/RariRequest.mjs";
4
- //#region src/navigation/not-found.d.ts
3
+ import { c as RariURL, d as RariResponse, n as ProxyConfig, r as ProxyFunction, s as RariFetchEvent } from "./types-CSDt4P_t.mjs";
5
4
  export declare const NOT_FOUND_ERROR_DIGEST = "RARI_NOT_FOUND";
6
5
  export declare function isNotFoundError(error: unknown): boolean;
7
6
  export declare function notFound(): never;
8
- //#endregion
9
7
  export { ApiResponse, type ApiRouteHandlers, type ErrorProps, type Feed, type FeedEntry, type LayoutProps, type Metadata, type PageProps, type ProxyConfig, type ProxyFunction, type RariFetchEvent, RariRequest, RariResponse, type RariURL, type Robots, type RobotsRule, type RouteContext, type RouteHandler, type Sitemap, type SitemapEntry, type SitemapImage, type SitemapVideo };
@@ -1,2 +1,2 @@
1
- import { n as defineMdxComponents, t as MdxComponentEntry } from "../define-BafO1-XT.mjs";
1
+ import { n as defineMdxComponents, t as MdxComponentEntry } from "../define-DCZgXfOp.mjs";
2
2
  export { type MdxComponentEntry, defineMdxComponents };
@@ -1 +1 @@
1
- export{t as defineMdxComponents}from"../define-Dsj1lR4C.mjs";
1
+ export{t as defineMdxComponents}from"../define-BIL9PMLh.mjs";
@@ -1,3 +1 @@
1
- //#region src/mdx/registry.d.ts
2
- export declare function getMDXComponents(_content: string): Record<string, any>;
3
- //#endregion
1
+ export declare function getMDXComponents(_content: string): Record<string, any>;
package/dist/mdx.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import { n as defineMdxComponents, t as MdxComponentEntry } from "./define-BafO1-XT.mjs";
1
+ import { n as defineMdxComponents, t as MdxComponentEntry } from "./define-DCZgXfOp.mjs";
2
2
  import { ComponentType } from "react";
3
3
  import { EvaluateOptions as EvaluateOptions$1 } from "@mdx-js/mdx";
4
- //#region src/mdx/evaluate.d.ts
5
4
  interface EvaluateOptions extends EvaluateOptions$1 {
6
5
  components?: Record<string, any>;
7
6
  }
@@ -11,8 +10,5 @@ interface EvaluateResult {
11
10
  }>;
12
11
  }
13
12
  export declare function evaluate(source: string, options: EvaluateOptions): Promise<EvaluateResult>;
14
- //#endregion
15
- //#region src/mdx/scan/names.d.ts
16
13
  export declare function scanMdxComponentNames(content: string): string[];
17
- //#endregion
18
14
  export { type EvaluateOptions, type EvaluateResult, type MdxComponentEntry, defineMdxComponents };
package/dist/mdx.mjs CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./names-CLmM0CPi.mjs";import{t}from"./define-Dsj1lR4C.mjs";import{createElement as n}from"react";import{evaluate as r}from"@mdx-js/mdx";import{getMDXComponents as i}from"rari/mdx/registry";async function a(e,t){let{components:a={},...o}=t,s=await r(e,o),c=s.default,l=i(e);function u(e){let t={...l,...a,...e.components};return n(c,{...e,components:t})}return{...s,default:u}}export{t as defineMdxComponents,a as evaluate,e as scanMdxComponentNames};
1
+ import{t as e}from"./define-BIL9PMLh.mjs";import{t}from"./names-CLmM0CPi.mjs";import{createElement as n}from"react";import{evaluate as r}from"@mdx-js/mdx";import{getMDXComponents as i}from"rari/mdx/registry";async function a(e,t){let{components:a={},...o}=t,s=await r(e,o),c=s.default,l=i(e);function u(e){let t={...l,...a,...e.components};return n(c,{...e,components:t})}return{...s,default:u}}export{e as defineMdxComponents,a as evaluate,t as scanMdxComponentNames};
package/dist/og.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ReactElement } from "react";
2
- //#region src/og/image-response.d.ts
3
2
  interface ImageResponseOptions {
4
3
  readonly width?: number;
5
4
  readonly height?: number;
@@ -34,5 +33,4 @@ export declare class ImageResponse {
34
33
  private serializeProps;
35
34
  private serializePropValue;
36
35
  }
37
- //#endregion
38
36
  export type { ImageResponseOptions, ImageResponseSize };
@@ -1,4 +1,2 @@
1
- //#region src/cli/platform.d.ts
2
1
  export declare function getBinaryPath(): string;
3
- export declare function getInstallationInstructions(): string;
4
- //#endregion
2
+ export declare function getInstallationInstructions(): string;
@@ -1,2 +1,2 @@
1
- import{f as e}from"./type-guards-BLY2PlGR.mjs";import{o as t}from"./path-CTEC1xmy.mjs";import{t as n}from"./get-client-component-D2K213pV.mjs";import{Fragment as r,createElement as i,isValidElement as a}from"react";function o(e){return a(e)||e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function s(e){if(!Array.isArray(e))return e;let t=e;return t.length===1&&a(t[0])?t[0]:t.length>0&&t.every(o)?i(r,null,...t):e}async function c(e,t){let r=l(e,t);r.size!==0&&await Promise.all(Array.from(r,async e=>{try{if(await n(e)==null){console.warn(`[rari] Failed to preload component: ${e}`);return}t?.add(e)}catch(t){console.error(`[rari] Error preloading component ${e}:`,t)}}))}function l(e,t){let n=/* @__PURE__ */ new Set;for(let r of e.split(`
2
- `)){let e=u(r);e!=null&&(!t||!t.has(e))&&n.add(e)}return n}function u(n){let r=n.trim();if(!r)return null;let i=r.indexOf(`:`);if(i===-1)return null;let a=r.substring(i+1);if(!a.startsWith(`I`))return null;try{let n=JSON.parse(a.substring(1));if(!e(n))return null;let r=n[0];if(!r.includes(`/`)&&r.startsWith(`$`))return null;let i=typeof n[2]==`string`?n[2]:void 0,o=t(r);return o.includes(`#`)?o:i!=null&&i!==``&&i!=="default"?`${o}#${i}`:o}catch{return null}}export{s as n,c as t};
1
+ import{f as e}from"./type-guards-BLY2PlGR.mjs";import{o as t}from"./path-CTEC1xmy.mjs";import{t as n}from"./get-client-component-DVAbynLr.mjs";import{Fragment as r,createElement as i,isValidElement as a}from"react";function o(e){return a(e)||e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function s(e){if(!Array.isArray(e))return e;let t=e;return t.length===1&&a(t[0])?t[0]:t.length>0&&t.every(o)?i(r,null,...t):e}async function c(e,t){let r=l(e,t);r.size!==0&&await Promise.all(Array.from(r,async e=>{try{if(await n(e)==null){console.warn(`[rari] Failed to preload component: ${e}`);return}t?.add(e)}catch(t){console.error(`[rari] Error preloading component ${e}:`,t)}}))}function l(e,t){let n=/* @__PURE__ */ new Set;for(let r of e.split(`
2
+ `)){let e=u(r);e!=null&&(t&&t.has(e)||n.add(e))}return n}function u(n){let r=n.trim();if(!r)return null;let i=r.indexOf(`:`);if(i===-1)return null;let a=r.substring(i+1);if(!a.startsWith(`I`))return null;try{let n=JSON.parse(a.substring(1));if(!e(n))return null;let r=n[0];if(!r.includes(`/`)&&r.startsWith(`$`))return null;let i=typeof n[2]==`string`?n[2]:void 0,o=t(r);return o.includes(`#`)?o:i!=null&&i!==``&&i!=="default"?`${o}#${i}`:o}catch{return null}}export{s as n,c as t};
@@ -1,5 +1,4 @@
1
- import { c as RariURL, l as RequestCookies } from "../types-DAdRjhuk.mjs";
2
- //#region src/proxy/http/request.d.ts
1
+ import { c as RariURL, l as RequestCookies } from "../types-CSDt4P_t.mjs";
3
2
  export declare class RariRequest {
4
3
  url: string;
5
4
  method: string;
@@ -34,5 +33,4 @@ export declare class RariRequest {
34
33
  readonly longitude?: string;
35
34
  };
36
35
  }>): RariRequest;
37
- }
38
- //#endregion
36
+ }
@@ -1,2 +1,2 @@
1
- import { d as RariResponse } from "../types-DAdRjhuk.mjs";
1
+ import { d as RariResponse } from "../types-CSDt4P_t.mjs";
2
2
  export { RariResponse };
@@ -1,3 +1 @@
1
- //#region src/proxy/runtime/executor.d.ts
2
- export declare function initializeProxyExecutor(proxyModulePath: string, rariRequestPath: string): Promise<boolean>;
3
- //#endregion
1
+ export declare function initializeProxyExecutor(proxyModulePath: string, rariRequestPath: string): Promise<boolean>;
@@ -0,0 +1,10 @@
1
+ import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./utils-DZWuxUA--BobVI1xy.mjs";import{existsSync as s,readFileSync as c,writeFileSync as l}from"node:fs";import{join as u}from"node:path";import d from"node:process";import{styleText as f}from"node:util";function p(){let e=d.cwd();r(`Creating Railway deployment configuration...`);let i=o(e,{providerName:`Railway`});m(e);let a=_(e);n(`Railway`,[...i?[`${f(`cyan`,t(e))} (updates your lockfile for rari)`]:[],f(`cyan`,`git add .`),f(`cyan`,`git commit -m "Add Railway deployment"`),f(`cyan`,`git push origin main`),`Go to ${f(`cyan`,`https://railway.app`)} and deploy from GitHub`],[...a?[`Install libfontconfig1 (required by the Rust runtime)`]:[],`Bind to 0.0.0.0 (Railway requirement)`,`Use Railway's PORT environment variable`])}function m(e){i(e,`railway.toml`,`[build]
2
+ builder = "RAILPACK"
3
+
4
+ [deploy]
5
+ startCommand = "npm start"
6
+ healthcheckPath = "/_rari/health"
7
+ healthcheckTimeout = 300
8
+ restartPolicyType = "ON_FAILURE"
9
+ restartPolicyMaxRetries = 3
10
+ `)}const h=[`libfontconfig1`];function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _(t){let n=u(t,`railpack.json`);if(!s(n)){let e={$schema:`https://schema.railpack.com`,deploy:{aptPackages:[`...`,...h]}};return l(n,`${JSON.stringify(e,null,2)}\n`),a(`Created railpack.json configuration`),!0}let r;try{r=JSON.parse(c(n,`utf-8`))}catch{r=null}if(!g(r)||r.deploy!==void 0&&!g(r.deploy))return e(`Could not update railpack.json. Add ${h.join(`, `)} to deploy.aptPackages manually.`),!1;let i=g(r.deploy)?r.deploy:{},o=Array.isArray(i.aptPackages)?i.aptPackages.filter(e=>typeof e==`string`):[`...`],d=h.filter(e=>!o.includes(e));return d.length===0||(r.deploy={...i,aptPackages:[...o,...d]},l(n,`${JSON.stringify(r,null,2)}\n`),a(`Added ${d.join(`, `)} to railpack.json deploy.aptPackages`)),!0}export{p as createRailwayDeployment};
@@ -1,5 +1,3 @@
1
1
  import { ReactElement, ReactNode, ReactPromise } from "react";
2
- //#region src/runtime/flight/react-helpers.d.ts
3
2
  type FlightContent = ReactNode | ReactPromise<ReactNode>;
4
- //#endregion
5
3
  export { FlightContent as t };