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
@@ -1,37 +1 @@
1
- import{existsSync as e,readFileSync as t,writeFileSync as n}from"node:fs";import{join as r}from"node:path";import i from"node:process";import{styleText as a}from"node:util";function o(e){console.warn(`${a(`blue`,`info`)} ${e}`)}function s(e){console.warn(`${a(`green`,`✓`)} ${e}`)}function c(e){console.error(`${a(`red`,`✗`)} ${e}`)}function l(e){console.warn(`${a(`yellow`,`⚠`)} ${e}`)}function u(e,t=`Unknown error`){return Error.isError(e)?e.message:typeof e==`string`?e:t}const d=/\s+(?:&&\s+)?/,f=/^>=?\s*(\d+)/,p=/^>=?\s*(\d+)\.(\d+)\.(\d+)/,m=/^=?\s*(\d+)\.(\d+)\.(\d+)/,h=/^\^\s*(\d+)\.(\d+)\.(\d+)/,g=/^~\s*(\d+)\.(\d+)\.(\d+)/,_=/^(?:>=?|<=?|[=~^])?\s*(\d+)\.(\d+)/,v=/^(\d+)\.(?:x|\*)/i,y=/^(?:>=?|[=~^])\s*(\d+)(?:\s|$)/,b=/^(\d+)$/;function x(e){return typeof e==`object`&&!!e}function S(e){let t=JSON.parse(e);if(!x(t))throw Error(`Invalid package.json`);return t}function C(e,t=`>=24.21.0`){if(e.engines=e.engines??{},e.engines.node){if(!w(e.engines.node,t))return l(`Current engines.node value "${e.engines.node}" may not meet the required minimum of ${t}`),l(`Updating to ${t} for deployment compatibility`),e.engines.node=t,!0}else return e.engines.node=t,!0;return!1}function w(e,t){let n=T(e),r=T(t);return!n||!r?!1:E(n,r)>=0}function T(e){let t=e.trim(),n=e=>e!==null;if(t.includes(`||`)){let e=t.split(`||`).map(e=>e.trim()).map(e=>T(e)).filter(n);return e.length===0?null:e.reduce((e,t)=>E(t,e)<0?t:e)}let r=t.split(d).filter(e=>e!==``&&e!==`&&`);if(r.length>1){let e=r.filter(e=>f.test(e)).map(e=>T(e)).filter(n);return e.length===0?null:e.reduce((e,t)=>E(t,e)>0?t:e)}let i=null;return i=p.exec(t),i||(i=m.exec(t),i)||(i=h.exec(t),i)||(i=g.exec(t),i)?{major:Number.parseInt(i[1],10),minor:Number.parseInt(i[2],10),patch:Number.parseInt(i[3],10)}:(i=_.exec(t),i?{major:Number.parseInt(i[1],10),minor:Number.parseInt(i[2],10),patch:0}:(i=v.exec(t),i||(i=y.exec(t),i)||(i=b.exec(t),i)?{major:Number.parseInt(i[1],10),minor:0,patch:0}:null))}function E(e,t){return e.major===t.major?e.minor===t.minor?e.patch-t.patch:e.minor-t.minor:e.major-t.major}function D(n=i.cwd()){let a=r(n,`node_modules/rari/package.json`);if(!e(a))return c(`rari is not installed. Please run "npm install rari" first.`),i.exit(1),``;try{let e=S(t(a,`utf-8`));return e.version!=null&&e.version!==``?`^${e.version}`:(c(`Could not determine rari version from package.json`),i.exit(1),``)}catch(e){return c(`Failed to read rari package.json: ${u(e)}`),i.exit(1),``}}function O(a,d){let f=r(a,`package.json`);e(f)||(c(`No package.json found. Please run this command from your project root.`),i.exit(1));try{let e=S(t(f,`utf-8`));e.scripts=e.scripts??{};let r=d.startScript??`rari start`;e.scripts.start&&e.scripts.start!==r&&!e.scripts[`start:original`]&&(l(`Existing start script found: "${e.scripts.start}"`),l(`Backing up to start:original and replacing with "${r}"`),e.scripts[`start:original`]=e.scripts.start),e.scripts.start=r,e.scripts[`start:local`]=`rari start`,e.scripts[`deploy:${d.providerName.toLowerCase()}`]=d.deployScript,C(e),(e.dependencies?.rari==null||e.dependencies.rari===``)&&(o(`Adding rari dependency...`),e.dependencies=e.dependencies??{},e.dependencies.rari=d.dependency??D(a)),n(f,`${JSON.stringify(e,null,2)}\n`),s(`Updated package.json for ${d.providerName} deployment`)}catch(e){c(`Failed to update package.json: ${u(e)}`),i.exit(1)}}function k(i,a,o){let c=r(i,`.gitignore`),l=[``,`# ${a}`,`${o}/`,``].join(`
2
- `);if(e(c)){let e=t(c,`utf-8`),r=e.split(`
3
- `).map(e=>e.trim());r.includes(`${o}/`)||r.includes(o)||(n(c,e+l),s(`Updated .gitignore with ${a} entries`))}else{let e=`# Dependencies
4
- node_modules
5
- .pnpm-store
6
-
7
- # Build outputs
8
- dist
9
-
10
- # Environment variables
11
- .env
12
- .env.local
13
- .env.production
14
-
15
- # ${a}
16
- ${o}
17
-
18
- # Logs
19
- *.log
20
- npm-debug.log*
21
- pnpm-debug.log*
22
-
23
- # OS files
24
- .DS_Store
25
- Thumbs.db
26
-
27
- # IDE files
28
- .vscode
29
- .idea
30
- *.swp
31
- *.swo
32
- *~
33
-
34
- # Temporary files
35
- .tmp
36
- tmp
37
- `;n(c,e),s(`Created .gitignore with ${a} entries`)}}function A(a,o,d){let f=r(a,o);try{if(e(f)){let i=t(f,`utf-8`),s=`${o}.backup`,c=r(a,s);e(c)&&(s=`${o}.backup.${Date.now()}`,c=r(a,s)),l(`${o} already exists, backing up to ${s}`),n(c,i,{flag:`wx`})}n(f,d),s(`Created ${o} configuration`)}catch(e){c(`Failed to create or backup ${o}: ${u(e)}`),i.exit(1)}}export{o as a,O as i,A as n,s as o,D as r,k as t};
1
+ import{existsSync as e,readFileSync as t,writeFileSync as n}from"node:fs";import{join as r}from"node:path";import i from"node:process";import{styleText as a}from"node:util";function o(e){console.warn(`${a(`blue`,`info`)} ${e}`)}function s(e){console.warn(`${a(`green`,`✓`)} ${e}`)}function c(e){console.error(`${a(`red`,`✗`)} ${e}`)}function l(e){console.warn(`${a(`yellow`,`⚠`)} ${e}`)}function u(e,t=`Unknown error`){return Error.isError(e)?e.message:typeof e==`string`?e:t}const d=/\s+(?:&&\s+)?/,f=/^>=?\s*(\d+)/,p=/^>=?\s*(\d+)\.(\d+)\.(\d+)/,m=/^=?\s*(\d+)\.(\d+)\.(\d+)/,h=/^\^\s*(\d+)\.(\d+)\.(\d+)/,g=/^~\s*(\d+)\.(\d+)\.(\d+)/,_=/^(?:>=?|<=?|[=~^])?\s*(\d+)\.(\d+)/,v=/^(\d+)\.(?:x|\*)/i,y=/^(?:>=?|[=~^])\s*(\d+)(?:\s|$)/,b=/^(\d+)$/;function x(e){return typeof e==`object`&&!!e}function S(e){let t=JSON.parse(e);if(!x(t))throw Error(`Invalid package.json`);return t}function C(e,t=`>=24.21.0`){if(e.engines=e.engines??{},e.engines.node){if(!w(e.engines.node,t))return l(`Current engines.node value "${e.engines.node}" may not meet the required minimum of ${t}`),l(`Updating to ${t} for deployment compatibility`),e.engines.node=t,!0}else return e.engines.node=t,!0;return!1}function w(e,t){let n=T(e),r=T(t);return!n||!r?!1:E(n,r)>=0}function T(e){let t=e.trim(),n=e=>e!==null;if(t.includes(`||`)){let e=t.split(`||`).map(e=>e.trim()).map(e=>T(e)).filter(n);return e.length===0?null:e.reduce((e,t)=>E(t,e)<0?t:e)}let r=t.split(d).filter(e=>e!==``&&e!==`&&`);if(r.length>1){let e=r.filter(e=>f.test(e)).map(e=>T(e)).filter(n);return e.length===0?null:e.reduce((e,t)=>E(t,e)>0?t:e)}let i=null;return i=p.exec(t),i||(i=m.exec(t),i)||(i=h.exec(t),i)||(i=g.exec(t),i)?{major:Number.parseInt(i[1],10),minor:Number.parseInt(i[2],10),patch:Number.parseInt(i[3],10)}:(i=_.exec(t),i?{major:Number.parseInt(i[1],10),minor:Number.parseInt(i[2],10),patch:0}:(i=v.exec(t),i||(i=y.exec(t),i)||(i=b.exec(t),i)?{major:Number.parseInt(i[1],10),minor:0,patch:0}:null))}function E(e,t){return e.major===t.major?e.minor===t.minor?e.patch-t.patch:e.minor-t.minor:e.major-t.major}function D(n=i.cwd()){let a=r(n,`node_modules/rari/package.json`);if(!e(a))return c(`rari is not installed. Please run "npm install rari" first.`),i.exit(1),``;try{let e=S(t(a,`utf-8`));return e.version!=null&&e.version!==``?`^${e.version}`:(c(`Could not determine rari version from package.json`),i.exit(1),``)}catch(e){return c(`Failed to read rari package.json: ${u(e)}`),i.exit(1),``}}function O(t){return e(r(t,`pnpm-lock.yaml`))?`pnpm install`:e(r(t,`yarn.lock`))?`yarn install`:e(r(t,`bun.lock`))||e(r(t,`bun.lockb`))?`bun install`:`npm install`}function k(a,d){let f=r(a,`package.json`);if(!e(f))return c(`No package.json found. Please run this command from your project root.`),i.exit(1),!1;try{let e=S(t(f,`utf-8`));e.scripts=e.scripts??{};let r=`rari start`;e.scripts.start&&e.scripts.start!==r&&!e.scripts[`start:original`]&&(l(`Existing start script found: "${e.scripts.start}"`),l(`Backing up to start:original and replacing with "${r}"`),e.scripts[`start:original`]=e.scripts.start),e.scripts.start=r,`build`in e.scripts||(e.scripts.build=`rari build`),d.deployScript!=null&&(e.scripts[`deploy:${d.providerName.toLowerCase()}`]=d.deployScript),C(e);let i=e.dependencies?.rari==null||e.dependencies.rari===``;return i&&(o(`Adding rari dependency...`),e.dependencies=e.dependencies??{},e.dependencies.rari=D(a),l(`rari was added to dependencies. Run "${O(a)}" to update your lockfile before deploying; frozen-lockfile installs will fail otherwise.`)),n(f,`${JSON.stringify(e,null,2)}\n`),s(`Updated package.json for ${d.providerName} deployment`),i}catch(e){return c(`Failed to update package.json: ${u(e)}`),i.exit(1),!1}}function A(e,t,n){console.warn(``),s(`${e} deployment setup complete! 🎉`),console.warn(``),o(`Next steps:`);for(let[e,n]of t.entries())console.warn(` ${e+1}. ${n}`);console.warn(``),o(`Your rari app will automatically:`);for(let t of[`Detect ${e} environment`,...n,`Run in production mode`,`Download platform-specific rari binary`])console.warn(` ✅ ${t}`);console.warn(``),s(`Ready for deployment! 🚀`)}function j(a,o,d){let f=r(a,o);try{if(e(f)){let i=t(f,`utf-8`),s=`${o}.backup`,c=r(a,s);e(c)&&(s=`${o}.backup.${Date.now()}`,c=r(a,s)),l(`${o} already exists, backing up to ${s}`),n(c,i,{flag:`wx`})}n(f,d),s(`Created ${o} configuration`)}catch(e){c(`Failed to create or backup ${o}: ${u(e)}`),i.exit(1)}}export{c as a,O as i,A as n,o,j as r,s,k as t};
package/dist/vite.d.mts CHANGED
@@ -1,8 +1,7 @@
1
- import { C as RouteSegmentType, D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, S as RouteSegment, T as ApiResponse, _ as LayoutProps, a as Sitemap, b as NotFoundEntry, c as SitemapVideo, d as AppRouteMatch, f as ErrorEntry, g as LayoutEntry, h as GenerateStaticParams, i as RobotsRule, l as AppRouteEntry, m as GenerateMetadata, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, u as AppRouteManifest, v as LoadingEntry, w as TemplateEntry, x as PageProps, y as Metadata } from "./types-yeW6ju9Y.mjs";
2
- import { a as ProxyModule, c as RariURL, i as ProxyMatcher, l as RequestCookies, n as ProxyConfig, o as ProxyResult, r as ProxyFunction, s as RariFetchEvent, t as CookieOptions, u as ResponseCookies } from "./types-DAdRjhuk.mjs";
1
+ import { C as RouteSegmentType, D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, S as RouteSegment, T as ApiResponse, _ as LayoutProps, a as Sitemap, b as NotFoundEntry, c as SitemapVideo, d as AppRouteMatch, f as ErrorEntry, g as LayoutEntry, h as GenerateStaticParams, i as RobotsRule, l as AppRouteEntry, m as GenerateMetadata, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, u as AppRouteManifest, v as LoadingEntry, w as TemplateEntry, x as PageProps, y as Metadata } from "./types-DNk27dqJ.mjs";
2
+ import { a as ProxyModule, c as RariURL, i as ProxyMatcher, l as RequestCookies, n as ProxyConfig, o as ProxyResult, r as ProxyFunction, s as RariFetchEvent, t as CookieOptions, u as ResponseCookies } from "./types-CSDt4P_t.mjs";
3
3
  import { UserConfig } from "vite-plus";
