@mindees/router 0.22.0 → 0.22.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"file-routes.d.ts","names":[],"sources":["../src/file-routes.ts"],"mappings":";;;;;;;;;;;UAoCiB,WAAA;EACf,OAAA,GAAU,SAAA,CAAU,mBAAA;EACpB,MAAA,GAAS,QAAA;EACT,UAAA,GAAa,YAAA;EACb,YAAA,GAAe,gBAAA,UAA0B,MAAA;EACzC,SAAA;EACA,IAAA,GAAO,QAAA,CAAS,MAAA;AAAA;;;;;iBAgHF,iBAAA,CAAkB,OAAA,EAAS,MAAA,SAAe,WAAA,IAAe,WAAA;;;;;;;;AAAW;iBAkBpE,gBAAA,CACd,OAAA,EAAS,MAAA,SAAe,WAAA,GACxB,OAAA,GAAS,IAAA,CAAK,mBAAA,cACb,MAAA"}
1
+ {"version":3,"file":"file-routes.d.ts","names":[],"sources":["../src/file-routes.ts"],"mappings":";;;;;;;;;;;UAoCiB,WAAA;EACf,OAAA,GAAU,SAAA,CAAU,mBAAA;EACpB,MAAA,GAAS,QAAA;EACT,UAAA,GAAa,YAAA;EACb,YAAA,GAAe,gBAAA,UAA0B,MAAA;EACzC,SAAA;EACA,IAAA,GAAO,QAAA,CAAS,MAAA;AAAA;;;;;iBAkHF,iBAAA,CAAkB,OAAA,EAAS,MAAA,SAAe,WAAA,IAAe,WAAA;;;;;;;;AAAW;iBAkBpE,gBAAA,CACd,OAAA,EAAS,MAAA,SAAe,WAAA,GACxB,OAAA,GAAS,IAAA,CAAK,mBAAA,cACb,MAAA"}
@@ -70,7 +70,7 @@ function nodeToRoutes(node) {
70
70
  for (const file of node.files) routes.push(recordFrom(segmentToPath(file.seg), file.module));
71
71
  for (const [dirName, child] of node.dirs) {
72
72
  const childRoutes = nodeToRoutes(child);
73
- const seg = isGroup(dirName) ? "" : dirName;
73
+ const seg = isGroup(dirName) ? "" : segmentToPath(dirName);
74
74
  if (child.layout) routes.push(recordFrom(seg, child.layout, childRoutes));
75
75
  else if (seg === "") routes.push(...childRoutes);
76
76
  else routes.push({
@@ -1 +1 @@
1
- {"version":3,"file":"file-routes.js","names":[],"sources":["../src/file-routes.ts"],"sourcesContent":["/**\n * File-based routing for Quantum — turn a map of route modules into a router, with\n * the same conventions Expo Router uses so the structure is instantly familiar, but\n * feeding Quantum's better core (validated/typed params, loaders, re-render isolation).\n *\n * A *module map* is `{ [filePath]: RouteModule }` where each module's `default` export\n * is the screen and named exports (`loader`, `searchSchema`, …) configure the route.\n * The map comes from your bundler's glob (web: `import.meta.glob('./app/**', { eager:true })`)\n * or a generated table (native) — either way you never hand-write a route config.\n *\n * Conventions (file path → route):\n * - `index` → the directory's path (`index.tsx` → `/`)\n * - `[param]` → a dynamic segment (`:param`); `[...rest]` → a catch-all (`:rest*`)\n * - `(group)` → a layout group that does not affect the URL\n * - `_layout` → a layout route that wraps the directory's routes (render its outlet)\n * - `+not-found` → the fallback route for unmatched paths\n *\n * @module\n */\n\nimport type { Component } from '@mindees/core'\nimport type { LoaderDepsFn, LoaderFn } from './data'\nimport {\n type CreateRouterOptions,\n createRouter,\n type RouteComponentProps,\n type RouteRecord,\n type Router,\n} from './router'\nimport type { StandardSchemaV1 } from './standard-schema'\n\n/**\n * A route module: the `default` export is the screen component; named exports\n * configure the route (mirroring {@link RouteRecord}). A `_layout` module's `default`\n * receives the matched child as `props.children` (the outlet).\n */\nexport interface RouteModule {\n default?: Component<RouteComponentProps>\n loader?: LoaderFn\n loaderDeps?: LoaderDepsFn\n searchSchema?: StandardSchemaV1<unknown, Record<string, unknown>>\n staleTime?: number\n meta?: Readonly<Record<string, unknown>>\n}\n\nconst ROUTE_EXT = /\\.(tsx|ts|jsx|js)$/\n\nfunction isGroup(seg: string): boolean {\n return seg.startsWith('(') && seg.endsWith(')')\n}\n\n/** Convert one path segment to its route form (`index`→``, `[id]`→`:id`, `[...x]`→`:x*`). */\nfunction segmentToPath(seg: string): string {\n if (seg === 'index') return ''\n const rest = seg.match(/^\\[\\.\\.\\.(.+)\\]$/)\n if (rest?.[1]) return `:${rest[1]}*`\n const param = seg.match(/^\\[(.+)\\]$/)\n if (param?.[1]) return `:${param[1]}`\n return seg\n}\n\n/** Build a {@link RouteRecord} from a module, copying only the fields it defines. */\nfunction recordFrom(path: string, mod: RouteModule, children?: RouteRecord[]): RouteRecord {\n const record: { -readonly [K in keyof RouteRecord]?: RouteRecord[K] } = { path }\n if (mod.default) record.component = mod.default\n if (mod.loader) record.loader = mod.loader\n if (mod.loaderDeps) record.loaderDeps = mod.loaderDeps\n if (mod.searchSchema) record.searchSchema = mod.searchSchema\n if (mod.staleTime !== undefined) record.staleTime = mod.staleTime\n if (mod.meta) record.meta = mod.meta\n if (children && children.length > 0) record.children = children\n return record as RouteRecord\n}\n\ninterface DirNode {\n layout?: RouteModule\n files: { seg: string; module: RouteModule }[]\n dirs: Map<string, DirNode>\n}\n\nfunction emptyDir(): DirNode {\n return { files: [], dirs: new Map() }\n}\n\n/** Group the flat module map into a directory tree, pulling out a top-level not-found. */\nfunction buildTree(modules: Record<string, RouteModule>): {\n root: DirNode\n notFound?: RouteModule\n} {\n const root = emptyDir()\n let notFound: RouteModule | undefined\n // Sort keys so output is deterministic regardless of map insertion order.\n for (const rawKey of Object.keys(modules).sort()) {\n // Accept keys relative to the app dir, with optional leading \"./\" or \"app/\".\n const key = rawKey.replace(/^\\.\\//, '').replace(/^app\\//, '')\n const parts = key\n .replace(ROUTE_EXT, '')\n .split('/')\n .filter((s) => s.length > 0)\n if (parts.length === 0) continue\n const filename = parts[parts.length - 1] as string\n const mod = modules[rawKey] as RouteModule\n\n if (filename === '+not-found') {\n notFound = mod\n continue\n }\n\n let node = root\n for (const dir of parts.slice(0, -1)) {\n let next = node.dirs.get(dir)\n if (!next) {\n next = emptyDir()\n node.dirs.set(dir, next)\n }\n node = next\n }\n if (filename === '_layout') node.layout = mod\n else node.files.push({ seg: filename, module: mod })\n }\n return notFound ? { root, notFound } : { root }\n}\n\n/** Convert a directory node into the route records *relative to that node*. */\nfunction nodeToRoutes(node: DirNode): RouteRecord[] {\n const routes: RouteRecord[] = []\n\n for (const file of node.files) {\n routes.push(recordFrom(segmentToPath(file.seg), file.module))\n }\n\n for (const [dirName, child] of node.dirs) {\n const childRoutes = nodeToRoutes(child)\n const seg = isGroup(dirName) ? '' : dirName\n\n if (child.layout) {\n // A layout wraps the directory's routes (it renders the outlet via children).\n routes.push(recordFrom(seg, child.layout, childRoutes))\n } else if (seg === '') {\n // A group with no layout adds no path/wrapper — its routes rise to this level.\n routes.push(...childRoutes)\n } else {\n // A plain directory nests its routes under a component-less path segment.\n routes.push({ path: seg, children: childRoutes })\n }\n }\n\n return routes\n}\n\n/**\n * Build a Quantum route table ({@link RouteRecord}[]) from a file-based module map.\n * Pure — use it directly, or via {@link createFileRouter}.\n */\nexport function routesFromModules(modules: Record<string, RouteModule>): RouteRecord[] {\n const { root, notFound } = buildTree(modules)\n const routes = nodeToRoutes(root)\n if (notFound?.default) {\n // Lowest-specificity catch-all: real routes always win; this matches the rest.\n routes.push({ path: '/:__notFound*', component: notFound.default })\n }\n return routes\n}\n\n/**\n * Create a router from a file-based module map — the file-based equivalent of\n * {@link createRouter}. Pass any other router options (history, guard, …).\n *\n * @example\n * // web (Vite): const modules = import.meta.glob('./app/**\\/*.tsx', { eager: true })\n * const router = createFileRouter(modules, { history: createMemoryHistory() })\n */\nexport function createFileRouter(\n modules: Record<string, RouteModule>,\n options: Omit<CreateRouterOptions, 'routes'> = {},\n): Router {\n return createRouter({ ...options, routes: routesFromModules(modules) })\n}\n"],"mappings":";;AA6CA,MAAM,YAAY;AAElB,SAAS,QAAQ,KAAsB;CACrC,OAAO,IAAI,WAAW,GAAG,KAAK,IAAI,SAAS,GAAG;AAChD;;AAGA,SAAS,cAAc,KAAqB;CAC1C,IAAI,QAAQ,SAAS,OAAO;CAC5B,MAAM,OAAO,IAAI,MAAM,kBAAkB;CACzC,IAAI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zB;GACA,OAAO;EACT;EACA,IAAI,aAAa,WAAW,KAAK,SAAS;OACrC,KAAK,MAAM,KAAK;GAAE,KAAK;GAAU,QAAQ;EAAI,CAAC;CACrD;CACA,OAAO,WAAW;EAAE;EAAM;CAAS,IAAI,EAAE,KAAK;AAChD;;AAGA,SAAS,aAAa,MAA8B;CAClD,MAAM,SAAwB,CAAC;CAE/B,KAAK,MAAM,QAAQ,KAAK,OACtB,OAAO,KAAK,WAAW,cAAc,KAAK,GAAG,GAAG,KAAK,MAAM,CAAC;CAG9D,KAAK,MAAM,CAAC,SAAS,UAAU,KAAK,MAAM;EACxC,MAAM,cAAc,aAAa,KAAK;EACtC,MAAM,MAAM,QAAQ,OAAO,IAAI,KAAK;EAEpC,IAAI,MAAM,QAER,OAAO,KAAK,WAAW,KAAK,MAAM,QAAQ,WAAW,CAAC;OACjD,IAAI,QAAQ,IAEjB,OAAO,KAAK,GAAG,WAAW;OAG1B,OAAO,KAAK;GAAE,MAAM;GAAK,UAAU;EAAY,CAAC;CAEpD;CAEA,OAAO;AACT;;;;;AAMA,SAAgB,kBAAkB,SAAqD;CACrF,MAAM,EAAE,MAAM,aAAa,UAAU,OAAO;CAC5C,MAAM,SAAS,aAAa,IAAI;CAChC,IAAI,UAAU,SAEZ,OAAO,KAAK;EAAE,MAAM;EAAiB,WAAW,SAAS;CAAQ,CAAC;CAEpE,OAAO;AACT;;;;;;;;;AAUA,SAAgB,iBACd,SACA,UAA+C,CAAC,GACxC;CACR,OAAO,aAAa;EAAE,GAAG;EAAS,QAAQ,kBAAkB,OAAO;CAAE,CAAC;AACxE"}
1
+ {"version":3,"file":"file-routes.js","names":[],"sources":["../src/file-routes.ts"],"sourcesContent":["/**\n * File-based routing for Quantum — turn a map of route modules into a router, with\n * the same conventions Expo Router uses so the structure is instantly familiar, but\n * feeding Quantum's better core (validated/typed params, loaders, re-render isolation).\n *\n * A *module map* is `{ [filePath]: RouteModule }` where each module's `default` export\n * is the screen and named exports (`loader`, `searchSchema`, …) configure the route.\n * The map comes from your bundler's glob (web: `import.meta.glob('./app/**', { eager:true })`)\n * or a generated table (native) — either way you never hand-write a route config.\n *\n * Conventions (file path → route):\n * - `index` → the directory's path (`index.tsx` → `/`)\n * - `[param]` → a dynamic segment (`:param`); `[...rest]` → a catch-all (`:rest*`)\n * - `(group)` → a layout group that does not affect the URL\n * - `_layout` → a layout route that wraps the directory's routes (render its outlet)\n * - `+not-found` → the fallback route for unmatched paths\n *\n * @module\n */\n\nimport type { Component } from '@mindees/core'\nimport type { LoaderDepsFn, LoaderFn } from './data'\nimport {\n type CreateRouterOptions,\n createRouter,\n type RouteComponentProps,\n type RouteRecord,\n type Router,\n} from './router'\nimport type { StandardSchemaV1 } from './standard-schema'\n\n/**\n * A route module: the `default` export is the screen component; named exports\n * configure the route (mirroring {@link RouteRecord}). A `_layout` module's `default`\n * receives the matched child as `props.children` (the outlet).\n */\nexport interface RouteModule {\n default?: Component<RouteComponentProps>\n loader?: LoaderFn\n loaderDeps?: LoaderDepsFn\n searchSchema?: StandardSchemaV1<unknown, Record<string, unknown>>\n staleTime?: number\n meta?: Readonly<Record<string, unknown>>\n}\n\nconst ROUTE_EXT = /\\.(tsx|ts|jsx|js)$/\n\nfunction isGroup(seg: string): boolean {\n return seg.startsWith('(') && seg.endsWith(')')\n}\n\n/** Convert one path segment to its route form (`index`→``, `[id]`→`:id`, `[...x]`→`:x*`). */\nfunction segmentToPath(seg: string): string {\n if (seg === 'index') return ''\n const rest = seg.match(/^\\[\\.\\.\\.(.+)\\]$/)\n if (rest?.[1]) return `:${rest[1]}*`\n const param = seg.match(/^\\[(.+)\\]$/)\n if (param?.[1]) return `:${param[1]}`\n return seg\n}\n\n/** Build a {@link RouteRecord} from a module, copying only the fields it defines. */\nfunction recordFrom(path: string, mod: RouteModule, children?: RouteRecord[]): RouteRecord {\n const record: { -readonly [K in keyof RouteRecord]?: RouteRecord[K] } = { path }\n if (mod.default) record.component = mod.default\n if (mod.loader) record.loader = mod.loader\n if (mod.loaderDeps) record.loaderDeps = mod.loaderDeps\n if (mod.searchSchema) record.searchSchema = mod.searchSchema\n if (mod.staleTime !== undefined) record.staleTime = mod.staleTime\n if (mod.meta) record.meta = mod.meta\n if (children && children.length > 0) record.children = children\n return record as RouteRecord\n}\n\ninterface DirNode {\n layout?: RouteModule\n files: { seg: string; module: RouteModule }[]\n dirs: Map<string, DirNode>\n}\n\nfunction emptyDir(): DirNode {\n return { files: [], dirs: new Map() }\n}\n\n/** Group the flat module map into a directory tree, pulling out a top-level not-found. */\nfunction buildTree(modules: Record<string, RouteModule>): {\n root: DirNode\n notFound?: RouteModule\n} {\n const root = emptyDir()\n let notFound: RouteModule | undefined\n // Sort keys so output is deterministic regardless of map insertion order.\n for (const rawKey of Object.keys(modules).sort()) {\n // Accept keys relative to the app dir, with optional leading \"./\" or \"app/\".\n const key = rawKey.replace(/^\\.\\//, '').replace(/^app\\//, '')\n const parts = key\n .replace(ROUTE_EXT, '')\n .split('/')\n .filter((s) => s.length > 0)\n if (parts.length === 0) continue\n const filename = parts[parts.length - 1] as string\n const mod = modules[rawKey] as RouteModule\n\n if (filename === '+not-found') {\n notFound = mod\n continue\n }\n\n let node = root\n for (const dir of parts.slice(0, -1)) {\n let next = node.dirs.get(dir)\n if (!next) {\n next = emptyDir()\n node.dirs.set(dir, next)\n }\n node = next\n }\n if (filename === '_layout') node.layout = mod\n else node.files.push({ seg: filename, module: mod })\n }\n return notFound ? { root, notFound } : { root }\n}\n\n/** Convert a directory node into the route records *relative to that node*. */\nfunction nodeToRoutes(node: DirNode): RouteRecord[] {\n const routes: RouteRecord[] = []\n\n for (const file of node.files) {\n routes.push(recordFrom(segmentToPath(file.seg), file.module))\n }\n\n for (const [dirName, child] of node.dirs) {\n const childRoutes = nodeToRoutes(child)\n // Convert dynamic/catch-all DIRECTORY names too (`[id]`→`:id`, `[...x]`→`:x*`), not just files —\n // otherwise a nested dynamic route like `posts/[id]/comments` stays a literal `[id]` and never matches.\n const seg = isGroup(dirName) ? '' : segmentToPath(dirName)\n\n if (child.layout) {\n // A layout wraps the directory's routes (it renders the outlet via children).\n routes.push(recordFrom(seg, child.layout, childRoutes))\n } else if (seg === '') {\n // A group with no layout adds no path/wrapper — its routes rise to this level.\n routes.push(...childRoutes)\n } else {\n // A plain directory nests its routes under a component-less path segment.\n routes.push({ path: seg, children: childRoutes })\n }\n }\n\n return routes\n}\n\n/**\n * Build a Quantum route table ({@link RouteRecord}[]) from a file-based module map.\n * Pure — use it directly, or via {@link createFileRouter}.\n */\nexport function routesFromModules(modules: Record<string, RouteModule>): RouteRecord[] {\n const { root, notFound } = buildTree(modules)\n const routes = nodeToRoutes(root)\n if (notFound?.default) {\n // Lowest-specificity catch-all: real routes always win; this matches the rest.\n routes.push({ path: '/:__notFound*', component: notFound.default })\n }\n return routes\n}\n\n/**\n * Create a router from a file-based module map — the file-based equivalent of\n * {@link createRouter}. Pass any other router options (history, guard, …).\n *\n * @example\n * // web (Vite): const modules = import.meta.glob('./app/**\\/*.tsx', { eager: true })\n * const router = createFileRouter(modules, { history: createMemoryHistory() })\n */\nexport function createFileRouter(\n modules: Record<string, RouteModule>,\n options: Omit<CreateRouterOptions, 'routes'> = {},\n): Router {\n return createRouter({ ...options, routes: routesFromModules(modules) })\n}\n"],"mappings":";;AA6CA,MAAM,YAAY;AAElB,SAAS,QAAQ,KAAsB;CACrC,OAAO,IAAI,WAAW,GAAG,KAAK,IAAI,SAAS,GAAG;AAChD;;AAGA,SAAS,cAAc,KAAqB;CAC1C,IAAI,QAAQ,SAAS,OAAO;CAC5B,MAAM,OAAO,IAAI,MAAM,kBAAkB;CACzC,IAAI,OAAO,IAAI,OAAO,IAAI,KAAK,GAAG;CAClC,MAAM,QAAQ,IAAI,MAAM,YAAY;CACpC,IAAI,QAAQ,IAAI,OAAO,IAAI,MAAM;CACjC,OAAO;AACT;;AAGA,SAAS,WAAW,MAAc,KAAkB,UAAuC;CACzF,MAAM,SAAkE,EAAE,KAAK;CAC/E,IAAI,I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AAwB,CAAC;CAE/B,KAAK,MAAM,QAAQ,KAAK,OACtB,OAAO,KAAK,WAAW,cAAc,KAAK,GAAG,GAAG,KAAK,MAAM,CAAC;CAG9D,KAAK,MAAM,CAAC,SAAS,UAAU,KAAK,MAAM;EACxC,MAAM,cAAc,aAAa,KAAK;EAGtC,MAAM,MAAM,QAAQ,OAAO,IAAI,KAAK,cAAc,OAAO;EAEzD,IAAI,MAAM,QAER,OAAO,KAAK,WAAW,KAAK,MAAM,QAAQ,WAAW,CAAC;OACjD,IAAI,QAAQ,IAEjB,OAAO,KAAK,GAAG,WAAW;OAG1B,OAAO,KAAK;GAAE,MAAM;GAAK,UAAU;EAAY,CAAC;CAEpD;CAEA,OAAO;AACT;;;;;AAMA,SAAgB,kBAAkB,SAAqD;CACrF,MAAM,EAAE,MAAM,aAAa,UAAU,OAAO;CAC5C,MAAM,SAAS,aAAa,IAAI;CAChC,IAAI,UAAU,SAEZ,OAAO,KAAK;EAAE,MAAM;EAAiB,WAAW,SAAS;CAAQ,CAAC;CAEpE,OAAO;AACT;;;;;;;;;AAUA,SAAgB,iBACd,SACA,UAA+C,CAAC,GACxC;CACR,OAAO,aAAa;EAAE,GAAG;EAAS,QAAQ,kBAAkB,OAAO;CAAE,CAAC;AACxE"}
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@min
14
14
  /** The npm package name. */
15
15
  declare const name = "@mindees/router";
16
16
  /** The package version. All `@mindees/*` packages share one locked version line. */
17
- declare const VERSION = "0.22.0";
17
+ declare const VERSION = "0.22.2";
18
18
  /**
19
19
  * Current maturity. Router I (typed params, Standard-Schema search, history, the
20
20
  * signals-native router, selector-isolated state, typed + relative navigation)
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import { NotImplementedError, notImplemented } from "@mindees/core";
11
11
  /** The npm package name. */
12
12
  const name = "@mindees/router";
13
13
  /** The package version. All `@mindees/*` packages share one locked version line. */
14
- const VERSION = "0.22.0";
14
+ const VERSION = "0.22.2";
15
15
  /**
16
16
  * Current maturity. Router I (typed params, Standard-Schema search, history, the
17
17
  * signals-native router, selector-isolated state, typed + relative navigation)
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/router` — **Quantum**, the typed router for MindeesNative.\n *\n * Router I (Phase 6): codegen-free typed path params ({@link PathParams}),\n * Standard-Schema validated search params, a signals-native router with typed +\n * relative navigation and selector-isolated state, and an injectable history\n * (memory + browser). See ADR-0003.\n *\n * Router II (Phase 7): render integration — {@link createRouterView} (nested,\n * fine-grained, layout-preserving) and typed {@link createLink} — plus SWR data\n * loaders (with `AbortSignal`, {@link Router.invalidate}/{@link Router.preload}),\n * navigation guards ({@link BeforeNavigate} cancel/redirect + idempotent\n * navigation), and web view transitions. See ADR-0004 and ADR-0005.\n *\n * Still a later phase (not exported): the global typed route registry and\n * file-based route scanning + bundler plugin. See `STATUS.md`.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** Render integration: nested view + typed links (Router II). */\nexport {\n createLink,\n createRouterView,\n type LinkComponent,\n type LinkOptions,\n type LinkProps,\n type PrefetchMode,\n type RouterViewOptions,\n} from './components'\n/** Loaders + data (SWR). */\nexport type {\n LoaderContext,\n LoaderData,\n LoaderDepsFn,\n LoaderFn,\n LoaderStatus,\n} from './data'\n/** Errors. */\nexport { RouterError, type RouterErrorCode } from './errors'\n/** File-based routing: a module map → a router (Expo-style conventions). */\nexport { createFileRouter, type RouteModule, routesFromModules } from './file-routes'\n/** History capability. */\nexport {\n createBrowserHistory,\n createHref,\n createMemoryHistory,\n type HistoryListener,\n type MemoryHistoryOptions,\n parseHref,\n type RouterHistory,\n type RouterLocation,\n} from './history'\n/** Ergonomic hooks + a bound Link that resolve the active router. */\nexport { Link, useParams, usePathname, useRouter, useSearch } from './hooks'\n/** Route patterns + codegen-free typed params. */\nexport {\n buildPath,\n compareSpecificity,\n type HasPathParams,\n matchPattern,\n type PathParams,\n parsePattern,\n} from './pattern'\n/** Router. */\nexport {\n type BeforeNavigate,\n type CreateRouterOptions,\n createRouter,\n type NavigateOptions,\n type NavTarget,\n type RouteComponentProps,\n type RouteMatch,\n type RouteRecord,\n type Router,\n type RouterState,\n resolvePath,\n} from './router'\n/** Search (query) params. */\nexport {\n parseQuery,\n type QueryValue,\n safeValidateSearch,\n stringifyQuery,\n type ValidationResult,\n validateSearch,\n} from './search'\n/** Standard Schema — the validator-agnostic interface (vendored, types only). */\nexport type { StandardSchemaV1 } from './standard-schema'\n\n/** The npm package name. */\nexport const name = '@mindees/router'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.22.0'\n\n/**\n * Current maturity. Router I (typed params, Standard-Schema search, history, the\n * signals-native router, selector-isolated state, typed + relative navigation)\n * and Router II (nested rendering, typed links, SWR loaders, navigation guards,\n * view transitions) are implemented and tested. The global typed route registry\n * and file-based route scanning are a later phase — see `STATUS.md`.\n */\nexport const maturity: Maturity = 'experimental'\n\n/** Static identity + maturity metadata for this package. */\nexport const info: PackageInfo = { name, version: VERSION, maturity }\n\nexport type { Maturity, PackageInfo }\nexport { NotImplementedError, notImplemented }\n"],"mappings":";;;;;;;;;;;AA8FA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;;;;;;;AASvB,MAAa,WAAqB;;AAGlC,MAAa,OAAoB;CAAE;CAAM,SAAS;CAAS;AAAS"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/router` — **Quantum**, the typed router for MindeesNative.\n *\n * Router I (Phase 6): codegen-free typed path params ({@link PathParams}),\n * Standard-Schema validated search params, a signals-native router with typed +\n * relative navigation and selector-isolated state, and an injectable history\n * (memory + browser). See ADR-0003.\n *\n * Router II (Phase 7): render integration — {@link createRouterView} (nested,\n * fine-grained, layout-preserving) and typed {@link createLink} — plus SWR data\n * loaders (with `AbortSignal`, {@link Router.invalidate}/{@link Router.preload}),\n * navigation guards ({@link BeforeNavigate} cancel/redirect + idempotent\n * navigation), and web view transitions. See ADR-0004 and ADR-0005.\n *\n * Still a later phase (not exported): the global typed route registry and\n * file-based route scanning + bundler plugin. See `STATUS.md`.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** Render integration: nested view + typed links (Router II). */\nexport {\n createLink,\n createRouterView,\n type LinkComponent,\n type LinkOptions,\n type LinkProps,\n type PrefetchMode,\n type RouterViewOptions,\n} from './components'\n/** Loaders + data (SWR). */\nexport type {\n LoaderContext,\n LoaderData,\n LoaderDepsFn,\n LoaderFn,\n LoaderStatus,\n} from './data'\n/** Errors. */\nexport { RouterError, type RouterErrorCode } from './errors'\n/** File-based routing: a module map → a router (Expo-style conventions). */\nexport { createFileRouter, type RouteModule, routesFromModules } from './file-routes'\n/** History capability. */\nexport {\n createBrowserHistory,\n createHref,\n createMemoryHistory,\n type HistoryListener,\n type MemoryHistoryOptions,\n parseHref,\n type RouterHistory,\n type RouterLocation,\n} from './history'\n/** Ergonomic hooks + a bound Link that resolve the active router. */\nexport { Link, useParams, usePathname, useRouter, useSearch } from './hooks'\n/** Route patterns + codegen-free typed params. */\nexport {\n buildPath,\n compareSpecificity,\n type HasPathParams,\n matchPattern,\n type PathParams,\n parsePattern,\n} from './pattern'\n/** Router. */\nexport {\n type BeforeNavigate,\n type CreateRouterOptions,\n createRouter,\n type NavigateOptions,\n type NavTarget,\n type RouteComponentProps,\n type RouteMatch,\n type RouteRecord,\n type Router,\n type RouterState,\n resolvePath,\n} from './router'\n/** Search (query) params. */\nexport {\n parseQuery,\n type QueryValue,\n safeValidateSearch,\n stringifyQuery,\n type ValidationResult,\n validateSearch,\n} from './search'\n/** Standard Schema — the validator-agnostic interface (vendored, types only). */\nexport type { StandardSchemaV1 } from './standard-schema'\n\n/** The npm package name. */\nexport const name = '@mindees/router'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.22.2'\n\n/**\n * Current maturity. Router I (typed params, Standard-Schema search, history, the\n * signals-native router, selector-isolated state, typed + relative navigation)\n * and Router II (nested rendering, typed links, SWR loaders, navigation guards,\n * view transitions) are implemented and tested. The global typed route registry\n * and file-based route scanning are a later phase — see `STATUS.md`.\n */\nexport const maturity: Maturity = 'experimental'\n\n/** Static identity + maturity metadata for this package. */\nexport const info: PackageInfo = { name, version: VERSION, maturity }\n\nexport type { Maturity, PackageInfo }\nexport { NotImplementedError, notImplemented }\n"],"mappings":";;;;;;;;;;;AA8FA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;;;;;;;AASvB,MAAa,WAAqB;;AAGlC,MAAa,OAAoB;CAAE;CAAM,SAAS;CAAS;AAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindees/router",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "description": "Quantum — the typed, signals-native router for MindeesNative: codegen-free typed path params, Standard Schema validated search params, and selector-isolated reactive route state.",
5
5
  "keywords": [
6
6
  "router",
@@ -35,13 +35,13 @@
35
35
  "directory": "packages/router"
36
36
  },
37
37
  "dependencies": {
38
- "@mindees/core": "0.22.0"
38
+ "@mindees/core": "0.22.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "happy-dom": "20.9.0",
42
42
  "valibot": "1.4.1",
43
43
  "zod": "4.4.3",
44
- "@mindees/renderer": "0.22.0"
44
+ "@mindees/renderer": "0.22.2"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsdown",