rari 0.15.17 → 0.17.0

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 (98) hide show
  1. package/dist/api-routes-Dc2tv31o.mjs +1 -0
  2. package/dist/cli.d.mts +11 -0
  3. package/dist/cli.mjs +39 -39
  4. package/dist/constants-CRK2JRKf.mjs +1 -0
  5. package/dist/define-B_ozIapW.mjs +1 -0
  6. package/dist/dist-paths-C4EV064W.mjs +1 -0
  7. package/dist/execute-CbhDMAQ3.mjs +1 -0
  8. package/dist/feed-NrJzjZyg.mjs +10 -0
  9. package/dist/font/google.d.mts +1951 -0
  10. package/dist/font/google.mjs +1 -0
  11. package/dist/font/local.d.mts +4 -0
  12. package/dist/font/local.mjs +1 -0
  13. package/dist/font.d.mts +3 -0
  14. package/dist/font.mjs +1 -0
  15. package/dist/form-state-DAygOjc8.mjs +1 -0
  16. package/dist/get-client-component-s7qprTUa.mjs +1 -0
  17. package/dist/headers.d.mts +4 -4
  18. package/dist/image/static.d.mts +1 -0
  19. package/dist/image/static.mjs +1 -0
  20. package/dist/image.d.mts +10 -41
  21. package/dist/image.mjs +1 -1
  22. package/dist/index.d.mts +6 -2
  23. package/dist/index.mjs +1 -1
  24. package/dist/mdx/define.mjs +1 -1
  25. package/dist/mdx/registry.d.mts +2 -3
  26. package/dist/mdx.d.mts +3 -3
  27. package/dist/mdx.mjs +1 -1
  28. package/dist/names-CLmM0CPi.mjs +1 -0
  29. package/dist/navigation-transition-store-CSKrbtbK.mjs +1 -0
  30. package/dist/og.d.mts +2 -2
  31. package/dist/og.mjs +1 -1
  32. package/dist/path-CTEC1xmy.mjs +1 -0
  33. package/dist/platform.d.mts +3 -4
  34. package/dist/preload-modules-Dv_GzGCm.mjs +2 -0
  35. package/dist/proxy/RariRequest.d.mts +2 -3
  36. package/dist/proxy/RariRequest.mjs +1 -1
  37. package/dist/proxy/RariResponse.mjs +1 -1
  38. package/dist/proxy/runtime-executor.d.mts +2 -4
  39. package/dist/proxy/runtime-executor.mjs +7 -1
  40. package/dist/{railway-dlVtU472.mjs → railway-CE3nqaKt.mjs} +1 -1
  41. package/dist/regex-constants-DzXwNGh2.mjs +1 -0
  42. package/dist/{render-Dipra0HL.mjs → render-D0eMtn5L.mjs} +1 -1
  43. package/dist/robots-BOPIkPcN.mjs +9 -0
  44. package/dist/router-Cl4J7j1A.mjs +1 -0
  45. package/dist/router.d.mts +13 -14
  46. package/dist/router.mjs +1 -1
  47. package/dist/rsc-vite-build-CSnu8C3P.mjs +1 -0
  48. package/dist/runtime/AppRouterProvider.d.mts +10 -7
  49. package/dist/runtime/AppRouterProvider.mjs +1 -1
  50. package/dist/runtime/ClientRouter.d.mts +3 -5
  51. package/dist/runtime/ClientRouter.mjs +7 -1
  52. package/dist/runtime/ErrorBoundaryWrapper.d.mts +2 -3
  53. package/dist/runtime/ErrorBoundaryWrapper.mjs +1 -1
  54. package/dist/runtime/action-flight-refresh.d.mts +4 -5
  55. package/dist/runtime/action-flight-refresh.mjs +1 -1
  56. package/dist/runtime/action-revalidation-kind.d.mts +6 -7
  57. package/dist/runtime/call-server.d.mts +2 -3
  58. package/dist/runtime/call-server.mjs +1 -1
  59. package/dist/runtime/entry-client.d.mts +3 -5
  60. package/dist/runtime/entry-client.mjs +3 -3
  61. package/dist/runtime/flight-route-cache.d.mts +7 -13
  62. package/dist/runtime/flight-route-cache.mjs +1 -1
  63. package/dist/runtime/flight-router-state.d.mts +8 -8
  64. package/dist/runtime/flight-router-state.mjs +1 -1
  65. package/dist/runtime/merge-flight-refresh.d.mts +6 -3
  66. package/dist/runtime/merge-flight-refresh.mjs +1 -1
  67. package/dist/runtime/rsc-client-runtime.d.mts +3 -2
  68. package/dist/runtime/rsc-client-runtime.mjs +1 -1
  69. package/dist/runtime/rsc-references.d.mts +3 -4
  70. package/dist/serialize-router-state-uOGGpmBr.mjs +1 -0
  71. package/dist/sitemap--bdIkWl5.mjs +13 -0
  72. package/dist/static-modules-DBL6iFbg.d.mts +61 -0
  73. package/dist/type-guards-BJXKlA6x.mjs +1 -0
  74. package/dist/{types-_vPM8QuJ.d.mts → types-C8N3Hc8I.d.mts} +1 -9
  75. package/dist/types-CkZPEEdi.d.mts +43 -0
  76. package/dist/{types-0350HUwk.d.mts → types-DfSnnFaF.d.mts} +240 -4
  77. package/dist/utils-YdvPzSET-Cbo6Ofmz.mjs +37 -0
  78. package/dist/vite.d.mts +40 -23
  79. package/dist/vite.mjs +841 -132
  80. package/dist/{xml-N8OZmN7u.mjs → xml-DPsk9WTz.mjs} +1 -1
  81. package/package.json +46 -33
  82. package/dist/alias-resolver-Cigam7Y7.mjs +0 -1
  83. package/dist/api-routes-ChRr3O5-.mjs +0 -1
  84. package/dist/constants-BFdy-wPN.mjs +0 -1
  85. package/dist/define-CzFpVAjt.mjs +0 -1
  86. package/dist/feed-Ixvy9L12.mjs +0 -3
  87. package/dist/get-client-component-CLpyIcLJ.mjs +0 -1
  88. package/dist/names-N6JRDeT1.mjs +0 -1
  89. package/dist/preload-modules-QmSvKk0Q.mjs +0 -2
  90. package/dist/regex-constants-Wm7xRA3u.mjs +0 -1
  91. package/dist/robots-BGCTYwKN.mjs +0 -2
  92. package/dist/router-D84JWQz7.mjs +0 -1
  93. package/dist/runtime/LoadingErrorBoundary.d.mts +0 -11
  94. package/dist/runtime/LoadingErrorBoundary.mjs +0 -1
  95. package/dist/sitemap-1n5BIACA.mjs +0 -7
  96. package/dist/type-guards-CTkEL8zw.mjs +0 -1
  97. package/dist/types-DCEyvFz7.d.mts +0 -199
  98. package/dist/utils-BLSRP4f6-8hVIII5T.mjs +0 -37
@@ -1 +1 @@
1
- import{l as e}from"./regex-constants-Wm7xRA3u.mjs";function t(t){return t.replace(e.AMPERSAND,`&`).replace(e.LT,`<`).replace(e.GT,`>`).replace(e.QUOTE,`"`).replace(e.APOS,`'`)}export{t};
1
+ import{c as e}from"./regex-constants-DzXwNGh2.mjs";function t(t){return t.replace(e.AMPERSAND,`&`).replace(e.LT,`<`).replace(e.GT,`>`).replace(e.QUOTE,`"`).replace(e.APOS,`'`)}export{t};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rari",
3
3
  "type": "module",
