@kimesh/router-runtime 0.2.11 → 0.2.12

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.
@@ -13,7 +13,7 @@ interface KimeshRuntimePluginMeta {
13
13
  /** Plugin name for debugging */
14
14
  name?: string;
15
15
  /** Execution order: pre runs first, post runs last */
16
- enforce?: "pre" | "default" | "post";
16
+ enforce?: 'pre' | 'default' | 'post';
17
17
  /** Numeric order for fine-grained control */
18
18
  order?: number;
19
19
  /** Wait for these plugins to complete first */
@@ -44,17 +44,17 @@ interface NavigationAfterHookContext extends NavigationHookContext {
44
44
  * Runtime hooks available in Kimesh app lifecycle
45
45
  */
46
46
  interface KimeshRuntimeHooks {
47
- "app:created": (app: App) => void | Promise<void>;
48
- "app:beforeMount": (app: App) => void | Promise<void>;
49
- "app:mounted": (app: App) => void | Promise<void>;
50
- "app:error": (err: unknown) => void | Promise<void>;
51
- "page:start": () => void | Promise<void>;
52
- "page:finish": () => void | Promise<void>;
53
- "page:transition:finish": () => void | Promise<void>;
54
- "page:view-transition:start": (transition: ViewTransition) => void | Promise<void>;
55
- "navigate:before": (context: NavigationHookContext) => void | false | Promise<void | false>;
56
- "navigate:after": (context: NavigationAfterHookContext) => void | Promise<void>;
57
- "navigate:error": (context: NavigationErrorHookContext) => void | Promise<void>;
47
+ 'app:created': (app: App) => void | Promise<void>;
48
+ 'app:beforeMount': (app: App) => void | Promise<void>;
49
+ 'app:mounted': (app: App) => void | Promise<void>;
50
+ 'app:error': (err: unknown) => void | Promise<void>;
51
+ 'page:start': () => void | Promise<void>;
52
+ 'page:finish': () => void | Promise<void>;
53
+ 'page:transition:finish': () => void | Promise<void>;
54
+ 'page:view-transition:start': (transition: ViewTransition) => void | Promise<void>;
55
+ 'navigate:before': (context: NavigationHookContext) => void | false | Promise<void | false>;
56
+ 'navigate:after': (context: NavigationAfterHookContext) => void | Promise<void>;
57
+ 'navigate:error': (context: NavigationErrorHookContext) => void | Promise<void>;
58
58
  }
59
59
  /**
60
60
  * Runtime config shape (public values only, no SSR)
@@ -195,9 +195,9 @@ interface CreateKimeshAppOptions {
195
195
  /** Base URL for router */
196
196
  base?: string;
197
197
  /** History mode */
198
- history?: "hash" | "web";
198
+ history?: 'hash' | 'web';
199
199
  /** Scroll behavior */
200
- scrollBehavior?: Router["options"]["scrollBehavior"];
200
+ scrollBehavior?: Router['options']['scrollBehavior'];
201
201
  /** Query client configuration */
202
202
  queryClientConfig?: QueryClientConfig;
203
203
  /** Custom context (user-defined) */
@@ -273,7 +273,7 @@ interface RouteHeadConfig {
273
273
  property?: string;
274
274
  content?: string;
275
275
  charset?: string;
276
- "http-equiv"?: string;
276
+ 'http-equiv'?: string;
277
277
  [key: string]: string | undefined;
278
278
  }>;
279
279
  /** Link tags */
@@ -308,7 +308,7 @@ interface RouteHeadConfig {
308
308
  /** HTML attributes */
309
309
  htmlAttrs?: {
310
310
  lang?: string;
311
- dir?: "ltr" | "rtl" | "auto";
311
+ dir?: 'ltr' | 'rtl' | 'auto';
312
312
  class?: string;
313
313
  [key: string]: string | undefined;
314
314
  };
@@ -421,7 +421,7 @@ interface FileRouteOptions<TMeta = unknown, TParams = Record<string, string>, TS
421
421
  * viewTransition: 'always' // always use view transitions
422
422
  * ```
423
423
  */
424
- viewTransition?: boolean | "always";
424
+ viewTransition?: boolean | 'always';
425
425
  /**
426
426
  * KeepAlive configuration for route component
427
427
  *
@@ -456,10 +456,10 @@ interface RouteDefinition<TPath extends string = string, TMeta = unknown, TParam
456
456
  beforeLoad?: (ctx: BeforeLoadContext) => Promise<void> | void;
457
457
  head?: RouteHeadFn<TParams, TLoaderData> | RouteHeadConfig;
458
458
  transition?: boolean | TransitionProps;
459
- viewTransition?: boolean | "always";
459
+ viewTransition?: boolean | 'always';
460
460
  keepalive?: boolean | KeepAliveProps;
461
461
  }
462
- declare module "vue-router" {
462
+ declare module 'vue-router' {
463
463
  interface RouteMeta {
464
464
  /** Kimesh route definition with loader */
465
465
  __kimesh?: RouteDefinition;
@@ -968,7 +968,7 @@ declare function useReactiveParams<T extends string = RouteNames>(): ComputedRef
968
968
  * Navigation options - requires params if route has them
969
969
  * Allows both named routes (with autocomplete) and raw string paths
970
970
  */
971
- type NavigateOptions<T extends string = RouteNames> = T extends RouteNames ? (HasParams<T> extends true ? {
971
+ type NavigateOptions<T extends string = RouteNames> = T extends RouteNames ? HasParams<T> extends true ? {
972
972
  to: T;
973
973
  params: RouteParamsRaw<T>;
974
974
  replace?: boolean;
@@ -980,7 +980,7 @@ type NavigateOptions<T extends string = RouteNames> = T extends RouteNames ? (Ha
980
980
  to: T;
981
981
  params?: Record<string, string | number>;
982
982
  replace?: boolean;
983
- }) : {
983
+ } : {
984
984
  to: T;
985
985
  params?: Record<string, string | number>;
986
986
  replace?: boolean;
@@ -1132,9 +1132,9 @@ interface NavigationErrorContext {
1132
1132
  to: RouteLocationNormalized;
1133
1133
  from: RouteLocationNormalized;
1134
1134
  }
1135
- type BeforeNavigationHandler = KimeshRuntimeHooks["navigate:before"];
1136
- type AfterNavigationHandler = KimeshRuntimeHooks["navigate:after"];
1137
- type ErrorNavigationHandler = KimeshRuntimeHooks["navigate:error"];
1135
+ type BeforeNavigationHandler = KimeshRuntimeHooks['navigate:before'];
1136
+ type AfterNavigationHandler = KimeshRuntimeHooks['navigate:after'];
1137
+ type ErrorNavigationHandler = KimeshRuntimeHooks['navigate:error'];
1138
1138
  /**
1139
1139
  * Options for useNavigationMiddleware
1140
1140
  */
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as UseSearchReturn, $t as RouteParams, A as NavigateToOptions, At as ExtractRouteParams, B as STATE_KEY_PREFIX, Bt as LoaderFn, C as KnownMiddleware, Ct as createFileRoute, Dt as createKimeshApp, E as MiddlewareOption, Et as KIMESH_APP_CONTEXT_KEY, F as NavigationErrorContext, Ft as InlineRouteMiddleware, G as tryUseKimeshApp, Gt as RouteDefinition, H as getKmStateKeys, Ht as ParamValueOneOrMore, I as NavigationMiddlewareOptions, It as KIMESH_CONTEXT_KEY, J as useRuntimeConfig, Jt as RouteHeadFn, K as useKimeshApp, Kt as RouteHeadConfig, L as useAfterNavigation, Lt as KimeshApp, M as RouteMiddleware, Mt as FullContext, N as TypedRouteMiddleware, Nt as HasParams, Ot as BeforeLoadContext, P as NavigationContext, Pt as InlineMiddlewareContext, Q as useReactiveParams, Qt as RouteNames, R as useNavigationGuard, Rt as KimeshContext, S as KimeshMiddlewareNames, St as useKimeshContext, T as MiddlewareDefinition, Tt as CreateKimeshAppOptionsExtended, U as hasKmState, Ut as ParamValueZeroOrMore, V as clearKmState, Vt as ParamValue, W as useState, Wt as ParamValueZeroOrOne, X as useNavigate, Xt as RouteLocationRaw, Y as NavigateOptions, Yt as RouteInfoByName, Z as useParams, Zt as RouteNamedMap, _ as createMiddlewarePlugin, _t as getPluginHooks, a as RouteRecordRaw, an as KimeshRuntimeHooks, at as KmLink, b as defineKimeshMiddleware, bt as isKimeshRuntimePlugin, c as onBeforeRouteUpdate, cn as KimeshRuntimePluginMeta, ct as QueryPluginOptions, d as useRouter, dn as NavigationErrorHookContext, dt as routerPlugin, en as RouteParamsRaw, et as useSearch, f as createMiddlewareExecutor, fn as NavigationHookContext, ft as applyPlugin, g as MiddlewarePluginOptions, gt as defineKimeshRuntimePlugin, h as createMiddlewareContext, ht as KIMESH_PLUGIN_INDICATOR, i as RouteLocationNormalizedLoaded, in as KimeshAppContext, it as KmDeferred, j as NavigationRedirect, jt as FileRouteOptions, k as MiddlewareResult, kt as CreateKimeshAppOptions, l as useLink, ln as KimeshRuntimePluginResult, lt as getCorePlugins, mt as applyPluginsWithParallel, n as NavigationHookAfter, nn as RouteRecordInfo, nt as createLoaderGuard, o as Router, on as KimeshRuntimePlugin, ot as KmLinkProps, pn as RuntimeConfigPublic, pt as applyPlugins, q as RuntimeConfig, qt as RouteHeadContext, r as RouteLocationNormalized, rn as SearchSchema, rt as installLoaderGuard, s as onBeforeRouteLeave, sn as KimeshRuntimePluginDefinition, st as KmOutlet, t as NavigationGuard, tn as RoutePath, tt as LoaderGuardOptions, u as useRoute, un as NavigationAfterHookContext, ut as queryPlugin, v as middlewarePlugin, vt as getPluginMeta, w as MiddlewareContext, wt as defineRoute, x as navigateTo, xt as defineContext, y as abortNavigation, yt as getPluginName, z as useNavigationMiddleware, zt as LoaderContext } from "./index-CYE7fnU0.mjs";
1
+ import { $ as UseSearchReturn, $t as RouteParams, A as NavigateToOptions, At as ExtractRouteParams, B as STATE_KEY_PREFIX, Bt as LoaderFn, C as KnownMiddleware, Ct as createFileRoute, Dt as createKimeshApp, E as MiddlewareOption, Et as KIMESH_APP_CONTEXT_KEY, F as NavigationErrorContext, Ft as InlineRouteMiddleware, G as tryUseKimeshApp, Gt as RouteDefinition, H as getKmStateKeys, Ht as ParamValueOneOrMore, I as NavigationMiddlewareOptions, It as KIMESH_CONTEXT_KEY, J as useRuntimeConfig, Jt as RouteHeadFn, K as useKimeshApp, Kt as RouteHeadConfig, L as useAfterNavigation, Lt as KimeshApp, M as RouteMiddleware, Mt as FullContext, N as TypedRouteMiddleware, Nt as HasParams, Ot as BeforeLoadContext, P as NavigationContext, Pt as InlineMiddlewareContext, Q as useReactiveParams, Qt as RouteNames, R as useNavigationGuard, Rt as KimeshContext, S as KimeshMiddlewareNames, St as useKimeshContext, T as MiddlewareDefinition, Tt as CreateKimeshAppOptionsExtended, U as hasKmState, Ut as ParamValueZeroOrMore, V as clearKmState, Vt as ParamValue, W as useState, Wt as ParamValueZeroOrOne, X as useNavigate, Xt as RouteLocationRaw, Y as NavigateOptions, Yt as RouteInfoByName, Z as useParams, Zt as RouteNamedMap, _ as createMiddlewarePlugin, _t as getPluginHooks, a as RouteRecordRaw, an as KimeshRuntimeHooks, at as KmLink, b as defineKimeshMiddleware, bt as isKimeshRuntimePlugin, c as onBeforeRouteUpdate, cn as KimeshRuntimePluginMeta, ct as QueryPluginOptions, d as useRouter, dn as NavigationErrorHookContext, dt as routerPlugin, en as RouteParamsRaw, et as useSearch, f as createMiddlewareExecutor, fn as NavigationHookContext, ft as applyPlugin, g as MiddlewarePluginOptions, gt as defineKimeshRuntimePlugin, h as createMiddlewareContext, ht as KIMESH_PLUGIN_INDICATOR, i as RouteLocationNormalizedLoaded, in as KimeshAppContext, it as KmDeferred, j as NavigationRedirect, jt as FileRouteOptions, k as MiddlewareResult, kt as CreateKimeshAppOptions, l as useLink, ln as KimeshRuntimePluginResult, lt as getCorePlugins, mt as applyPluginsWithParallel, n as NavigationHookAfter, nn as RouteRecordInfo, nt as createLoaderGuard, o as Router, on as KimeshRuntimePlugin, ot as KmLinkProps, pn as RuntimeConfigPublic, pt as applyPlugins, q as RuntimeConfig, qt as RouteHeadContext, r as RouteLocationNormalized, rn as SearchSchema, rt as installLoaderGuard, s as onBeforeRouteLeave, sn as KimeshRuntimePluginDefinition, st as KmOutlet, t as NavigationGuard, tn as RoutePath, tt as LoaderGuardOptions, u as useRoute, un as NavigationAfterHookContext, ut as queryPlugin, v as middlewarePlugin, vt as getPluginMeta, w as MiddlewareContext, wt as defineRoute, x as navigateTo, xt as defineContext, y as abortNavigation, yt as getPluginName, z as useNavigationMiddleware, zt as LoaderContext } from "./index-9xJk3v3Z.mjs";
2
2
  export { BeforeLoadContext, CreateKimeshAppOptions, CreateKimeshAppOptionsExtended, ExtractRouteParams, FileRouteOptions, FullContext, HasParams, InlineMiddlewareContext, InlineRouteMiddleware, KIMESH_APP_CONTEXT_KEY, KIMESH_CONTEXT_KEY, KIMESH_PLUGIN_INDICATOR, KimeshApp, KimeshAppContext, KimeshContext, KimeshMiddlewareNames, KimeshRuntimeHooks, KimeshRuntimePlugin, KimeshRuntimePluginDefinition, KimeshRuntimePluginMeta, KimeshRuntimePluginResult, KmDeferred, KmLink, KmLinkProps, KmOutlet, KnownMiddleware, LoaderContext, LoaderFn, LoaderGuardOptions, MiddlewareContext, MiddlewareDefinition, MiddlewareOption, MiddlewarePluginOptions, MiddlewareResult, NavigateOptions, NavigateToOptions, NavigationAfterHookContext, NavigationContext, NavigationErrorContext, NavigationErrorHookContext, NavigationGuard, NavigationHookAfter, NavigationHookContext, NavigationMiddlewareOptions, NavigationRedirect, ParamValue, ParamValueOneOrMore, ParamValueZeroOrMore, ParamValueZeroOrOne, QueryPluginOptions, RouteDefinition, RouteHeadConfig, RouteHeadContext, RouteHeadFn, RouteInfoByName, RouteLocationNormalized, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteMiddleware, RouteNamedMap, RouteNames, RouteParams, RouteParamsRaw, RoutePath, RouteRecordInfo, RouteRecordRaw, Router, RuntimeConfig, RuntimeConfigPublic, STATE_KEY_PREFIX, SearchSchema, TypedRouteMiddleware, UseSearchReturn, abortNavigation, applyPlugin, applyPlugins, applyPluginsWithParallel, clearKmState, createFileRoute, createKimeshApp, createLoaderGuard, createMiddlewareContext, createMiddlewareExecutor, createMiddlewarePlugin, defineContext, defineKimeshMiddleware, defineKimeshRuntimePlugin, defineRoute, getCorePlugins, getKmStateKeys, getPluginHooks, getPluginMeta, getPluginName, hasKmState, installLoaderGuard, isKimeshRuntimePlugin, middlewarePlugin, navigateTo, onBeforeRouteLeave, onBeforeRouteUpdate, queryPlugin, routerPlugin, tryUseKimeshApp, useAfterNavigation, useKimeshApp, useKimeshContext, useLink, useNavigate, useNavigationGuard, useNavigationMiddleware, useParams, useReactiveParams, useRoute, useRouter, useRuntimeConfig, useSearch, useState };
package/dist/index.mjs CHANGED
@@ -359,12 +359,12 @@ function defineRoute(options) {
359
359
  //#region src/context.ts
360
360
  /**
361
361
  * Define app context with type inference
362
- *
362
+ *
363
363
  * @example
364
364
  * ```ts
365
365
  * // src/app.context.ts
366
366
  * import { defineContext } from '@kimesh/router-runtime'
367
- *
367
+ *
368
368
  * export default defineContext(() => ({
369
369
  * auth: useAuthStore(),
370
370
  * i18n: createI18n(),
@@ -376,7 +376,7 @@ function defineContext(factory) {
376
376
  }
377
377
  /**
378
378
  * Use Kimesh context in components
379
- *
379
+ *
380
380
  * @example
381
381
  * ```vue
382
382
  * <script setup>
@@ -599,17 +599,17 @@ const supportsViewTransitions = () => typeof document !== "undefined" && "startV
599
599
  * Renders the matched route component with optional transitions and keepalive
600
600
  *
601
601
  * Transition options for async pages (useSuspenseQuery):
602
- *
602
+ *
603
603
  * 1. viewTransition: true (Recommended)
604
604
  * - Uses View Transitions API (Chrome 111+, Edge 111+, Opera 97+)
605
605
  * - Works perfectly with async pages
606
606
  * - Falls back to instant transition on unsupported browsers
607
- *
607
+ *
608
608
  * 2. transition: { name: 'fade' } (without mode: 'out-in')
609
609
  * - Uses Vue Transition with default mode (cross-fade)
610
610
  * - Both pages exist during transition (old fades out, new fades in)
611
611
  * - Requires CSS: .page-leave-active { position: absolute }
612
- *
612
+ *
613
613
  * 3. transition: { name: 'fade', mode: 'out-in' }
614
614
  * - ⚠️ NOT recommended for async pages - may cause blank screen
615
615
  */
@@ -1066,7 +1066,7 @@ let _config;
1066
1066
  */
1067
1067
  function useRuntimeConfig() {
1068
1068
  if (!_config) try {
1069
- _config = Object.freeze({ ...__KIMESH_CONFIG__ ?? {} });
1069
+ _config = Object.freeze({ ...__KIMESH_CONFIG__ });
1070
1070
  } catch {
1071
1071
  _config = Object.freeze({});
1072
1072
  }
@@ -1,2 +1,2 @@
1
- import { A as NavigateToOptions, C as KnownMiddleware, D as MiddlewareRegistry, E as MiddlewareOption, M as RouteMiddleware, N as TypedRouteMiddleware, O as MiddlewareRegistryEntry, S as KimeshMiddlewareNames, T as MiddlewareDefinition, _ as createMiddlewarePlugin, b as defineKimeshMiddleware, f as createMiddlewareExecutor, g as MiddlewarePluginOptions, h as createMiddlewareContext, j as NavigationRedirect, k as MiddlewareResult, m as executeMiddlewareChain, p as executeMiddleware, v as middlewarePlugin, w as MiddlewareContext, x as navigateTo, y as abortNavigation } from "../index-CYE7fnU0.mjs";
1
+ import { A as NavigateToOptions, C as KnownMiddleware, D as MiddlewareRegistry, E as MiddlewareOption, M as RouteMiddleware, N as TypedRouteMiddleware, O as MiddlewareRegistryEntry, S as KimeshMiddlewareNames, T as MiddlewareDefinition, _ as createMiddlewarePlugin, b as defineKimeshMiddleware, f as createMiddlewareExecutor, g as MiddlewarePluginOptions, h as createMiddlewareContext, j as NavigationRedirect, k as MiddlewareResult, m as executeMiddlewareChain, p as executeMiddleware, v as middlewarePlugin, w as MiddlewareContext, x as navigateTo, y as abortNavigation } from "../index-9xJk3v3Z.mjs";
2
2
  export { KimeshMiddlewareNames, KnownMiddleware, MiddlewareContext, MiddlewareDefinition, MiddlewareOption, MiddlewarePluginOptions, MiddlewareRegistry, MiddlewareRegistryEntry, MiddlewareResult, NavigateToOptions, NavigationRedirect, RouteMiddleware, TypedRouteMiddleware, abortNavigation, createMiddlewareContext, createMiddlewareExecutor, createMiddlewarePlugin, defineKimeshMiddleware, executeMiddleware, executeMiddlewareChain, middlewarePlugin, navigateTo };
@@ -1,2 +1,2 @@
1
- import { _ as createMiddlewarePlugin, g as MiddlewarePluginOptions, v as middlewarePlugin } from "../index-CYE7fnU0.mjs";
1
+ import { _ as createMiddlewarePlugin, g as MiddlewarePluginOptions, v as middlewarePlugin } from "../index-9xJk3v3Z.mjs";
2
2
  export { MiddlewarePluginOptions, createMiddlewarePlugin, middlewarePlugin as default, middlewarePlugin };
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "@kimesh/router-runtime",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Runtime router for Kimesh framework",
5
- "type": "module",
6
5
  "repository": {
7
6
  "type": "git",
8
7
  "url": "https://github.com/kimeshjs/kimesh.git"
9
8
  },
9
+ "files": [
10
+ "dist",
11
+ "src/default-app.vue"
12
+ ],
13
+ "type": "module",
14
+ "main": "./dist/index.mjs",
15
+ "types": "./dist/index.d.mts",
10
16
  "exports": {
11
17
  ".": {
12
18
  "types": "./dist/index.d.mts",
@@ -24,12 +30,6 @@
24
30
  "import": "./dist/middleware/plugin.mjs"
25
31
  }
26
32
  },
27
- "main": "./dist/index.mjs",
28
- "types": "./dist/index.d.mts",
29
- "files": [
30
- "dist",
31
- "src/default-app.vue"
32
- ],
33
33
  "scripts": {
34
34
  "build": "tsdown",
35
35
  "dev": "tsdown --watch",
@@ -41,22 +41,22 @@
41
41
  "hookable": "^5.5.3",
42
42
  "vue-router": "^4.6.4"
43
43
  },
44
+ "devDependencies": {
45
+ "@tanstack/vue-query": "^5.92.6",
46
+ "@types/node": "^25.0.8",
47
+ "tsdown": "^0.20.0-beta.3",
48
+ "typescript": "^5.9.3",
49
+ "vitest": "^4.0.17",
50
+ "vue": "^3.5.26",
51
+ "vue-tsc": "^3.2.2"
52
+ },
44
53
  "peerDependencies": {
45
- "vue": "^3.5.0",
46
- "@tanstack/vue-query": "^5.0.0"
54
+ "@tanstack/vue-query": "^5.0.0",
55
+ "vue": "^3.5.0"
47
56
  },
48
57
  "peerDependenciesMeta": {
49
58
  "@tanstack/vue-query": {
50
59
  "optional": true
51
60
  }
52
- },
53
- "devDependencies": {
54
- "@types/node": "^25.0.8",
55
- "typescript": "^5.9.3",
56
- "tsdown": "^0.20.0-beta.3",
57
- "vue": "^3.5.26",
58
- "vue-tsc": "^3.2.2",
59
- "vitest": "^4.0.17",
60
- "@tanstack/vue-query": "^5.92.6"
61
61
  }
62
62
  }