4
4
  import { ReactCompilerOptions as ReactCompilerOptions$1 } from "oxc-transform-react";
5
- //#region src/vite/analysis/directives.d.ts
6
5
  interface DirectiveResult {
7
6
  readonly hasUseClient: boolean;
8
7
  readonly hasUseServer: boolean;
@@ -15,8 +14,6 @@ interface ModuleAnalysis {
15
14
  readonly hasComponentExport: boolean;
16
15
  readonly importSources: readonly string[];
17
16
  }
18
- //#endregion
19
- //#region src/vite/analysis/module-cache.d.ts
20
17
  declare class ModuleAnalysisCache {
21
18
  private readonly cache;
22
19
  get(filePath: string, source?: string): ModuleAnalysis;
@@ -25,14 +22,10 @@ declare class ModuleAnalysisCache {
25
22
  clear(): void;
26
23
  private readMtimeMs;
27
24
  }
28
- //#endregion
29
- //#region src/vite/mdx/registry.d.ts
30
25
  interface MdxPluginOptions {
31
26
  readonly componentsDir?: string;
32
27
  readonly contentDirs?: readonly string[];
33
28
  }
34
- //#endregion
35
- //#region src/vite/plugin/types.d.ts
36
29
  /**
37
30
  * Public plugin shape returned by rari helpers.
38
31
  *
@@ -44,8 +37,6 @@ interface RariPlugin {
44
37
  name: string;
45
38
  enforce?: 'pre' | 'post';
46
39
  }
47
- //#endregion
48
- //#region src/vite/server/config.d.ts
49
40
  interface ServerCSPConfig {
50
41
  readonly scriptSrc?: readonly string[];
51
42
  readonly styleSrc?: readonly string[];
@@ -92,8 +83,6 @@ interface ServerConfig {
92
83
  origin?: string;
93
84
  htmlLimitedBots?: string;
94
85
  }
95
- //#endregion
96
- //#region src/vite/server/build.d.ts
97
86
  interface ServerBuildOptions {
98
87
  readonly outDir?: string;
99
88
  readonly clientOutDir?: string;
@@ -118,12 +107,8 @@ interface ServerBuildOptions {
118
107
  };
119
108
  readonly mdx?: MdxPluginOptions;
120
109
  }
121
- //#endregion
122
- //#region src/vite/transform/react-compiler.d.ts
123
110
  type ReactCompilerOptions = ReactCompilerOptions$1;
124
111
  type RariCompilerOption = boolean | ReactCompilerOptions;
125
- //#endregion
126
- //#region src/proxy/build/vite-plugin.d.ts
127
112
  interface ProxyPluginOptions {
128
113
  readonly root?: string;
129
114
  readonly srcDir?: string;
@@ -132,8 +117,6 @@ interface ProxyPluginOptions {
132
117
  readonly verbose?: boolean;
133
118
  }
134
119
  export declare function rariProxy(options?: ProxyPluginOptions): RariPlugin;
135
- //#endregion
136
- //#region src/router/build/props-extractor.d.ts
137
120
  interface ServerSidePropsResult {
138
121
  props: Record<string, any>;
139
122
  revalidate?: number;
@@ -251,24 +234,18 @@ export declare function extractServerPropsWithCache(componentPath: string, param
251
234
  }>, cacheTime?: number): Promise<ServerSidePropsResult>;
252
235
  export declare function clearPropsCache(): void;
253
236
  export declare function clearPropsCacheForComponent(componentPath: string): void;
254
- //#endregion
255
- //#region src/router/build/routes.d.ts
256
237
  interface AppRouteGeneratorOptions {
257
238
  readonly appDir: string;
258
239
  readonly extensions?: readonly string[];
259
240
  readonly verbose?: boolean;
260
241
  }
261
242
  export declare function generateAppRouteManifest(appDir: string, options?: Readonly<Partial<AppRouteGeneratorOptions>>): Promise<AppRouteManifest>;
262
- //#endregion
263
- //#region src/router/build/vite-plugin.d.ts
264
243
  interface RariRouterPluginOptions {
265
244
  readonly appDir?: string;
266
245
  readonly extensions?: readonly string[];
267
246
  readonly outDir?: string;
268
247
  }
269
248
  export declare function rariRouter(options?: RariRouterPluginOptions): RariPlugin;
270
- //#endregion
271
- //#region src/vite/index.d.ts
272
249
  export interface RouterPluginOptions {
273
250
  readonly appDir?: string;
274
251
  readonly extensions?: readonly string[];
@@ -337,5 +314,4 @@ export declare function defineRariConfig(config: UserConfig & {
337
314
  }): UserConfig;
338
315
  export type Request = globalThis.Request;
339
316
  export type Response = globalThis.Response;
340
- //#endregion
341
317
  export { ApiResponse, type ApiRouteHandlers, type AppRouteEntry, type AppRouteManifest, type AppRouteMatch, type CookieOptions, type ErrorEntry, type ErrorProps, type GenerateMetadata, type GenerateStaticParams, type LayoutEntry, type LayoutProps, type LoadingEntry, type Metadata, type MetadataResult, type NotFoundEntry, type PageProps, type ProxyConfig, type ProxyFunction, type ProxyMatcher, type ProxyModule, type ProxyPluginOptions, type ProxyResult, type RariCompilerOption, type RariFetchEvent, type RariPlugin, type RariURL, type ReactCompilerOptions, type RequestCookies, type ResponseCookies, type Robots, type RobotsRule, type RouteContext, type RouteHandler, type RouteSegment, type RouteSegmentType, type ServerActionConfig, type ServerCSPConfig, type ServerCacheConfig, type ServerCacheControlConfig, type ServerCacheLayerConfig, type ServerConfig, type ServerSidePropsResult, type ServerUseCacheConfig, type Sitemap, type SitemapEntry, type SitemapImage, type SitemapVideo, type StaticParamsResult, type TemplateEntry };