4
- "version": "0.15.17",
4
+ "version": "0.17.0",
5
5
  "description": "Runtime Accelerated Rendering Infrastructure (rari)",
6
6
  "author": "Ryan Skinner",
7
7
  "license": "MIT",
@@ -15,22 +15,14 @@
15
15
  "url": "https://github.com/rari-build/rari/issues"
16
16
  },
17
17
  "keywords": [
18
+ "deno",
19
+ "framework",
18
20
  "react",
19
- "server-components",
20
21
  "rsc",
21
22
  "rust",
22
- "vite",
23
- "framework",
24
- "performance",
23
+ "server-components",
25
24
  "ssr",
26
- "typescript",
27
- "deno",
28
- "v8",
29
- "streaming",
30
- "fast",
31
- "zero-config",
32
- "full-stack",
33
- "web-framework"
25
+ "vite"
34
26
  ],
35
27
  "sideEffects": [
36
28
  "./dist/runtime/entry-client.mjs",
@@ -46,6 +38,21 @@
46
38
  "types": "./dist/image.d.mts",
47
39
  "default": "./dist/image.mjs"
48
40
  },
41
+ "./image/static": {
42
+ "types": "./dist/image/static.d.mts"
43
+ },
44
+ "./font": {
45
+ "types": "./dist/font.d.mts",
46
+ "default": "./dist/font.mjs"
47
+ },
48
+ "./font/local": {
49
+ "types": "./dist/font/local.d.mts",
50
+ "default": "./dist/font/local.mjs"
51
+ },
52
+ "./font/google": {
53
+ "types": "./dist/font/google.d.mts",
54
+ "default": "./dist/font/google.mjs"
55
+ },
49
56
  "./mdx": {
50
57
  "types": "./dist/mdx.d.mts",
51
58
  "default": "./dist/mdx.mjs"
@@ -131,53 +138,59 @@
131
138
  "dist"
132
139
  ],
133
140
  "engines": {
134
- "node": ">=22.18.0"
141
+ "node": "^24.21.0 || >=26.0.0"
135
142
  },
136
143
  "peerDependencies": {
137
144
  "@mdx-js/mdx": "^3.1.1",
138
- "oxc-transform-react": "^0.147.0",
139
- "react": "^19.2.8",
140
- "react-dom": "^19.2.8"
145
+ "@rari/use-cache": "^0.17.0",
146
+ "oxc-transform-react": "^0.151.0",
147
+ "react": "^19.3.0",
148
+ "react-dom": "^19.3.0"
141
149
  },
142
150
  "peerDependenciesMeta": {
143
151
  "@mdx-js/mdx": {
144
152
  "optional": true
145
153
  },
154
+ "@rari/use-cache": {
155
+ "optional": true
156
+ },
146
157
  "oxc-transform-react": {
147
158
  "optional": true
148
159
  }
149
160
  },
150
161
  "dependencies": {
151
- "lightningcss": "^1.33.0",
152
- "react-server-dom-webpack": "^19.2.8",
153
- "rolldown": "^1.2.6"
162
+ "@capsizecss/metrics": "^4.3.0",
163
+ "@capsizecss/unpack": "^4.0.1",
164
+ "react-server-dom-webpack": "^19.3.0"
154
165
  },
155
166
  "optionalDependencies": {
156
- "@rari/use-cache": "0.15.17",
157
- "rari-darwin-arm64": "0.15.17",
158
- "rari-darwin-x64": "0.15.17",
159
- "rari-linux-arm64": "0.15.17",
160
- "rari-linux-x64": "0.15.17",
161
- "rari-win32-arm64": "0.15.17",
162
- "rari-win32-x64": "0.15.17"
167
+ "rari-darwin-arm64": "0.17.0",
168
+ "rari-darwin-x64": "0.17.0",
169
+ "rari-linux-arm64": "0.17.0",
170
+ "rari-linux-x64": "0.17.0",
171
+ "rari-win32-arm64": "0.17.0",
172
+ "rari-win32-x64": "0.17.0"
163
173
  },
164
174
  "devDependencies": {
165
175
  "@mdx-js/mdx": "^3.1.1",
166
176
  "@rari/deploy": "0.0.0",
167
177
  "@rari/logger": "0.0.0",
168
- "@types/node": "^26.4.0",
169
- "@types/react": "^19.2.18",
170
- "@types/react-dom": "^19.2.5",
171
- "oxc-transform-react": "^0.147.0",
178
+ "@rari/use-cache": "0.17.0",
179
+ "@types/node": "^26.6.3",
180
+ "@types/react": "^19.3.0",
181
+ "@types/react-dom": "^19.3.0",
182
+ "oxc-transform-react": "^0.151.0",
172
183
  "typescript": "npm:@typescript/typescript6@^6.0.2",
173
184
  "typescript-7": "npm:typescript@^7.0.2",
174
- "vite-plus": "^0.3.0"
185
+ "vite-plus": "^1.0.0"
175
186
  },
176
187
  "scripts": {
177
188
  "build": "pnpm typecheck && vp pack",
178
189
  "clean": "node --eval \"import('node:fs').then(fs => fs.rmSync('dist', { recursive: true, force: true }))\"",
179
190
  "lint": "vp lint",
180
191
  "lint:fix": "vp lint --fix",
181
- "typecheck": "tsc"
192
+ "typecheck": "tsc",
193
+ "update-google-fonts": "node ./scripts/update-google-fonts.ts",
194
+ "update-react-refresh-runtime": "node ./scripts/update-react-refresh-runtime.ts"
182
195
  }
183
196
  }
