@coreframe/vite 0.2.13 → 0.2.14

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.
package/client.d.ts CHANGED
@@ -15,6 +15,8 @@ declare module "virtual:coreframe-shell" {
15
15
  export const NativeRouteLink: (
16
16
  props: import("@coreframe/lib/shell").NativeRouteLinkProps,
17
17
  ) => import("react").ReactNode
18
+ export type NativeSurfaceProps = import("@coreframe/flutter-js/composition").NativeSurfaceProps
19
+ export const NativeSurface: (props: NativeSurfaceProps) => import("react").ReactNode
18
20
  export function configureShellClient(): void
19
21
  }
20
22
 
@@ -4,7 +4,7 @@ type FlutterDevToolsHotContext = {
4
4
  on<T>(event: string, listener: (data: T) => void): void;
5
5
  send(event: string, data?: unknown): void;
6
6
  };
7
- /** Connects the shared state-launcher registry to the debug-only Flutter host. */
7
+ /** Connects the shared state-launcher registry to the Flutter development host. */
8
8
  declare function installFlutterDevTools(hot?: FlutterDevToolsHotContext | undefined): () => void;
9
9
  //#endregion
10
10
  export { installFlutterDevTools };
@@ -10,7 +10,7 @@ type MobileRouteLayerMetadata = {
10
10
  stack?: MobileRouteStack;
11
11
  };
12
12
  type NativeRouteRegistration = {
13
- /** Module containing the route's non-DOM controller. */path: string; /** Symbolic Flutter shell transition selected when this route is presented. */
13
+ /** `.native.tsx` module containing the route's non-DOM controller. */path: string; /** Symbolic Flutter shell transition selected when this route is presented. */
14
14
  transitionKey?: string;
15
15
  } & MobileRouteLayerMetadata;