@@ -1 +0,0 @@
1
- import e from"node:fs";import t from"node:path";const n=new Map,r=new Map;function i(t){let r=n.get(t);return r===void 0?(r=e.existsSync(t),n.set(t,r),r):r}function a(t){let n=r.get(t);if(n!==void 0)return n;try{n=e.statSync(t).isDirectory()}catch{n=!1}return r.set(t,n),n}function o(){n.clear(),r.clear()}function s(e,t){let n=null;for(let r of t)if(e.endsWith(r)&&(n??=i(e),n))return e;for(let n of t){let t=`${e}${n}`;if(i(t))return t}return null}function c(e,n){if(i(e)){if(!a(e))return null;for(let r of n){let n=t.join(e,`index${r}`);if(i(n))return n}}return null}const l=[`.tsx`,`.jsx`,`.ts`,`.js`];function u(e,n,r={},i=l){let a=e;for(let[t,n]of Object.entries(r))if(e.startsWith(`${t}/`)){a=e.replace(t,n);break}else if(e===t){a=n;break}let o=t.resolve(t.dirname(n),a),u=s(o,i);if(u!=null&&u!==``)return u;let d=c(o,i);return d!=null&&d!==``?d:`${o}.tsx`}const d=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`];function f(e,t=d){return s(e,t)??c(e,t)}const p=new WeakMap;function m(e){let t=p.get(e);return t||(t=Object.entries(e).sort((e,t)=>t[0].length-e[0].length),p.set(e,t),t)}function h(e,n,r){if(typeof e!=`string`)throw TypeError(`Expected source to be a string, but received ${typeof e}`);if(typeof n!=`object`||Array.isArray(n))throw TypeError(`Expected aliases to be a plain object, but received ${Array.isArray(n)?`array`:typeof n}`);if(Object.getPrototypeOf(n)!==Object.prototype&&Object.getPrototypeOf(n)!==null)throw TypeError(`Expected aliases to be a plain object, but received ${n.constructor.name||`object with custom prototype`}`);if(typeof r!=`string`)throw TypeError(`Expected projectRoot to be a string, but received ${typeof r}`);let i=m(n);for(let[n,a]of i)if(e.startsWith(`${n}/`)||e===n){let i=e.slice(n.length).replace(/^\/+/,``),o=t.join(a,i);return t.isAbsolute(o)?o:t.resolve(r,o)}return null}export{s as a,c as i,o as n,f as o,u as r,h as t};
@@ -1 +0,0 @@
1
- var e=class extends Response{static json(e,t){return Response.json(e,t)}static redirect(e,t=307){return/^https?:\/\//i.test(e)?Response.redirect(e,t):new Response(null,{status:t,headers:{location:e}})}static noContent(e){return new Response(null,{...e,status:204})}};export{e as t};
@@ -1 +0,0 @@
1
- const e=[640,750,828,1080,1200,1920,2048,3840],t=[16,32,48,64,96,128,256,384],n=[`avif`],r=[25,50,75,100],i=60;export{r as a,i,n,t as r,e as t};
@@ -1 +0,0 @@
1
- import{p as e}from"./type-guards-CTkEL8zw.mjs";import{s as t}from"./regex-constants-Wm7xRA3u.mjs";import{t as n}from"./names-N6JRDeT1.mjs";import{registerClientReference as r}from"./runtime/rsc-references.mjs";import{r as i}from"./rari-global-5vGzhToD.mjs";function a(e,n,a=`default`){let o=`${n}#${a}`;if(typeof globalThis<`u`){let r=i(),s=n.replace(t,``).split(`/`).pop(),c=s!=null&&s!==``?s:a,l={id:a==="default"?c:a,path:n,type:`client`,component:e,registered:!0};r[o]=l,r[c]=l,r[n]=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 r(s,n,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)}function l(e){return c(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 u(e){let t=l(e);return e=>{let r={},i={},a=new Set(n(e));for(let e of t)if(a.has(e.name)){if(e.client===!1){r[e.name]=e.component;continue}i[e.name]={component:e.component,id:e.id,exportName:e.exportName}}return{...r,...o(i)}}}export{u as t};
@@ -1,3 +0,0 @@
1
- import{p as e}from"./type-guards-CTkEL8zw.mjs";import{o as t,t as n}from"./alias-resolver-Cigam7Y7.mjs";import{t as r}from"./xml-N8OZmN7u.mjs";import{Buffer as i}from"node:buffer";import{promises as a}from"node:fs";import o from"node:path";const s=`\0virtual:feed`;function c(t){return e(t)&&typeof t.title==`string`&&typeof t.description==`string`&&typeof t.link==`string`&&Array.isArray(t.items)}async function l(e){if(typeof e==`function`){let t=e(),n=t instanceof Promise?await t:t;if(!c(n))throw Error(`Feed default export must resolve to a feed object`);return n}if(!c(e))throw Error(`Feed default export must be a feed object`);return e}function u(e){return(typeof e==`string`?new Date(e):e).toUTCString()}function d(e){return e==null||e===``?``:typeof e==`string`?` <dc:creator>${r(e)}</dc:creator>`:e.email!=null&&e.email!==``?` <author>${r(`${e.email} (${e.name})`)}</author>`:` <dc:creator>${r(e.name)}</dc:creator>`}function f(e){let t=[` <item>`];t.push(` <title>${r(e.title)}</title>`),t.push(` <link>${r(e.url)}</link>`),e.description!=null&&e.description!==``&&t.push(` <description>${r(e.description)}</description>`),e.content!=null&&e.content!==``&&t.push(` <content:encoded><![CDATA[${e.content.replace(/\]\]>/g,`]]]]><![CDATA[>`)}]]></content:encoded>`);let n=d(e.author);if(n&&t.push(n),e.pubDate!=null&&t.push(` <pubDate>${u(e.pubDate)}</pubDate>`),t.push(` <guid isPermaLink="${e.guid!=null&&e.guid!==``?`false`:`true`}">${r(e.guid!=null&&e.guid!==``?e.guid:e.url)}</guid>`),e.categories)for(let n of e.categories)t.push(` <category>${r(n)}</category>`);if(e.enclosure){let n=[`url="${r(e.enclosure.url)}"`];e.enclosure.length!==void 0&&n.push(`length="${e.enclosure.length}"`),n.push(`type="${r(e.enclosure.type!=null&&e.enclosure.type!==``?e.enclosure.type:`application/octet-stream`)}"`),t.push(` <enclosure ${n.join(` `)} />`)}return t.push(` </item>`),t.join(`
2
- `)}function p(e){let t=e.items.some(e=>e.content!=null&&e.content!==``),n=e.items.some(e=>{let t=e.author;return t==null||t===``?!1:typeof t==`string`||t.email==null||t.email===``}),i=[];t&&i.push(`xmlns:content="http://purl.org/rss/1.0/modules/content/"`),n&&i.push(`xmlns:dc="http://purl.org/dc/elements/1.1/"`),i.push(`xmlns:atom="http://www.w3.org/2005/Atom"`);let a=[`<?xml version="1.0" encoding="UTF-8"?>`,`<rss version="2.0"${i.length>0?` ${i.join(` `)}`:``}>`,` <channel>`,` <title>${r(e.title)}</title>`,` <link>${r(e.link)}</link>`,` <description>${r(e.description)}</description>`,` <atom:link href="${r(`${e.link.replace(/\/+$/,``)}/feed.xml`)}" rel="self" type="application/rss+xml" />`];e.language!=null&&e.language!==``&&a.push(` <language>${r(e.language)}</language>`),e.copyright!=null&&e.copyright!==``&&a.push(` <copyright>${r(e.copyright)}</copyright>`),e.lastBuildDate!=null&&a.push(` <lastBuildDate>${u(e.lastBuildDate)}</lastBuildDate>`),e.ttl!==void 0&&a.push(` <ttl>${e.ttl}</ttl>`),e.image&&(a.push(` <image>`),a.push(` <url>${r(e.image.url)}</url>`),a.push(` <title>${r(e.image.title)}</title>`),a.push(` <link>${r(e.image.link)}</link>`),e.image.width!==void 0&&a.push(` <width>${e.image.width}</width>`),e.image.height!==void 0&&a.push(` <height>${e.image.height}</height>`),a.push(` </image>`));for(let t of e.items)a.push(f(t));return a.push(` </channel>`),a.push(`</rss>`),a.join(`
3
- `)}function m(e){switch(e){case`ts`:return`ts`;case`tsx`:return`tsx`;case`js`:case`mjs`:return`js`;case`jsx`:return`jsx`;default:throw Error(`Unsupported feed file extension: ".${e}". Allowed extensions are: .ts, .tsx, .js, .jsx, .mjs`)}}async function h(e,t=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`]){let n=o.join(e,`feed.xml`);try{return await a.access(n),{type:`static`,path:n}}catch{}for(let n of t){let t=o.join(e,`feed${n}`);try{return await a.access(t),{type:`dynamic`,path:t}}catch{}}return null}function g(e,r,i={},c){return{name:`virtual-feed`,resolveId(r,a){if(r===s)return r;if(Object.keys(i).length>0){let e=n(r,i,c);if(e!=null&&e!==``){let n=t(e);return n!=null&&n!==``?n:e}}if(r.startsWith(`.`)){let n=a==null||a===``||a.startsWith(`\0`)?e.path:a,i=o.resolve(o.dirname(n),r),s=t(i);return s!=null&&s!==``?s:i}return null},async load(t){if(t===s)return{code:r,moduleType:m(o.extname(e.path).slice(1))};if(t&&!t.startsWith(`\0`))try{return{code:await a.readFile(t,`utf-8`),moduleType:m(o.extname(t).slice(1))}}catch{return null}return null}}}async function _(t){let{appDir:n,outDir:r,extensions:c,aliases:u={}}=t,d=await h(n,c);if(!d)return!1;await a.mkdir(r,{recursive:!0});let f=o.join(r,`feed.xml`);if(d.type===`static`)return await a.copyFile(d.path,f),!0;try{let{build:t}=await import(`rolldown`),r=await a.readFile(d.path,`utf-8`),c=o.dirname(o.dirname(n)),m=await t({input:s,external:[`rari`],platform:`node`,write:!1,output:{format:`esm`,codeSplitting:!1},plugins:[g(d,r,u,c)]});if(m.output.length===0)throw Error(`Failed to build feed module`);let h=m.output.find(e=>e.type===`chunk`&&e.isEntry)??m.output.find(e=>e.type===`chunk`);if(h?.type!==`chunk`)throw Error(`No chunk output found in feed build result`);let _=h.code,v=await import(`data:text/javascript;base64,${i.from(_).toString(`base64`)}`);if(!e(v))throw Error(`Feed file must export a default export (either an object or a function)`);let y=v.default;if(y==null)throw Error(`Feed file must export a default export (either an object or a function)`);let b=p(await l(y));return await a.writeFile(f,b),!0}catch(e){return console.error(`[rari] Failed to build/execute feed file:`,e),!1}}export{_ as generateFeedFile};
@@ -1 +0,0 @@
1
- import{c as e,p as t,u as n}from"./type-guards-CTkEL8zw.mjs";import{n as r,r as i,t as a}from"./rari-global-5vGzhToD.mjs";import*as o from"react";function s(e){return e.startsWith(`./`)?[e,e.slice(2)]:[e,`./${e}`]}function c(e){let t=e.replace(/\\/g,`/`),n=new Set([t]),r=t.indexOf(`/src/`);r!==-1&&n.add(t.slice(r+1));let i=t.indexOf(`/components/`);return i!==-1&&n.add(t.slice(i+1)),[...n]}function l(e,t){if(t!==void 0)return t;let n=e.exportName;if(n!=null&&n!==``)return n}function u(e,t){let n=e.replace(/\\/g,`/`),r=t.replace(/\\/g,`/`);return!!(n===r||r.includes(`/`)&&n.endsWith(`/${r}`)||n.includes(`/`)&&r.endsWith(`/${n}`))}function d(e,t,n){for(let r of c(e))for(let e of s(r)){let r=Object.values(n).find(t=>t.path!==``&&u(t.path,e));if(r)return{info:r,exportName:l(r,t)}}return null}function f(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 p(e,t){return e.component==null?e.loadPromise?(await e.loadPromise,m(e,t)):e.loader?await f(e)==null?null:m(e,t):null:m(e,t)}function m(e,r){let i=e.component;if(i==null)return null;if(n(i))return i;if(!t(i))return null;if(r==null||r===``||r==="default")return i.default??i;if(r in i)return i[r];let a=i.default;return t(a)&&r in a?a[r]:null}function h(e){let t=e.replace(/\\/g,`/`);return t===e?[t]:[t,e]}function g(e){let t=i(),n=r(),o=a(),c=e.replace(/\\/g,`/`);for(let n of h(e))if(n in t){let e=t[n],r=n.indexOf(`#`);return{info:e,exportName:l(e,r===-1?void 0:n.slice(r+1))}}let u=c.indexOf(`#`),f=u===-1?c:c.slice(0,u),p=u===-1?void 0:c.slice(u+1);for(let n of h(e)){let e=n.indexOf(`#`),r=e===-1?n:n.slice(0,e);if(r in t)return{info:t[r],exportName:l(t[r],p)}}let m=c===e?[f]:[f,e.includes(`#`)?e.slice(0,e.indexOf(`#`)):e];for(let e of m){for(let r of s(e))if(r in n){let e=n[r];if(e!==``&&e in t)return{info:t[e],exportName:l(t[e],p)}}if(e in o){let n=o[e];if(n!==``&&n in t)return{info:t[n],exportName:l(t[n],p)}}}return d(f,p,t)}function _(e){return e instanceof Error?e:Error(String(e))}function v(e,t){return Object.assign(Error(`[rari] Lazy component "${t}" is loading`),{then:e.then.bind(e)})}function y(e){return e.component!=null||e.loader==null?e.loadPromise:e.loadError==null?e.loadPromise?e.loadPromise:f(e):Promise.reject(_(e.loadError))}function b(e,r,i){let a=l(e,i),o=m({...e,component:r},a);if(o==null)return t(r)&&(`default`in r||`__esModule`in r)?r:n(r)?{default:r,[a!=null&&a!==``?a:`default`]:r,__esModule:!0}:r;let s=a!=null&&a!==``?a:`default`;return{...t(r)?r:{},default:o,[s]:o,__esModule:!0}}function x(t,n,r,i){let a=l(t,i),s=a!=null&&a!==``?a:`default`,c=i=>{if(t.loadError!=null)throw _(t.loadError);if(t.component!=null){let r=m(t,a);if(r==null)throw Error(`[rari] Lazy component "${n}" loaded but export "${s}" is missing`);if(!e(r))throw Error(`[rari] Lazy component "${n}" export "${s}" is not a component`);return o.createElement(r,i)}throw v(r,n)};return c.displayName=`Lazy(${t.displayName??t.exportName??n})`,{default:c,[s]:c,__esModule:!0}}function S(e){let t=g(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 b(n,n.component,r);if(n.loader){if(n.loadError!=null)return x(n,e,Promise.resolve(),r);let t=y(n);if(t)return x(n,e,t,r)}return{}}async function C(e){let t=g(e);return t?p(t.info,t.exportName):null}function w(){typeof window>`u`||Reflect.set(globalThis,`__rari_chunk_load__`,async e=>{let t=i(),n=e.replace(/\\/g,`/`),r=e in t?t[e]:n in t?t[n]:Object.values(t).find(t=>t.path===e||t.path===n);if(r&&r.component==null&&r.loader!=null){let e=y(r);if(e)return e.then(()=>void 0)}return r?.loadPromise==null?Promise.resolve():r.loadPromise.then(()=>void 0)})}export{w as n,S as r,C as t};
@@ -1 +0,0 @@
1
- const e=/<([A-Z][A-Za-z0-9]*)(?=[\s>/])/;function t(t){let n=new Set,r=new RegExp(e.source,`g`);for(let e of t.matchAll(r))n.add(e[1]);return[...n]}export{t};
@@ -1,2 +0,0 @@
1
- import{l as e}from"./type-guards-CTkEL8zw.mjs";import{t}from"./get-client-component-CLpyIcLJ.mjs";async function n(n,r){let i=n.split(`
2
- `),a=new Set;for(let t of i){let n=t.trim();if(!n)continue;let i=n.indexOf(`:`);if(i===-1)continue;let o=n.substring(i+1);if(o.startsWith(`I`))try{let t=o.substring(1),n=JSON.parse(t);if(e(n)){let e=n[0],t=typeof n[2]==`string`?n[2]:void 0,i=e.replace(/\\/g,`/`),o;o=i.includes(`#`)?i:t!=null&&t!==``&&t!=="default"?`${i}#${t}`:i,(!r||!r.has(o))&&a.add(o)}}catch{}}a.size>0&&await Promise.all(Array.from(a,async e=>{try{if(await t(e)==null){console.warn(`[rari] Failed to preload component: ${e}`);return}r?.add(e)}catch(t){console.error(`[rari] Error preloading component ${e}:`,t)}}))}export{n as t};
@@ -1 +0,0 @@
1
- const e=/\.(?:tsx?|jsx?)$/,t=/^[A-Z]:\\/i,n=/\\/g,r=/[/\\]/,i=/\/$/,a=/^src\//,o=/^file:\/\//,s=/^https?:\/\//,c={AMPERSAND:/&/g,LT:/</g,GT:/>/g,QUOTE:/"/g,APOS:/'/g},l=/[^\w/-]/g,u=/export\s+(?:function|const|class)\s+(\w+)/,d=/export\s+(?:default\s+)?(?:async\s+)?(?:function|class)[\s{(]/,f=/export\s+default\s+(?:(?:async\s+)?\(|(?:async\s+)?[a-zA-Z_$][\w$]*\s*=>)/,p=/export\s+(?:const|let|var)\s+[a-zA-Z_$][\w$]*(?:\s*:[^;]*[^;=\s])?\s*=\s*(?:async\s+)?(?:function[\s*(]|\([^)]*\)\s*=>|[a-zA-Z_$][\w$]*\s*=>)/,m=/\.[^.]*$/,h=/['"]/g;export{d as a,o as c,r as d,i as f,t as g,e as h,f as i,c as l,a as m,l as n,u as o,h as p,p as r,m as s,n as t,s as u};
@@ -1,2 +0,0 @@
1
- import{p as e,r as t}from"./type-guards-CTkEL8zw.mjs";import{Buffer as n}from"node:buffer";import{promises as r}from"node:fs";import i from"node:path";function a(t){return e(t)&&t.rules!=null}async function o(e){if(typeof e==`function`){let t=e(),n=t instanceof Promise?await t:t;if(!a(n))throw Error(`Robots default export must resolve to a robots object`);return n}if(!a(e))throw Error(`Robots default export must be a robots object`);return e}function s(e){return typeof e==`string`?e===``?[`*`]:[e]:e==null?[`*`]:[...e]}function c(e){return e===void 0?[]:typeof e==`string`?e===``?[]:[e]:[...e].filter(e=>e!==``)}function l(e){let t=[],n=s(e.userAgent);for(let r of n){t.push(`User-Agent: ${r}`);let n=c(e.allow);for(let e of n)t.push(`Allow: ${e}`);let i=c(e.disallow);for(let e of i)t.push(`Disallow: ${e}`);e.crawlDelay!==void 0&&t.push(`Crawl-delay: ${e.crawlDelay}`),t.push(``)}return t}function u(e){return e==null||e===``?[]:[`Host: ${e}`,``]}function d(e){return c(e).map(e=>`Sitemap: ${e}`)}function f(e){let t=[],n=Array.isArray(e.rules)?e.rules:[e.rules];for(let e of n)t.push(...l(e));return t.push(...u(e.host)),t.push(...d(e.sitemap)),t.join(`
2
- `)}async function p(e,n=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`]){let a=i.join(e,`robots.txt`);try{return await r.access(a),{type:`static`,path:a}}catch(e){if(t(e)!==`ENOENT`)throw e}for(let a of n){let n=i.join(e,`robots${a}`);try{return await r.access(n),{type:`dynamic`,path:n}}catch(e){if(t(e)!==`ENOENT`)throw e}}return null}async function m(t){let{appDir:a,outDir:s,extensions:c}=t,l=await p(a,c);if(!l)return!1;let u=i.join(s,`robots.txt`);if(await r.mkdir(i.dirname(u),{recursive:!0}),l.type===`static`)return await r.copyFile(l.path,u),!0;try{let{build:t}=await import(`rolldown`),a=await r.readFile(l.path,`utf-8`),s=`\0virtual:robots`,c=await t({input:s,external:[`rari`],platform:`node`,write:!1,output:{format:`esm`,codeSplitting:!1},plugins:[{name:`virtual-robots`,resolveId(e){return e===s?e:e.startsWith(`.`)?i.resolve(i.dirname(l.path),e):null},load(e){if(e===s){let e=i.extname(l.path).slice(1),t;switch(e){case`ts`:t=`ts`;break;case`tsx`:t=`tsx`;break;case`js`:case`mjs`:t=`js`;break;case`jsx`:t=`jsx`;break;default:throw Error(`Unsupported robots file extension: .${e}. Supported extensions are: .ts, .tsx, .js, .jsx, .mjs`)}return{code:a,moduleType:t}}return null}}]});if(c.output.length===0)throw Error(`Failed to build robots module`);let d=c.output.find(e=>e.type===`chunk`&&e.isEntry)??c.output.find(e=>e.type===`chunk`);if(d?.type!==`chunk`)throw Error(`No chunk output found in robots build result`);let p=d.code,m=await import(`data:text/javascript;base64,${n.from(p).toString(`base64`)}`);if(!e(m))throw Error(`Robots file must export a default export (either an object or a function)`);let h=m.default;if(h==null)throw Error(`Robots file must export a default export (either an object or a function)`);let g=f(await o(h));return await r.writeFile(u,g),!0}catch(e){return console.error(`[rari] Failed to build/execute robots file:`,e),!1}}export{m as generateRobotsFile};
@@ -1 +0,0 @@
1
- import{n as e}from"./navigate-DuyUa6qD.mjs";import{n as t,p as n}from"./type-guards-CTkEL8zw.mjs";import{c as r}from"react/compiler-runtime";import{createContext as i,use as a,useEffect as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";function u(e){return n(e)&&typeof e.to==`string`}function d(e){return n(e)&&typeof e.navigate==`function`}const f=i(null);function p(n){let i=r(13),{children:a,initialPathname:p}=n,[y,b]=c(p),[x,S]=c(v),C=s(null),w,T;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{let e=e=>{let n=t(e,u);n&&(b(n.to),S(new URLSearchParams(window.location.search)))};return window.addEventListener(`rari:navigate`,e),()=>{window.removeEventListener(`rari:navigate`,e)}},T=[],i[0]=w,i[1]=T):(w=i[0],T=i[1]),o(w,T);let E,D;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{let n=e();n&&(C.current=n);let r=e=>{let n=t(e,d);n&&(C.current=n.navigate)},i=()=>{C.current=null};return window.addEventListener(`rari:register-navigate`,r),window.addEventListener(`rari:deregister-navigate`,i),()=>{window.removeEventListener(`rari:register-navigate`,r),window.removeEventListener(`rari:deregister-navigate`,i)}},D=[],i[2]=E,i[3]=D):(E=i[2],D=i[3]),o(E,D);let O;i[4]===Symbol.for(`react.memo_cache_sentinel`)?(O={},i[4]=O):O=i[4];let k,A;i[5]===Symbol.for(`react.memo_cache_sentinel`)?(k=async(e,t)=>{C.current?await C.current(e,t):(console.warn(`[rari] Router not ready, falling back to window.location`),window.location.href=e)},A=async(e,t)=>{C.current?await C.current(e,{...t,replace:!0}):(console.warn(`[rari] Router not ready, falling back to window.location`),window.location.replace(e))},i[5]=k,i[6]=A):(k=i[5],A=i[6]);let j;i[7]!==y||i[8]!==x?(j={pathname:y,params:O,searchParams:x,push:k,replace:A,back:_,forward:g,refresh:h,prefetch:m},i[7]=y,i[8]=x,i[9]=j):j=i[9];let M=j,N;return i[10]!==a||i[11]!==M?(N=l(f,{value:M,children:a}),i[10]=a,i[11]=M,i[12]=N):N=i[12],N}async function m(e){try{let t=new URL(e,window.location.origin);await fetch(t.pathname+t.search,{headers:{Accept:`text/x-component`},priority:`low`})}catch(e){console.warn(`[rari] Prefetch failed:`,e)}}function h(){window.dispatchEvent(new CustomEvent(`rari:app-router-rerender`))}function g(){window.history.forward()}function _(){window.history.back()}function v(){return typeof window<`u`?new URLSearchParams(window.location.search):new URLSearchParams}function y(){let e=a(f);if(!e)throw Error(`useRouter must be used within a RouterProvider`);return e}function b(){return y().pathname}function x(){return y().params}function S(){return y().searchParams}export{S as a,y as i,x as n,b as r,p as t};
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
- //#region src/runtime/boundaries/loading-error-boundary.d.ts
3
- interface LoadingErrorBoundaryProps {
4
- children: React.ReactNode;
5
- }
6
- declare class LoadingErrorBoundary extends React.Component<LoadingErrorBoundaryProps> {
7
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
8
- render(): React.ReactNode;
9
- }
10
- //#endregion
11
- export { LoadingErrorBoundary };
@@ -1 +0,0 @@
1
- "use client";import*as e from"react";var t=class extends e.Component{componentDidCatch(e,t){console.error(`[rari] Loading: Loading component failed to render:`,e),console.error(`[rari] Loading: Error info:`,t)}render(){return this.props.children}};export{t as LoadingErrorBoundary};
@@ -1,7 +0,0 @@
1
- import{p as e}from"./type-guards-CTkEL8zw.mjs";import{o as t,t as n}from"./alias-resolver-Cigam7Y7.mjs";import{t as r}from"./xml-N8OZmN7u.mjs";import{Buffer as i}from"node:buffer";import{promises as a}from"node:fs";import o from"node:path";const s=/[^\w-]/g,c=`\0virtual:sitemap`;function l(e){return(typeof e==`string`?new Date(e):e).toISOString()}function u(e){return[` <image:image>`,` <image:loc>${r(e)}</image:loc>`,` </image:image>`].join(`
2
- `)}function d(e){let t=[` <image:image>`,` <image:loc>${r(e.loc)}</image:loc>`];return e.title!=null&&e.title!==``&&t.push(` <image:title>${r(e.title)}</image:title>`),e.caption!=null&&e.caption!==``&&t.push(` <image:caption>${r(e.caption)}</image:caption>`),e.geoLocation!=null&&e.geoLocation!==``&&t.push(` <image:geo_location>${r(e.geoLocation)}</image:geo_location>`),e.license!=null&&e.license!==``&&t.push(` <image:license>${r(e.license)}</image:license>`),t.push(` </image:image>`),t.join(`
3
- `)}function f(e){let t=[];for(let n of e)typeof n==`string`?t.push(u(n)):t.push(d(n));return t.join(`
4
- `)}function p(e){let t=[];if(t.push(` <video:video>`),t.push(` <video:title>${r(e.title)}</video:title>`),t.push(` <video:thumbnail_loc>${r(e.thumbnail_loc)}</video:thumbnail_loc>`),t.push(` <video:description>${r(e.description)}</video:description>`),e.content_loc!=null&&e.content_loc!==``&&t.push(` <video:content_loc>${r(e.content_loc)}</video:content_loc>`),e.player_loc!=null&&e.player_loc!==``&&t.push(` <video:player_loc>${r(e.player_loc)}</video:player_loc>`),e.duration!==void 0&&t.push(` <video:duration>${e.duration}</video:duration>`),e.expiration_date!=null&&e.expiration_date!==``&&t.push(` <video:expiration_date>${r(e.expiration_date)}</video:expiration_date>`),e.rating!==void 0&&t.push(` <video:rating>${e.rating}</video:rating>`),e.view_count!==void 0&&t.push(` <video:view_count>${e.view_count}</video:view_count>`),e.publication_date!=null&&e.publication_date!==``&&t.push(` <video:publication_date>${r(e.publication_date)}</video:publication_date>`),e.family_friendly!==void 0&&t.push(` <video:family_friendly>${e.family_friendly?`yes`:`no`}</video:family_friendly>`),e.requires_subscription!==void 0&&t.push(` <video:requires_subscription>${e.requires_subscription?`yes`:`no`}</video:requires_subscription>`),e.live!==void 0&&t.push(` <video:live>${e.live?`yes`:`no`}</video:live>`),e.restriction&&t.push(` <video:restriction relationship="${r(e.restriction.relationship)}">${r(e.restriction.content)}</video:restriction>`),e.platform&&t.push(` <video:platform relationship="${r(e.platform.relationship)}">${r(e.platform.content)}</video:platform>`),e.uploader){let n=e.uploader.info!=null&&e.uploader.info!==``?` info="${r(e.uploader.info)}"`:``;t.push(` <video:uploader${n}>${r(e.uploader.name)}</video:uploader>`)}if(e.tag)for(let n of e.tag)t.push(` <video:tag>${r(n)}</video:tag>`);return t.push(` </video:video>`),t.join(`
5
- `)}function m(e){return e.map(e=>p(e)).join(`
6
- `)}function h(e){let t=e.some(e=>e.images&&e.images.length>0),n=e.some(e=>e.videos&&e.videos.length>0),r=e.some(e=>e.alternates?.languages),i=[`xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"`];return t&&i.push(`xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"`),n&&i.push(`xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"`),r&&i.push(`xmlns:xhtml="http://www.w3.org/1999/xhtml"`),i}function g(e,t){e.push(` <url>`),e.push(` <loc>${r(t.url)}</loc>`),t.lastModified!=null&&e.push(` <lastmod>${l(t.lastModified)}</lastmod>`),t.changeFrequency&&e.push(` <changefreq>${t.changeFrequency}</changefreq>`),t.priority!==void 0&&e.push(` <priority>${t.priority}</priority>`)}function _(e,t){if(t.alternates?.languages)for(let[n,i]of Object.entries(t.alternates.languages))e.push(` <xhtml:link rel="alternate" hreflang="${r(n)}" href="${r(i)}" />`)}function v(e,t){t.images&&t.images.length>0&&e.push(f(t.images)),t.videos&&t.videos.length>0&&e.push(m(t.videos))}function y(e){let t=[`<?xml version="1.0" encoding="UTF-8"?>`,`<urlset ${h(e).join(` `)}>`];for(let n of e)g(t,n),_(t,n),v(t,n),t.push(` </url>`);return t.push(`</urlset>`),t.join(`
7
- `)}async function b(e,t=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.json`]){let n=[],r=o.join(e,`sitemap.xml`);try{return await a.access(r),n.push({type:`static`,path:r}),n}catch{}for(let r of t){let t=o.join(e,`sitemap${r}`);try{return await a.access(t),n.push({type:`dynamic`,path:t}),n}catch{}}return n}function x(e){switch(e){case`ts`:return`ts`;case`tsx`:return`tsx`;case`js`:case`mjs`:return`js`;case`jsx`:return`jsx`;case`json`:return`json`;default:throw Error(`Unsupported sitemap file extension: ".${e}". Allowed extensions are: .ts, .tsx, .js, .jsx, .mjs, .json`)}}function S(e,r,i={},s){return{name:`virtual-sitemap`,resolveId(r,a){if(r===c)return r;if(Object.keys(i).length>0){let e=n(r,i,s);if(e!=null&&e!==``){let n=t(e);return n!=null&&n!==``?n:e}}if(r.startsWith(`.`)){let n=a==null||a===``||a.startsWith(`\0`)?e.path:a,i=o.resolve(o.dirname(n),r),s=t(i);return s!=null&&s!==``?s:i}return null},async load(t){if(t===c)return{code:r,moduleType:x(o.extname(e.path).slice(1))};if(t&&!t.startsWith(`\0`))try{return{code:await a.readFile(t,`utf-8`),moduleType:x(o.extname(t).slice(1))}}catch{return null}return null}}}function C(e){if(e.output.length===0)throw Error(`Failed to build sitemap module`);let t=e.output.find(e=>e.type===`chunk`&&e.isEntry)??e.output.find(e=>e.type===`chunk`);if(t?.type!==`chunk`)throw Error(`No chunk output found in sitemap build result`);return t.code}function w(e){return typeof e==`function`||Array.isArray(e)}function T(t){return e(t)?w(t.default):!1}async function E(e,t,n={},r){let{build:a}=await import(`rolldown`),o=C(await a({input:c,external:[`rari`],platform:`node`,write:!1,output:{format:`esm`,codeSplitting:!1},plugins:[S(e,t,n,r)]})),s=await import(`data:text/javascript;base64,${i.from(o).toString(`base64`)}`);if(!T(s))throw Error(`Sitemap module must export a default sitemap array or sitemap generator function`);return s}async function D(e,t){let n=await e.generateSitemaps(),r=o.join(t,`sitemap`);await a.mkdir(r,{recursive:!0});let i=new Map;for(let{id:t}of n)try{let n=t.replace(s,`_`);(!n||n.length===0)&&(n=`_`);let c=i.get(n);if(c!==void 0)throw Error(`Duplicate sanitized sitemap ID "${n}": original IDs "${c}" and "${t}" collide`);i.set(n,t);let l=typeof e.default==`function`?await e.default({id:t}):e.default;if(!Array.isArray(l))throw Error(`Sitemap default export must resolve to a sitemap entry array`);let u=y(l),d=o.join(r,`${n}.xml`);await a.writeFile(d,u)}catch(e){throw Error(`Failed to generate sitemap for id "${t}"`,{cause:e})}}async function O(e,t){let n=typeof e.default==`function`?await e.default():e.default;if(!Array.isArray(n))throw Error(`Sitemap default export must resolve to a sitemap entry array`);let r=y(n),i=o.join(t,`sitemap.xml`);await a.writeFile(i,r)}async function k(e){let{appDir:t,extensions:n,outDir:r,aliases:i={}}=e,s=await b(t,n);if(s.length===0)return!1;await a.mkdir(r,{recursive:!0});let c=s[0];if(c.type===`static`){let e=o.join(r,`sitemap.xml`);return await a.copyFile(c.path,e),!0}try{let e=await E(c,await a.readFile(c.path,`utf-8`),i,o.dirname(o.dirname(t)));return typeof e.generateSitemaps==`function`?await D(e,r):await O(e,r),!0}catch(e){return console.error(`[rari] Failed to build/execute sitemap file:`,e),!1}}export{k as generateSitemapFiles};
@@ -1 +0,0 @@
1
- function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function t(e){return e instanceof Error&&`code`in e}function n(e){return typeof e==`function`}function r(t){try{let n=JSON.parse(t);return e(n)?n:null}catch{return null}}function i(e){let t=e.packageManager;return typeof t==`string`?t.startsWith(`pnpm`)?`pnpm`:t.startsWith(`yarn`)?`yarn`:t.startsWith(`bun`)?`bun`:t.startsWith(`npm`)?`npm`:null:null}function a(t){let n=e(t.dependencies)?t.dependencies:{},r=e(t.devDependencies)?t.devDependencies:{},i={...n,...r};return typeof i[`vite-plus`]==`string`?`vp`:typeof i.vite==`string`?`vite`:null}function o(e,t){if(!(e instanceof CustomEvent))return;let n=e.detail;if(t(n))return n}function s(e){return t(e)?e.code:void 0}function c(t,n){let i=r(t);if(!i)return null;let a=i[n];return Array.isArray(a)?a.filter(e):null}function l(t){return Array.isArray(t)?t.every(t=>{if(!e(t))return!1;let{find:n,replacement:r}=t;return(typeof n==`string`||n instanceof RegExp)&&typeof r==`string`}):!1}function u(t){return typeof t==`function`||e(t)&&(`$$typeof`in t||`render`in t)}function d(e){return`type`in e}function f(e){return Array.isArray(e)&&typeof e[0]==`string`}function p(t){return e(t)&&t.$$typeof===Symbol.for(`react.client.reference`)}function m(t){return e(t)&&typeof t.$$id==`string`}function h(e){return e.props}function g(e){return Object.entries(e).flatMap(([e,t])=>typeof t==`string`?[{find:e,replacement:t}]:[])}function _(t){return e(t)&&typeof t.route==`string`&&typeof t.navigationId==`number`&&typeof t.timestamp==`number`&&typeof t.key==`string`}function v(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function y(t){return Array.isArray(t)?t.every(t=>e(t)?Object.values(t).every(e=>typeof e==`string`||v(e)):!1):!1}function b(e){console.warn(`[rari] generateStaticParams() in ${e} returned invalid params. Expected Array<Record<string, string | string[]>> (e.g. [{ slug: "post" }]). Static routes for this page will not be generated.`)}export{i as _,m as a,u as c,_ as d,d as f,r as g,c as h,h as i,f as l,y as m,o as n,l as o,e as p,s as r,p as s,g as t,n as u,a as v,b as y};
@@ -1,199 +0,0 @@
1
- import { ReactNode } from "react";
2
- //#region src/router/build/types.d.ts
3
- type RouteSegmentType = 'static' | 'dynamic' | 'catch-all' | 'optional-catch-all';
4
- interface RouteSegment {
5
- type: RouteSegmentType;
6
- value: string;
7
- param?: string;
8
- }
9
- interface AppRouteEntry {
10
- path: string;
11
- filePath: string;
12
- css?: string[];
13
- componentId?: string;
14
- segments: RouteSegment[];
15
- params: string[];
16
- isDynamic: boolean;
17
- metadata?: RouteMetadata;
18
- staticParams?: Array<Record<string, string | string[]>>;
19
- }
20
- interface LayoutEntry {
21
- path: string;
22
- filePath: string;
23
- css?: string[];
24
- componentId?: string;
25
- parentPath?: string;
26
- additionalPaths?: string[];
27
- }
28
- interface LoadingEntry {
29
- path: string;
30
- filePath: string;
31
- css?: string[];
32
- componentId?: string;
33
- additionalPaths?: string[];
34
- }
35
- interface ErrorEntry {
36
- path: string;
37
- filePath: string;
38
- css?: string[];
39
- componentId?: string;
40
- additionalPaths?: string[];
41
- }
42
- interface NotFoundEntry {
43
- path: string;
44
- filePath: string;
45
- css?: string[];
46
- componentId?: string;
47
- additionalPaths?: string[];
48
- }
49
- interface OgImageEntry {
50
- path: string;
51
- filePath: string;
52
- width?: number;
53
- height?: number;
54
- contentType?: string;
55
- additionalPaths?: string[];
56
- }
57
- interface ApiRouteEntry {
58
- path: string;
59
- filePath: string;
60
- segments: RouteSegment[];
61
- params: string[];
62
- isDynamic: boolean;
63
- methods: string[];
64
- }
65
- interface TemplateEntry {
66
- path: string;
67
- filePath: string;
68
- css?: string[];
69
- componentId?: string;
70
- parentPath?: string;
71
- additionalPaths?: string[];
72
- }
73
- interface AppRouteManifest {
74
- routes: AppRouteEntry[];
75
- layouts: LayoutEntry[];
76
- loading: LoadingEntry[];
77
- errors: ErrorEntry[];
78
- notFound: NotFoundEntry[];
79
- templates: TemplateEntry[];
80
- apiRoutes: ApiRouteEntry[];
81
- ogImages: OgImageEntry[];
82
- generated: string;
83
- }
84
- interface RouteMetadata {
85
- title?: string | {
86
- default?: string;
87
- template?: string;
88
- absolute?: string;
89
- };
90
- description?: string;
91
- keywords?: string | string[];
92
- openGraph?: {
93
- title?: string;
94
- description?: string;
95
- images?: string[] | Array<{
96
- url: string;
97
- width?: number;
98
- height?: number;
99
- alt?: string;
100
- }>;
101
- url?: string;
102
- siteName?: string;
103
- locale?: string;
104
- type?: string;
105
- };
106
- twitter?: {
107
- card?: 'summary' | 'summary_large_image' | 'app' | 'player';
108
- title?: string;
109
- description?: string;
110
- images?: string[] | Array<{
111
- url: string;
112
- alt?: string;
113
- }>;
114
- site?: string;
115
- creator?: string;
116
- };
117
- robots?: {
118
- index?: boolean;
119
- follow?: boolean;
120
- noarchive?: boolean;
121
- nosnippet?: boolean;
122
- noimageindex?: boolean;
123
- nocache?: boolean;
124
- } | string;
125
- icons?: {
126
- icon?: string | Array<{
127
- url: string;
128
- type?: string;
129
- sizes?: string;
130
- }>;
131
- shortcut?: string;
132
- apple?: string | Array<{
133
- url: string;
134
- sizes?: string;
135
- type?: string;
136
- }>;
137
- };
138
- manifest?: string;
139
- themeColor?: string | Array<{
140
- media?: string;
141
- color: string;
142
- }>;
143
- viewport?: string | {
144
- width?: string | number;
145
- height?: string | number;
146
- initialScale?: number;
147
- minimumScale?: number;
148
- maximumScale?: number;
149
- userScalable?: boolean;
150
- };
151
- appleWebApp?: {
152
- capable?: boolean;
153
- title?: string;
154
- statusBarStyle?: 'default' | 'black' | 'black-translucent';
155
- };
156
- canonical?: string;
157
- alternates?: {
158
- canonical?: string;
159
- languages?: Record<string, string>;
160
- types?: Record<string, string>;
161
- };
162
- }
163
- type Metadata = RouteMetadata;
164
- interface RouteParams {
165
- readonly [key: string]: string | readonly string[];
166
- }
167
- interface SearchParams {
168
- readonly [key: string]: string | readonly string[] | undefined;
169
- }
170
- type PageProps<TParams extends RouteParams = RouteParams, TSearchParams extends SearchParams = SearchParams> = Readonly<{
171
- params: TParams;
172
- searchParams: TSearchParams;
173
- }>;
174
- type LayoutProps<TParams extends RouteParams = RouteParams> = Readonly<{
175
- children: ReactNode;
176
- params?: TParams;
177
- pathname?: string;
178
- }>;
179
- interface ErrorProps {
180
- readonly error: Error;
181
- readonly reset: () => void;
182
- }
183
- interface AppRouteMatch {
184
- readonly route: AppRouteEntry;
185
- readonly params: RouteParams;
186
- readonly searchParams: SearchParams;
187
- readonly layouts: readonly LayoutEntry[];
188
- readonly loading?: LoadingEntry;
189
- readonly error?: ErrorEntry;
190
- readonly templates: readonly TemplateEntry[];
191
- readonly pathname: string;
192
- }
193
- type GenerateMetadata<TParams extends RouteParams = RouteParams, TSearchParams extends SearchParams = SearchParams> = (props: Readonly<{
194
- params: TParams;
195
- searchParams: TSearchParams;
196
- }>) => RouteMetadata | Promise<RouteMetadata>;
197
- type GenerateStaticParams<TParams extends RouteParams = RouteParams> = () => TParams[] | Promise<TParams[]>;
198
- //#endregion
199
- export { ErrorProps as a, LayoutEntry as c, Metadata as d, NotFoundEntry as f, TemplateEntry as g, RouteSegmentType as h, ErrorEntry as i, LayoutProps as l, RouteSegment as m, AppRouteManifest as n, GenerateMetadata as o, PageProps as p, AppRouteMatch as r, GenerateStaticParams as s, AppRouteEntry as t, LoadingEntry as u };
@@ -1,37 +0,0 @@
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}`)}const u=/\s+(?:&&\s+)?/,d=/^>=?\s*(\d+)/,f=/^>=?\s*(\d+)\.(\d+)\.(\d+)/,p=/^=?\s*(\d+)\.(\d+)\.(\d+)/,m=/^\^\s*(\d+)\.(\d+)\.(\d+)/,h=/^~\s*(\d+)\.(\d+)\.(\d+)/,g=/^(?:>=?|<=?|[=~^])?\s*(\d+)\.(\d+)/,_=/^(\d+)\.(?:x|\*)/i,v=/^(?:>=?|[=~^])\s*(\d+)(?:\s|$)/,y=/^(\d+)$/;function b(e){return typeof e==`object`&&!!e}function x(e){let t=JSON.parse(e);if(!b(t))throw Error(`Invalid package.json`);return t}function S(e,t=`>=22.18.0`){if(e.engines=e.engines??{},e.engines.node){if(!C(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 C(e,t){let n=w(e),r=w(t);return!n||!r?!1:T(n,r)>=0}function w(e){let t=e.trim(),n=e=>e!==null;if(t.includes(`||`)){let e=t.split(`||`).map(e=>e.trim()).map(e=>w(e)).filter(n);return e.length===0?null:e.reduce((e,t)=>T(t,e)<0?t:e)}let r=t.split(u).filter(e=>e!==``&&e!==`&&`);if(r.length>1){let e=r.filter(e=>d.test(e)).map(e=>w(e)).filter(n);return e.length===0?null:e.reduce((e,t)=>T(t,e)>0?t:e)}let i=null;return i=f.exec(t),i||(i=p.exec(t),i)||(i=m.exec(t),i)||(i=h.exec(t),i)?{major:Number.parseInt(i[1],10),minor:Number.parseInt(i[2],10),patch:Number.parseInt(i[3],10)}:(i=g.exec(t),i?{major:Number.parseInt(i[1],10),minor:Number.parseInt(i[2],10),patch:0}:(i=_.exec(t),i||(i=v.exec(t),i)||(i=y.exec(t),i)?{major:Number.parseInt(i[1],10),minor:0,patch:0}:null))}function T(e,t){return e.major===t.major?e.minor===t.minor?e.patch-t.patch:e.minor-t.minor:e.major-t.major}function E(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=x(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: ${e instanceof Error?e.message:`Unknown error`}`),i.exit(1),``}}function D(a,u){let d=r(a,`package.json`);e(d)||(c(`No package.json found. Please run this command from your project root.`),i.exit(1));try{let e=x(t(d,`utf-8`));e.scripts=e.scripts??{};let r=u.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:${u.providerName.toLowerCase()}`]=u.deployScript,S(e),(e.dependencies?.rari==null||e.dependencies.rari===``)&&(o(`Adding rari dependency...`),e.dependencies=e.dependencies??{},e.dependencies.rari=u.dependency??E(a)),n(d,`${JSON.stringify(e,null,2)}\n`),s(`Updated package.json for ${u.providerName} deployment`)}catch(e){c(`Failed to update package.json: ${e instanceof Error?e.message:`Unknown error`}`),i.exit(1)}}function O(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 k(a,o,u){let d=r(a,o);try{if(e(d)){let i=t(d,`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(d,u),s(`Created ${o} configuration`)}catch(e){c(`Failed to create or backup ${o}: ${e instanceof Error?e.message:`Unknown error`}`),i.exit(1)}}export{o as a,O as i,E as n,s as o,D as r,k as t};