16
16
  type MobileRouteRegistration = {
@@ -1 +1 @@
1
- import{getAppDirectory as e,index as t,layout as n,prefix as r,relative as i,route as a}from"@react-router/dev/routes";const o=`__coreframe_flutter_dom__`,s=`platform`,c=Symbol(`coreframe-route-registration`);function l(e,t,n,r){let i=Array.isArray(n)||n===void 0?void 0:n,o=Array.isArray(n)?n:r,s=i===void 0?void 0:{id:i.id,index:i.index,caseSensitive:i.caseSensitive},l=s===void 0?a(e,t,o):a(e,t,s,o);return i?.native!==void 0&&(l.native=i.native,l[c]={authoredControllerPath:i.native.path}),i?.mobile!==void 0&&(l.mobile=i.mobile),l}function u(e,n){return t(e,n)}function d(e,t,r){return Array.isArray(t)?n(e,t):t===void 0?n(e):n(e,t,r)}function f(e,t){return r(e,t)}function p(e){let t=i(e);return{route(e,n,r,i){let a=l(e,n,r,i);return a.file=t.route(null,n).file,a.native!==void 0&&(a.native={path:t.route(null,a.native.path).file}),a},index(e,n){return t.index(e,n)},layout(e,n,r){return Array.isArray(n)?t.layout(e,n):n===void 0?t.layout(e):t.layout(e,n,r)},prefix:f}}function m(e){if(!Array.isArray(e))throw Error(`Coreframe route config must be an array. Await asynchronous route config before compiling it.`);let t=[],n=[],r=new Map,i=new Map;return{routes:e.map((e,a)=>h(e,`/`,`routes[${a}]`,r,i,t,n)),nativeManifest:t,mobileManifest:n,stacks:_(n)}}function h(e,t,n,r,i,a,o){if(typeof e!=`object`||!e||typeof e.file!=`string`)throw Error(`Invalid Coreframe route registration at ${n}: expected a route helper result.`);if(e.id!==void 0){if(e.id.length===0||e.id.trim()!==e.id)throw Error(`Invalid route id ${JSON.stringify(e.id)} at ${n}: IDs must be non-empty and cannot have surrounding whitespace.`);let t=r.get(e.id);if(t!==void 0)throw Error(`Duplicate route id ${JSON.stringify(e.id)} at ${n}; it is already registered at ${t}.`);r.set(e.id,n)}let s=S(t,e.path);if(e.mobile!==void 0&&e.native!==void 0)throw Error(`Conflicting mobile surface policy for route ${JSON.stringify(e.id)} at ${n}: use either mobile.surface or native, not both.`);if(e.mobile!==void 0&&e.mobile.surface!==`flutter-dom`)throw Error(`Invalid mobile surface policy for route ${JSON.stringify(e.id)} at ${n}: expected "flutter-dom".`);if((e.mobile!==void 0||e.native!==void 0)&&x(e,n),e.native!==void 0){b(e,n);let t=v(e,n),r=e.id,c=C(s),l=i.get(c);if(l!==void 0)throw Error(`Ambiguous native route ${JSON.stringify(r)} at ${n}: canonical path ${JSON.stringify(s)} conflicts with native route ${JSON.stringify(l)}.`);i.set(c,r),a.push({routeId:r,canonicalPath:s,caseSensitive:e.caseSensitive===!0,routeModulePath:e.file,controllerModulePath:e.native.path,transitionKey:t}),o.push({routeId:r,canonicalPath:s,caseSensitive:e.caseSensitive===!0,routeModulePath:e.file,surface:`native`,transitionKey:t,underlayColor:null,...g(e,n)})}else if(e.mobile!==void 0){y(e.mobile.underlayColor,n);let t=v(e,n),r=e.id,a=C(s),c=i.get(a);if(c!==void 0)throw Error(`Ambiguous mobile route ${JSON.stringify(r)} at ${n}: canonical path ${JSON.stringify(s)} conflicts with mobile route ${JSON.stringify(c)}.`);i.set(a,r),o.push({routeId:r,canonicalPath:s,caseSensitive:e.caseSensitive===!0,routeModulePath:e.file,surface:`flutter-dom`,transitionKey:t,underlayColor:e.mobile.underlayColor??null,...g(e,n)})}let c={file:e.file};return`children`in e&&(c.children=e.children?.map((e,t)=>h(e,s,`${n}.children[${t}]`,r,i,a,o))),`path`in e&&(c.path=e.path),`id`in e&&(c.id=e.id),`index`in e&&(c.index=e.index),`caseSensitive`in e&&(c.caseSensitive=e.caseSensitive),c}function g(e,t){let n=e.native??e.mobile;if(n===void 0)return{stackId:null,stackRoot:!1,z:0};let r=n.z??0;if(typeof r!=`number`||!Number.isFinite(r))throw Error(`Invalid mobile route z ${JSON.stringify(r)} for route ${JSON.stringify(e.id)} at ${t}: z must be a finite number.`);let i=n.stack,a=typeof i==`object`?i:void 0,o=typeof i==`string`?i:a?.id,s=a?.root??!1;if(o===void 0&&s)throw Error(`Invalid mobile stack metadata for route ${JSON.stringify(e.id)} at ${t}: stackRoot requires a stack id.`);if(o!==void 0&&(typeof o!=`string`||o.length===0||o.trim()!==o))throw Error(`Invalid mobile stack id ${JSON.stringify(o)} for route ${JSON.stringify(e.id)} at ${t}: IDs must be non-empty and cannot have surrounding whitespace.`);if(typeof s!=`boolean`)throw Error(`Invalid mobile stack root flag for route ${JSON.stringify(e.id)} at ${t}: expected a boolean.`);return{stackId:o??null,stackRoot:s,z:r}}function _(e){let t=new Map;for(let n of e){if(n.stackId===null){if(n.stackRoot)throw Error(`Mobile route ${JSON.stringify(n.routeId)} marks a stack root without a stack.`);continue}let e=t.get(n.stackId)??[];e.push(n),t.set(n.stackId,e)}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{let n=t.filter(e=>e.stackRoot);if(n.length!==1)throw Error(`Mobile stack ${JSON.stringify(e)} must declare exactly one Flutter DOM root route.`);let r=n[0];if(r.surface!==`flutter-dom`)throw Error(`Mobile stack ${JSON.stringify(e)} root route ${JSON.stringify(r.routeId)} must use the Flutter DOM surface.`);return{id:e,rootRouteId:r.routeId,routeIds:t.map(({routeId:e})=>e).sort((e,t)=>e.localeCompare(t))}})}function v(e,t){let n=e.native?.transitionKey??e.mobile?.transitionKey;if(n===void 0)return s;if(typeof n!=`string`||n.length===0||n.trim()!==n)throw Error(`Invalid mobile transition key ${JSON.stringify(n)} for route ${JSON.stringify(e.id)} at ${t}: keys must be non-empty and cannot have surrounding whitespace.`);return n}function y(e,t){if(e!==void 0&&(typeof e!=`string`||!/^#[0-9A-Fa-f]{6}$/.test(e)))throw Error(`Invalid mobile underlay color ${JSON.stringify(e)} at ${t}: expected a solid #RRGGBB color.`)}function b(e,t){x(e,t);let n=e[c]?.authoredControllerPath??e.native?.path;if(typeof n!=`string`||n.trim()!==n||!n.startsWith(`.`)||n.includes(`\\`)||n.includes(`?`)||n.includes(`#`)||!/\.native-page\.(?:ts|tsx)$/.test(n))throw Error(`Invalid native controller path ${JSON.stringify(n)} for route ${JSON.stringify(e.id)} at ${t}: expected a relative *.native-page.ts or *.native-page.tsx module path without query, hash, or backslash characters.`)}function x(e,t){if(e.id===void 0)throw Error(`Mobile route at ${t} (${JSON.stringify(e.file)}) requires an explicit stable id.`);if(e.id===`root`)throw Error(`Mobile route at ${t} cannot use React Router's reserved id "root".`);if(e.id===o)throw Error(`Mobile route at ${t} cannot use Coreframe's reserved Flutter-DOM route id ${JSON.stringify(o)}.`);if(e.path===void 0&&e.index!==!0)throw Error(`Mobile route ${JSON.stringify(e.id)} at ${t} must have an addressable path or be an index route.`)}function S(e,t){if(t===void 0||t===``)return e;let n=(t.startsWith(`/`)?t:`${e===`/`?``:e}/${t}`).replace(/\/{2,}/g,`/`);return n.startsWith(`/`)?n:`/${n}`}function C(e){return e.split(`/`).map(e=>e.startsWith(`:`)?`:${e.endsWith(`?`)?`?`:``}`:e).join(`/`).toLowerCase()}export{s as DEFAULT_MOBILE_TRANSITION_KEY,m as compileRouteRegistrations,e as getAppDirectory,u as index,d as layout,f as prefix,p as relative,l as route};
1
+ import{getAppDirectory as e,index as t,layout as n,prefix as r,relative as i,route as a}from"@react-router/dev/routes";const o=`__coreframe_flutter_dom__`,s=`platform`,c=Symbol(`coreframe-route-registration`);function l(e,t,n,r){let i=Array.isArray(n)||n===void 0?void 0:n,o=Array.isArray(n)?n:r,s=i===void 0?void 0:{id:i.id,index:i.index,caseSensitive:i.caseSensitive},l=s===void 0?a(e,t,o):a(e,t,s,o);return i?.native!==void 0&&(l.native=i.native,l[c]={authoredControllerPath:i.native.path}),i?.mobile!==void 0&&(l.mobile=i.mobile),l}function u(e,n){return t(e,n)}function d(e,t,r){return Array.isArray(t)?n(e,t):t===void 0?n(e):n(e,t,r)}function f(e,t){return r(e,t)}function p(e){let t=i(e);return{route(e,n,r,i){let a=l(e,n,r,i);return a.file=t.route(null,n).file,a.native!==void 0&&(a.native={path:t.route(null,a.native.path).file}),a},index(e,n){return t.index(e,n)},layout(e,n,r){return Array.isArray(n)?t.layout(e,n):n===void 0?t.layout(e):t.layout(e,n,r)},prefix:f}}function m(e){if(!Array.isArray(e))throw Error(`Coreframe route config must be an array. Await asynchronous route config before compiling it.`);let t=[],n=[],r=new Map,i=new Map;return{routes:e.map((e,a)=>h(e,`/`,`routes[${a}]`,r,i,t,n)),nativeManifest:t,mobileManifest:n,stacks:_(n)}}function h(e,t,n,r,i,a,o){if(typeof e!=`object`||!e||typeof e.file!=`string`)throw Error(`Invalid Coreframe route registration at ${n}: expected a route helper result.`);if(e.id!==void 0){if(e.id.length===0||e.id.trim()!==e.id)throw Error(`Invalid route id ${JSON.stringify(e.id)} at ${n}: IDs must be non-empty and cannot have surrounding whitespace.`);let t=r.get(e.id);if(t!==void 0)throw Error(`Duplicate route id ${JSON.stringify(e.id)} at ${n}; it is already registered at ${t}.`);r.set(e.id,n)}let s=S(t,e.path);if(e.mobile!==void 0&&e.native!==void 0)throw Error(`Conflicting mobile surface policy for route ${JSON.stringify(e.id)} at ${n}: use either mobile.surface or native, not both.`);if(e.mobile!==void 0&&e.mobile.surface!==`flutter-dom`)throw Error(`Invalid mobile surface policy for route ${JSON.stringify(e.id)} at ${n}: expected "flutter-dom".`);if((e.mobile!==void 0||e.native!==void 0)&&x(e,n),e.native!==void 0){b(e,n);let t=v(e,n),r=e.id,c=C(s),l=i.get(c);if(l!==void 0)throw Error(`Ambiguous native route ${JSON.stringify(r)} at ${n}: canonical path ${JSON.stringify(s)} conflicts with native route ${JSON.stringify(l)}.`);i.set(c,r),a.push({routeId:r,canonicalPath:s,caseSensitive:e.caseSensitive===!0,routeModulePath:e.file,controllerModulePath:e.native.path,transitionKey:t}),o.push({routeId:r,canonicalPath:s,caseSensitive:e.caseSensitive===!0,routeModulePath:e.file,surface:`native`,transitionKey:t,underlayColor:null,...g(e,n)})}else if(e.mobile!==void 0){y(e.mobile.underlayColor,n);let t=v(e,n),r=e.id,a=C(s),c=i.get(a);if(c!==void 0)throw Error(`Ambiguous mobile route ${JSON.stringify(r)} at ${n}: canonical path ${JSON.stringify(s)} conflicts with mobile route ${JSON.stringify(c)}.`);i.set(a,r),o.push({routeId:r,canonicalPath:s,caseSensitive:e.caseSensitive===!0,routeModulePath:e.file,surface:`flutter-dom`,transitionKey:t,underlayColor:e.mobile.underlayColor??null,...g(e,n)})}let c={file:e.file};return`children`in e&&(c.children=e.children?.map((e,t)=>h(e,s,`${n}.children[${t}]`,r,i,a,o))),`path`in e&&(c.path=e.path),`id`in e&&(c.id=e.id),`index`in e&&(c.index=e.index),`caseSensitive`in e&&(c.caseSensitive=e.caseSensitive),c}function g(e,t){let n=e.native??e.mobile;if(n===void 0)return{stackId:null,stackRoot:!1,z:0};let r=n.z??0;if(typeof r!=`number`||!Number.isFinite(r))throw Error(`Invalid mobile route z ${JSON.stringify(r)} for route ${JSON.stringify(e.id)} at ${t}: z must be a finite number.`);let i=n.stack,a=typeof i==`object`?i:void 0,o=typeof i==`string`?i:a?.id,s=a?.root??!1;if(o===void 0&&s)throw Error(`Invalid mobile stack metadata for route ${JSON.stringify(e.id)} at ${t}: stackRoot requires a stack id.`);if(o!==void 0&&(typeof o!=`string`||o.length===0||o.trim()!==o))throw Error(`Invalid mobile stack id ${JSON.stringify(o)} for route ${JSON.stringify(e.id)} at ${t}: IDs must be non-empty and cannot have surrounding whitespace.`);if(typeof s!=`boolean`)throw Error(`Invalid mobile stack root flag for route ${JSON.stringify(e.id)} at ${t}: expected a boolean.`);return{stackId:o??null,stackRoot:s,z:r}}function _(e){let t=new Map;for(let n of e){if(n.stackId===null){if(n.stackRoot)throw Error(`Mobile route ${JSON.stringify(n.routeId)} marks a stack root without a stack.`);continue}let e=t.get(n.stackId)??[];e.push(n),t.set(n.stackId,e)}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{let n=t.filter(e=>e.stackRoot);if(n.length!==1)throw Error(`Mobile stack ${JSON.stringify(e)} must declare exactly one Flutter DOM root route.`);let r=n[0];if(r.surface!==`flutter-dom`)throw Error(`Mobile stack ${JSON.stringify(e)} root route ${JSON.stringify(r.routeId)} must use the Flutter DOM surface.`);return{id:e,rootRouteId:r.routeId,routeIds:t.map(({routeId:e})=>e).sort((e,t)=>e.localeCompare(t))}})}function v(e,t){let n=e.native?.transitionKey??e.mobile?.transitionKey;if(n===void 0)return s;if(typeof n!=`string`||n.length===0||n.trim()!==n)throw Error(`Invalid mobile transition key ${JSON.stringify(n)} for route ${JSON.stringify(e.id)} at ${t}: keys must be non-empty and cannot have surrounding whitespace.`);return n}function y(e,t){if(e!==void 0&&(typeof e!=`string`||!/^#[0-9A-Fa-f]{6}$/.test(e)))throw Error(`Invalid mobile underlay color ${JSON.stringify(e)} at ${t}: expected a solid #RRGGBB color.`)}function b(e,t){x(e,t);let n=e[c]?.authoredControllerPath??e.native?.path;if(typeof n!=`string`||n.trim()!==n||!n.startsWith(`.`)||n.includes(`\\`)||n.includes(`?`)||n.includes(`#`)||!n.endsWith(`.native.tsx`))throw Error(`Invalid native controller path ${JSON.stringify(n)} for route ${JSON.stringify(e.id)} at ${t}: expected a relative *.native.tsx module path without query, hash, or backslash characters.`)}function x(e,t){if(e.id===void 0)throw Error(`Mobile route at ${t} (${JSON.stringify(e.file)}) requires an explicit stable id.`);if(e.id===`root`)throw Error(`Mobile route at ${t} cannot use React Router's reserved id "root".`);if(e.id===o)throw Error(`Mobile route at ${t} cannot use Coreframe's reserved Flutter-DOM route id ${JSON.stringify(o)}.`);if(e.path===void 0&&e.index!==!0)throw Error(`Mobile route ${JSON.stringify(e.id)} at ${t} must have an addressable path or be an index route.`)}function S(e,t){if(t===void 0||t===``)return e;let n=(t.startsWith(`/`)?t:`${e===`/`?``:e}/${t}`).replace(/\/{2,}/g,`/`);return n.startsWith(`/`)?n:`/${n}`}function C(e){return e.split(`/`).map(e=>e.startsWith(`:`)?`:${e.endsWith(`?`)?`?`:``}`:e).join(`/`).toLowerCase()}export{s as DEFAULT_MOBILE_TRANSITION_KEY,m as compileRouteRegistrations,e as getAppDirectory,u as index,d as layout,f as prefix,p as relative,l as route};
@@ -1 +1 @@
1
- import{resolveCoreframeHost as e,resolveCoreframePlatform as t}from"./index.js";import{realpathSync as n}from"node:fs";import{extname as r,isAbsolute as i,relative as a,resolve as o,sep as s}from"node:path";import{parseSync as c}from"vite";const l=`virtual:coreframe-shell`,u=`\0${l}`,d=`virtual:coreframe-shell/composition`,f=`virtual:coreframe-shell/auth`,p=`\0${f}`,m=`virtual:coreframe-shell/auth-composition`,h=`virtual:coreframe-router`,g=`\0${h}`,_=`virtual:coreframe-router/composition`,v={browser:{auth:`@coreframe/lib/auth-transport/browser`,router:`react-router`,shell:`@coreframe/lib/shell/dom`},flutter:{auth:`@coreframe/flutter-js/client`,router:`@coreframe/flutter-js/router`,shell:`@coreframe/flutter-js/composition`},tauri:{auth:`./src/api/client/tauri-auth.ts`,router:`react-router`,shell:`@coreframe/lib/shell/dom`}};function y(){let n=t(),r=e(process.env,n),i=v[r],a=b(i.shell),s=process.cwd();return{name:`coreframe:shell`,enforce:`pre`,config(){return{define:{"import.meta.env.PLATFORM":JSON.stringify(n)},ssr:{noExternal:[a]}}},configResolved(e){s=e.root},transform(e,t){let n=x(t);if(r!==`flutter`||!w(t,s)||n===void 0)return;let{module:i}=c(t,e,{lang:n});(i.staticImports.some(({moduleRequest:e})=>e.value===`react-router`)||i.staticExports.some(({entries:e})=>e.some(({moduleRequest:e})=>e?.value===`react-router`))||i.dynamicImports.some(({moduleRequest:t})=>S(e.slice(t.start,t.end))))&&C()},resolveId(e){if(e===l)return u;if(e===f)return p;if(e===h)return g;if(e===d)return this.resolve(i.shell,o(s,`vite.config.ts`),{skipSelf:!0});if(e===m)return this.resolve(i.auth,o(s,`vite.config.ts`),{skipSelf:!0});if(e===_)return this.resolve(i.router,o(s,`vite.config.ts`),{skipSelf:!0});if(e===`virtual:coreframe-flutter/application`)return this.resolve(o(s,`src/web/app/flutter-shell/application.ts`),void 0,{skipSelf:!0});if(e===`virtual:coreframe-flutter/native-bridge`)return this.resolve(o(s,`src/web/app/flutter-shell/generated/native-bridge.ts`),void 0,{skipSelf:!0});if(e===`virtual:coreframe-flutter/native-pages`)return this.resolve(o(s,`src/web/app/flutter-shell/generated/native-pages.ts`),void 0,{skipSelf:!0})},load(e){if(e===u)return`export * from ${JSON.stringify(d)};`;if(e===p)return`export { createAuthenticatedFetch, createAuthClient } from ${JSON.stringify(m)};`;if(e===g)return`export * from ${JSON.stringify(_)};`}}}function b(e){let t=e.split(`/`);return e.startsWith(`@`)?t.slice(0,2).join(`/`):t[0]}function x(e){let t=r(e.split(`?`,1)[0]);if(t===`.jsx`)return`jsx`;if(t===`.ts`||t===`.mts`||t===`.cts`)return`ts`;if(t===`.tsx`)return`tsx`;if(t===`.js`||t===`.mjs`||t===`.cjs`)return`js`}function S(e){return e===`"react-router"`||e===`'react-router'`||e==="`react-router`"}function C(){throw Error(`Flutter application modules must import React Router APIs from ${JSON.stringify(h)}; direct ${JSON.stringify(`react-router`)} imports bypass the native navigation contract. Importing ${JSON.stringify(`react-router/dom`)} remains supported.`)}function w(e,t){let r=e.split(`?`,1)[0];if(!i(r))return!1;let o=a(n(t),n(r)),c=o.split(s);return o!==``&&o!==`..`&&!o.startsWith(`..${s}`)&&!i(o)&&!c.includes(`node_modules`)&&c[0]!==`.react-router`}export{y as coreframeShellPlugin};
1
+ import{resolveCoreframeHost as e,resolveCoreframePlatform as t}from"./index.js";import{realpathSync as n}from"node:fs";import{extname as r,isAbsolute as i,relative as a,resolve as o,sep as s}from"node:path";import{parseSync as c}from"vite";const l=`virtual:coreframe-shell`,u=`\0${l}`,d=`virtual:coreframe-shell/composition`,f=`virtual:coreframe-shell/auth`,p=`\0${f}`,m=`virtual:coreframe-shell/auth-composition`,h=`virtual:coreframe-router`,g=`\0${h}`,_=`virtual:coreframe-router/composition`,v={browser:{auth:`@coreframe/lib/auth-transport/browser`,router:`react-router`,shell:`@coreframe/lib/shell/dom`},flutter:{auth:`@coreframe/flutter-js/client`,router:`@coreframe/flutter-js/router`,shell:`@coreframe/flutter-js/composition`},tauri:{auth:`./src/api/client/tauri-auth.ts`,router:`react-router`,shell:`@coreframe/lib/shell/dom`}};function y(){let n=t(),r=e(process.env,n),i=v[r],a=b(i.shell),s=process.cwd();return{name:`coreframe:shell`,enforce:`pre`,config(){return{define:{"import.meta.env.PLATFORM":JSON.stringify(n)},ssr:{noExternal:[a]}}},configResolved(e){s=e.root},transform(e,t){let n=x(t);if(r!==`flutter`||!w(t,s)||n===void 0)return;let{module:i}=c(t,e,{lang:n});(i.staticImports.some(({moduleRequest:e})=>e.value===`react-router`)||i.staticExports.some(({entries:e})=>e.some(({moduleRequest:e})=>e?.value===`react-router`))||i.dynamicImports.some(({moduleRequest:t})=>S(e.slice(t.start,t.end))))&&C()},resolveId(e){if(e===l)return u;if(e===f)return p;if(e===h)return g;if(e===d)return this.resolve(i.shell,o(s,`vite.config.ts`),{skipSelf:!0});if(e===m)return this.resolve(i.auth,o(s,`vite.config.ts`),{skipSelf:!0});if(e===_)return this.resolve(i.router,o(s,`vite.config.ts`),{skipSelf:!0});if(e===`virtual:coreframe-flutter/application`)return this.resolve(o(s,`src/web/app/flutter-shell/application.ts`),void 0,{skipSelf:!0});if(e===`virtual:coreframe-flutter/native-bridge`)return this.resolve(o(s,`src/web/app/flutter-shell/generated/native-bridge.ts`),void 0,{skipSelf:!0});if(e===`virtual:coreframe-flutter/native-pages`)return this.resolve(o(s,`src/web/app/flutter-shell/generated/native-pages.ts`),void 0,{skipSelf:!0});if(e===`virtual:coreframe-flutter/native-surfaces`)return this.resolve(o(s,`src/web/app/flutter-shell/generated/native-surfaces.ts`),void 0,{skipSelf:!0})},load(e){if(e===u)return`export * from ${JSON.stringify(d)};`;if(e===p)return`export { createAuthenticatedFetch, createAuthClient } from ${JSON.stringify(m)};`;if(e===g)return`export * from ${JSON.stringify(_)};`}}}function b(e){let t=e.split(`/`);return e.startsWith(`@`)?t.slice(0,2).join(`/`):t[0]}function x(e){let t=r(e.split(`?`,1)[0]);if(t===`.jsx`)return`jsx`;if(t===`.ts`||t===`.mts`||t===`.cts`)return`ts`;if(t===`.tsx`)return`tsx`;if(t===`.js`||t===`.mjs`||t===`.cjs`)return`js`}function S(e){return e===`"react-router"`||e===`'react-router'`||e==="`react-router`"}function C(){throw Error(`Flutter application modules must import React Router APIs from ${JSON.stringify(h)}; direct ${JSON.stringify(`react-router`)} imports bypass the native navigation contract. Importing ${JSON.stringify(`react-router/dom`)} remains supported.`)}function w(e,t){let r=e.split(`?`,1)[0];if(!i(r))return!1;let o=a(n(t),n(r)),c=o.split(s);return o!==``&&o!==`..`&&!o.startsWith(`..${s}`)&&!i(o)&&!c.includes(`node_modules`)&&c[0]!==`.react-router`}export{y as coreframeShellPlugin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/vite",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Vite plugins and build integrations for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -61,14 +61,14 @@
61
61
  "obug": "^2.1.3",
62
62
  "unplugin": "^2.3.11",
63
63
  "vite-plugin-hashed-favicons": "^2.1.1",
64
- "@coreframe/config": "^0.1.4",
65
- "@coreframe/dev": "^0.1.7",
64
+ "@coreframe/assets": "^0.1.8",
65
+ "@coreframe/config": "^0.1.5",
66
+ "@coreframe/dashboard": "^0.3.5",
66
67
  "@coreframe/dev-contracts": "^0.1.3",
67
- "@coreframe/flutter-js": "^0.1.11",
68
- "@coreframe/flutter-tools": "^0.1.9",
69
- "@coreframe/assets": "^0.1.7",
70
- "@coreframe/dashboard": "^0.3.4",
71
- "@coreframe/lib": "^0.2.4"
68
+ "@coreframe/flutter-js": "^0.1.12",
69
+ "@coreframe/flutter-tools": "^0.1.10",
70
+ "@coreframe/lib": "^0.2.5",
71
+ "@coreframe/dev": "^0.1.8"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@tsdown/css": "0.22.3",