@vlian/framework 1.0.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.
- package/LICENSE +191 -0
- package/README.md +130 -0
- package/dist/components/index.cjs +6 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/core/Test.cjs +66 -0
- package/dist/core/Test.cjs.map +1 -0
- package/dist/core/Test.d.ts +6 -0
- package/dist/core/Test.d.ts.map +1 -0
- package/dist/core/Test.js +15 -0
- package/dist/core/Test.js.map +1 -0
- package/dist/core/app/AppContext.cjs +344 -0
- package/dist/core/app/AppContext.cjs.map +1 -0
- package/dist/core/app/AppContext.d.ts +110 -0
- package/dist/core/app/AppContext.d.ts.map +1 -0
- package/dist/core/app/AppContext.js +333 -0
- package/dist/core/app/AppContext.js.map +1 -0
- package/dist/core/app/AppContext.types.cjs +6 -0
- package/dist/core/app/AppContext.types.cjs.map +1 -0
- package/dist/core/app/AppContext.types.d.ts +147 -0
- package/dist/core/app/AppContext.types.d.ts.map +1 -0
- package/dist/core/app/AppContext.types.js +5 -0
- package/dist/core/app/AppContext.types.js.map +1 -0
- package/dist/core/app/BasicLayout.cjs +89 -0
- package/dist/core/app/BasicLayout.cjs.map +1 -0
- package/dist/core/app/BasicLayout.d.ts +13 -0
- package/dist/core/app/BasicLayout.d.ts.map +1 -0
- package/dist/core/app/BasicLayout.js +39 -0
- package/dist/core/app/BasicLayout.js.map +1 -0
- package/dist/core/app/DefaultApp.cjs +201 -0
- package/dist/core/app/DefaultApp.cjs.map +1 -0
- package/dist/core/app/DefaultApp.d.ts +31 -0
- package/dist/core/app/DefaultApp.d.ts.map +1 -0
- package/dist/core/app/DefaultApp.js +192 -0
- package/dist/core/app/DefaultApp.js.map +1 -0
- package/dist/core/app/index.cjs +43 -0
- package/dist/core/app/index.cjs.map +1 -0
- package/dist/core/app/index.d.ts +9 -0
- package/dist/core/app/index.d.ts.map +1 -0
- package/dist/core/app/index.js +7 -0
- package/dist/core/app/index.js.map +1 -0
- package/dist/core/config/AppConfig.cjs +141 -0
- package/dist/core/config/AppConfig.cjs.map +1 -0
- package/dist/core/config/AppConfig.d.ts +89 -0
- package/dist/core/config/AppConfig.d.ts.map +1 -0
- package/dist/core/config/AppConfig.js +133 -0
- package/dist/core/config/AppConfig.js.map +1 -0
- package/dist/core/config/ConfigLoader.cjs +243 -0
- package/dist/core/config/ConfigLoader.cjs.map +1 -0
- package/dist/core/config/ConfigLoader.d.ts +103 -0
- package/dist/core/config/ConfigLoader.d.ts.map +1 -0
- package/dist/core/config/ConfigLoader.js +229 -0
- package/dist/core/config/ConfigLoader.js.map +1 -0
- package/dist/core/config/ConfigValidator.cjs +135 -0
- package/dist/core/config/ConfigValidator.cjs.map +1 -0
- package/dist/core/config/ConfigValidator.d.ts +85 -0
- package/dist/core/config/ConfigValidator.d.ts.map +1 -0
- package/dist/core/config/ConfigValidator.js +121 -0
- package/dist/core/config/ConfigValidator.js.map +1 -0
- package/dist/core/config/index.cjs +30 -0
- package/dist/core/config/index.cjs.map +1 -0
- package/dist/core/config/index.d.ts +7 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +7 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/dev/DevTools.cjs +374 -0
- package/dist/core/dev/DevTools.cjs.map +1 -0
- package/dist/core/dev/DevTools.d.ts +47 -0
- package/dist/core/dev/DevTools.d.ts.map +1 -0
- package/dist/core/dev/DevTools.js +363 -0
- package/dist/core/dev/DevTools.js.map +1 -0
- package/dist/core/error/ErrorBoundary.cjs +331 -0
- package/dist/core/error/ErrorBoundary.cjs.map +1 -0
- package/dist/core/error/ErrorBoundary.d.ts +123 -0
- package/dist/core/error/ErrorBoundary.d.ts.map +1 -0
- package/dist/core/error/ErrorBoundary.js +327 -0
- package/dist/core/error/ErrorBoundary.js.map +1 -0
- package/dist/core/error/index.cjs +26 -0
- package/dist/core/error/index.cjs.map +1 -0
- package/dist/core/error/index.d.ts +6 -0
- package/dist/core/error/index.d.ts.map +1 -0
- package/dist/core/error/index.js +5 -0
- package/dist/core/error/index.js.map +1 -0
- package/dist/core/index.cjs +140 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.ts +53 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +66 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/initialization/InitializationErrorThrower.cjs +77 -0
- package/dist/core/initialization/InitializationErrorThrower.cjs.map +1 -0
- package/dist/core/initialization/InitializationErrorThrower.d.ts +8 -0
- package/dist/core/initialization/InitializationErrorThrower.d.ts.map +1 -0
- package/dist/core/initialization/InitializationErrorThrower.js +30 -0
- package/dist/core/initialization/InitializationErrorThrower.js.map +1 -0
- package/dist/core/initialization/index.cjs +28 -0
- package/dist/core/initialization/index.cjs.map +1 -0
- package/dist/core/initialization/index.d.ts +8 -0
- package/dist/core/initialization/index.d.ts.map +1 -0
- package/dist/core/initialization/index.js +7 -0
- package/dist/core/initialization/index.js.map +1 -0
- package/dist/core/initialization/initialization.cjs +211 -0
- package/dist/core/initialization/initialization.cjs.map +1 -0
- package/dist/core/initialization/initialization.d.ts +127 -0
- package/dist/core/initialization/initialization.d.ts.map +1 -0
- package/dist/core/initialization/initialization.js +224 -0
- package/dist/core/initialization/initialization.js.map +1 -0
- package/dist/core/initialization/initializationErrorState.cjs +68 -0
- package/dist/core/initialization/initializationErrorState.cjs.map +1 -0
- package/dist/core/initialization/initializationErrorState.d.ts +36 -0
- package/dist/core/initialization/initializationErrorState.d.ts.map +1 -0
- package/dist/core/initialization/initializationErrorState.js +60 -0
- package/dist/core/initialization/initializationErrorState.js.map +1 -0
- package/dist/core/middleware.cjs +75 -0
- package/dist/core/middleware.cjs.map +1 -0
- package/dist/core/middleware.d.ts +37 -0
- package/dist/core/middleware.d.ts.map +1 -0
- package/dist/core/middleware.js +61 -0
- package/dist/core/middleware.js.map +1 -0
- package/dist/core/plugin/PluginEventBus.cjs +300 -0
- package/dist/core/plugin/PluginEventBus.cjs.map +1 -0
- package/dist/core/plugin/PluginEventBus.d.ts +170 -0
- package/dist/core/plugin/PluginEventBus.d.ts.map +1 -0
- package/dist/core/plugin/PluginEventBus.js +286 -0
- package/dist/core/plugin/PluginEventBus.js.map +1 -0
- package/dist/core/plugin/PluginSandbox.cjs +139 -0
- package/dist/core/plugin/PluginSandbox.cjs.map +1 -0
- package/dist/core/plugin/PluginSandbox.d.ts +102 -0
- package/dist/core/plugin/PluginSandbox.d.ts.map +1 -0
- package/dist/core/plugin/PluginSandbox.js +125 -0
- package/dist/core/plugin/PluginSandbox.js.map +1 -0
- package/dist/core/plugin.cjs +496 -0
- package/dist/core/plugin.cjs.map +1 -0
- package/dist/core/plugin.d.ts +221 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/plugin.js +438 -0
- package/dist/core/plugin.js.map +1 -0
- package/dist/core/router/RouterManager.cjs +239 -0
- package/dist/core/router/RouterManager.cjs.map +1 -0
- package/dist/core/router/RouterManager.d.ts +83 -0
- package/dist/core/router/RouterManager.d.ts.map +1 -0
- package/dist/core/router/RouterManager.js +223 -0
- package/dist/core/router/RouterManager.js.map +1 -0
- package/dist/core/router/adapter/AdapterManager.cjs +237 -0
- package/dist/core/router/adapter/AdapterManager.cjs.map +1 -0
- package/dist/core/router/adapter/AdapterManager.d.ts +95 -0
- package/dist/core/router/adapter/AdapterManager.d.ts.map +1 -0
- package/dist/core/router/adapter/AdapterManager.js +221 -0
- package/dist/core/router/adapter/AdapterManager.js.map +1 -0
- package/dist/core/router/adapter/index.cjs +24 -0
- package/dist/core/router/adapter/index.cjs.map +1 -0
- package/dist/core/router/adapter/index.d.ts +7 -0
- package/dist/core/router/adapter/index.d.ts.map +1 -0
- package/dist/core/router/adapter/index.js +7 -0
- package/dist/core/router/adapter/index.js.map +1 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.cjs +130 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.cjs.map +1 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.d.ts +44 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.d.ts.map +1 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.js +116 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.js.map +1 -0
- package/dist/core/router/adapter/react-router/index.cjs +22 -0
- package/dist/core/router/adapter/react-router/index.cjs.map +1 -0
- package/dist/core/router/adapter/react-router/index.d.ts +5 -0
- package/dist/core/router/adapter/react-router/index.d.ts.map +1 -0
- package/dist/core/router/adapter/react-router/index.js +5 -0
- package/dist/core/router/adapter/react-router/index.js.map +1 -0
- package/dist/core/router/adapter/types.cjs +8 -0
- package/dist/core/router/adapter/types.cjs.map +1 -0
- package/dist/core/router/adapter/types.d.ts +112 -0
- package/dist/core/router/adapter/types.d.ts.map +1 -0
- package/dist/core/router/adapter/types.js +7 -0
- package/dist/core/router/adapter/types.js.map +1 -0
- package/dist/core/router/dev/RouterDevTools.cjs +410 -0
- package/dist/core/router/dev/RouterDevTools.cjs.map +1 -0
- package/dist/core/router/dev/RouterDevTools.d.ts +10 -0
- package/dist/core/router/dev/RouterDevTools.d.ts.map +1 -0
- package/dist/core/router/dev/RouterDevTools.js +363 -0
- package/dist/core/router/dev/RouterDevTools.js.map +1 -0
- package/dist/core/router/dev/index.cjs +22 -0
- package/dist/core/router/dev/index.cjs.map +1 -0
- package/dist/core/router/dev/index.d.ts +5 -0
- package/dist/core/router/dev/index.d.ts.map +1 -0
- package/dist/core/router/dev/index.js +5 -0
- package/dist/core/router/dev/index.js.map +1 -0
- package/dist/core/router/dynamic/DynamicRouteManager.cjs +195 -0
- package/dist/core/router/dynamic/DynamicRouteManager.cjs.map +1 -0
- package/dist/core/router/dynamic/DynamicRouteManager.d.ts +72 -0
- package/dist/core/router/dynamic/DynamicRouteManager.d.ts.map +1 -0
- package/dist/core/router/dynamic/DynamicRouteManager.js +179 -0
- package/dist/core/router/dynamic/DynamicRouteManager.js.map +1 -0
- package/dist/core/router/dynamic/index.cjs +22 -0
- package/dist/core/router/dynamic/index.cjs.map +1 -0
- package/dist/core/router/dynamic/index.d.ts +5 -0
- package/dist/core/router/dynamic/index.d.ts.map +1 -0
- package/dist/core/router/dynamic/index.js +5 -0
- package/dist/core/router/dynamic/index.js.map +1 -0
- package/dist/core/router/errors/RouterError.cjs +63 -0
- package/dist/core/router/errors/RouterError.cjs.map +1 -0
- package/dist/core/router/errors/RouterError.d.ts +48 -0
- package/dist/core/router/errors/RouterError.d.ts.map +1 -0
- package/dist/core/router/errors/RouterError.js +48 -0
- package/dist/core/router/errors/RouterError.js.map +1 -0
- package/dist/core/router/errors/index.cjs +22 -0
- package/dist/core/router/errors/index.cjs.map +1 -0
- package/dist/core/router/errors/index.d.ts +5 -0
- package/dist/core/router/errors/index.d.ts.map +1 -0
- package/dist/core/router/errors/index.js +5 -0
- package/dist/core/router/errors/index.js.map +1 -0
- package/dist/core/router/index.cjs +38 -0
- package/dist/core/router/index.cjs.map +1 -0
- package/dist/core/router/index.d.ts +17 -0
- package/dist/core/router/index.d.ts.map +1 -0
- package/dist/core/router/index.js +32 -0
- package/dist/core/router/index.js.map +1 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.cjs +146 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.cjs.map +1 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.d.ts +57 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.d.ts.map +1 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.js +130 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.js.map +1 -0
- package/dist/core/router/lifecycle/index.cjs +22 -0
- package/dist/core/router/lifecycle/index.cjs.map +1 -0
- package/dist/core/router/lifecycle/index.d.ts +5 -0
- package/dist/core/router/lifecycle/index.d.ts.map +1 -0
- package/dist/core/router/lifecycle/index.js +5 -0
- package/dist/core/router/lifecycle/index.js.map +1 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.cjs +175 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.cjs.map +1 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.d.ts +61 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.d.ts.map +1 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.js +159 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.js.map +1 -0
- package/dist/core/router/middleware/auth.cjs +68 -0
- package/dist/core/router/middleware/auth.cjs.map +1 -0
- package/dist/core/router/middleware/auth.d.ts +55 -0
- package/dist/core/router/middleware/auth.d.ts.map +1 -0
- package/dist/core/router/middleware/auth.js +63 -0
- package/dist/core/router/middleware/auth.js.map +1 -0
- package/dist/core/router/middleware/index.cjs +24 -0
- package/dist/core/router/middleware/index.cjs.map +1 -0
- package/dist/core/router/middleware/index.d.ts +7 -0
- package/dist/core/router/middleware/index.d.ts.map +1 -0
- package/dist/core/router/middleware/index.js +7 -0
- package/dist/core/router/middleware/index.js.map +1 -0
- package/dist/core/router/middleware/types.cjs +8 -0
- package/dist/core/router/middleware/types.cjs.map +1 -0
- package/dist/core/router/middleware/types.d.ts +83 -0
- package/dist/core/router/middleware/types.d.ts.map +1 -0
- package/dist/core/router/middleware/types.js +7 -0
- package/dist/core/router/middleware/types.js.map +1 -0
- package/dist/core/router/monitoring/RouterMonitoring.cjs +229 -0
- package/dist/core/router/monitoring/RouterMonitoring.cjs.map +1 -0
- package/dist/core/router/monitoring/RouterMonitoring.d.ts +135 -0
- package/dist/core/router/monitoring/RouterMonitoring.d.ts.map +1 -0
- package/dist/core/router/monitoring/RouterMonitoring.js +213 -0
- package/dist/core/router/monitoring/RouterMonitoring.js.map +1 -0
- package/dist/core/router/monitoring/index.cjs +22 -0
- package/dist/core/router/monitoring/index.cjs.map +1 -0
- package/dist/core/router/monitoring/index.d.ts +5 -0
- package/dist/core/router/monitoring/index.d.ts.map +1 -0
- package/dist/core/router/monitoring/index.js +5 -0
- package/dist/core/router/monitoring/index.js.map +1 -0
- package/dist/core/router/navigation/RouterNavigation.cjs +186 -0
- package/dist/core/router/navigation/RouterNavigation.cjs.map +1 -0
- package/dist/core/router/navigation/RouterNavigation.d.ts +41 -0
- package/dist/core/router/navigation/RouterNavigation.d.ts.map +1 -0
- package/dist/core/router/navigation/RouterNavigation.js +137 -0
- package/dist/core/router/navigation/RouterNavigation.js.map +1 -0
- package/dist/core/router/navigation/index.cjs +22 -0
- package/dist/core/router/navigation/index.cjs.map +1 -0
- package/dist/core/router/navigation/index.d.ts +5 -0
- package/dist/core/router/navigation/index.d.ts.map +1 -0
- package/dist/core/router/navigation/index.js +5 -0
- package/dist/core/router/navigation/index.js.map +1 -0
- package/dist/core/router/performance/RouteCache.cjs +286 -0
- package/dist/core/router/performance/RouteCache.cjs.map +1 -0
- package/dist/core/router/performance/RouteCache.d.ts +108 -0
- package/dist/core/router/performance/RouteCache.d.ts.map +1 -0
- package/dist/core/router/performance/RouteCache.js +270 -0
- package/dist/core/router/performance/RouteCache.js.map +1 -0
- package/dist/core/router/performance/RoutePreloader.cjs +227 -0
- package/dist/core/router/performance/RoutePreloader.cjs.map +1 -0
- package/dist/core/router/performance/RoutePreloader.d.ts +104 -0
- package/dist/core/router/performance/RoutePreloader.d.ts.map +1 -0
- package/dist/core/router/performance/RoutePreloader.js +210 -0
- package/dist/core/router/performance/RoutePreloader.js.map +1 -0
- package/dist/core/router/performance/index.cjs +23 -0
- package/dist/core/router/performance/index.cjs.map +1 -0
- package/dist/core/router/performance/index.d.ts +6 -0
- package/dist/core/router/performance/index.d.ts.map +1 -0
- package/dist/core/router/performance/index.js +6 -0
- package/dist/core/router/performance/index.js.map +1 -0
- package/dist/core/router/plugin/RouterPluginManager.cjs +264 -0
- package/dist/core/router/plugin/RouterPluginManager.cjs.map +1 -0
- package/dist/core/router/plugin/RouterPluginManager.d.ts +75 -0
- package/dist/core/router/plugin/RouterPluginManager.d.ts.map +1 -0
- package/dist/core/router/plugin/RouterPluginManager.js +248 -0
- package/dist/core/router/plugin/RouterPluginManager.js.map +1 -0
- package/dist/core/router/plugin/index.cjs +23 -0
- package/dist/core/router/plugin/index.cjs.map +1 -0
- package/dist/core/router/plugin/index.d.ts +6 -0
- package/dist/core/router/plugin/index.d.ts.map +1 -0
- package/dist/core/router/plugin/index.js +6 -0
- package/dist/core/router/plugin/index.js.map +1 -0
- package/dist/core/router/plugin/types.cjs +41 -0
- package/dist/core/router/plugin/types.cjs.map +1 -0
- package/dist/core/router/plugin/types.d.ts +154 -0
- package/dist/core/router/plugin/types.d.ts.map +1 -0
- package/dist/core/router/plugin/types.js +33 -0
- package/dist/core/router/plugin/types.js.map +1 -0
- package/dist/core/router/types.cjs +6 -0
- package/dist/core/router/types.cjs.map +1 -0
- package/dist/core/router/types.d.ts +439 -0
- package/dist/core/router/types.d.ts.map +1 -0
- package/dist/core/router/types.js +5 -0
- package/dist/core/router/types.js.map +1 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs +139 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs.map +1 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +3 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.d.ts.map +1 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js +129 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js.map +1 -0
- package/dist/core/router/utils/adapters/react-router/transform.cjs +261 -0
- package/dist/core/router/utils/adapters/react-router/transform.cjs.map +1 -0
- package/dist/core/router/utils/adapters/react-router/transform.d.ts +6 -0
- package/dist/core/router/utils/adapters/react-router/transform.d.ts.map +1 -0
- package/dist/core/router/utils/adapters/react-router/transform.js +246 -0
- package/dist/core/router/utils/adapters/react-router/transform.js.map +1 -0
- package/dist/core/router/utils/transform.cjs +772 -0
- package/dist/core/router/utils/transform.cjs.map +1 -0
- package/dist/core/router/utils/transform.d.ts +349 -0
- package/dist/core/router/utils/transform.d.ts.map +1 -0
- package/dist/core/router/utils/transform.js +781 -0
- package/dist/core/router/utils/transform.js.map +1 -0
- package/dist/core/router/validation/RouterConfigValidator.cjs +85 -0
- package/dist/core/router/validation/RouterConfigValidator.cjs.map +1 -0
- package/dist/core/router/validation/RouterConfigValidator.d.ts +58 -0
- package/dist/core/router/validation/RouterConfigValidator.d.ts.map +1 -0
- package/dist/core/router/validation/RouterConfigValidator.js +77 -0
- package/dist/core/router/validation/RouterConfigValidator.js.map +1 -0
- package/dist/core/router/validation/index.cjs +23 -0
- package/dist/core/router/validation/index.cjs.map +1 -0
- package/dist/core/router/validation/index.d.ts +6 -0
- package/dist/core/router/validation/index.d.ts.map +1 -0
- package/dist/core/router/validation/index.js +6 -0
- package/dist/core/router/validation/index.js.map +1 -0
- package/dist/core/router/validation/schema.cjs +91 -0
- package/dist/core/router/validation/schema.cjs.map +1 -0
- package/dist/core/router/validation/schema.d.ts +82 -0
- package/dist/core/router/validation/schema.d.ts.map +1 -0
- package/dist/core/router/validation/schema.js +81 -0
- package/dist/core/router/validation/schema.js.map +1 -0
- package/dist/core/router/version/RouteVersionManager.cjs +207 -0
- package/dist/core/router/version/RouteVersionManager.cjs.map +1 -0
- package/dist/core/router/version/RouteVersionManager.d.ts +125 -0
- package/dist/core/router/version/RouteVersionManager.d.ts.map +1 -0
- package/dist/core/router/version/RouteVersionManager.js +191 -0
- package/dist/core/router/version/RouteVersionManager.js.map +1 -0
- package/dist/core/router/version/index.cjs +22 -0
- package/dist/core/router/version/index.cjs.map +1 -0
- package/dist/core/router/version/index.d.ts +5 -0
- package/dist/core/router/version/index.d.ts.map +1 -0
- package/dist/core/router/version/index.js +5 -0
- package/dist/core/router/version/index.js.map +1 -0
- package/dist/core/splash/SplashScreen.cjs +257 -0
- package/dist/core/splash/SplashScreen.cjs.map +1 -0
- package/dist/core/splash/SplashScreen.d.ts +15 -0
- package/dist/core/splash/SplashScreen.d.ts.map +1 -0
- package/dist/core/splash/SplashScreen.js +207 -0
- package/dist/core/splash/SplashScreen.js.map +1 -0
- package/dist/core/splash/index.cjs +24 -0
- package/dist/core/splash/index.cjs.map +1 -0
- package/dist/core/splash/index.d.ts +6 -0
- package/dist/core/splash/index.d.ts.map +1 -0
- package/dist/core/splash/index.js +6 -0
- package/dist/core/splash/index.js.map +1 -0
- package/dist/core/splash/splashScreenUtils.cjs +40 -0
- package/dist/core/splash/splashScreenUtils.cjs.map +1 -0
- package/dist/core/splash/splashScreenUtils.d.ts +8 -0
- package/dist/core/splash/splashScreenUtils.d.ts.map +1 -0
- package/dist/core/splash/splashScreenUtils.js +30 -0
- package/dist/core/splash/splashScreenUtils.js.map +1 -0
- package/dist/core/startup/AppInstance.cjs +233 -0
- package/dist/core/startup/AppInstance.cjs.map +1 -0
- package/dist/core/startup/AppInstance.d.ts +135 -0
- package/dist/core/startup/AppInstance.d.ts.map +1 -0
- package/dist/core/startup/AppInstance.js +218 -0
- package/dist/core/startup/AppInstance.js.map +1 -0
- package/dist/core/startup/environment.cjs +171 -0
- package/dist/core/startup/environment.cjs.map +1 -0
- package/dist/core/startup/environment.d.ts +88 -0
- package/dist/core/startup/environment.d.ts.map +1 -0
- package/dist/core/startup/environment.js +154 -0
- package/dist/core/startup/environment.js.map +1 -0
- package/dist/core/startup/index.cjs +25 -0
- package/dist/core/startup/index.cjs.map +1 -0
- package/dist/core/startup/index.d.ts +8 -0
- package/dist/core/startup/index.d.ts.map +1 -0
- package/dist/core/startup/index.js +8 -0
- package/dist/core/startup/index.js.map +1 -0
- package/dist/core/startup/initializeServices.cjs +166 -0
- package/dist/core/startup/initializeServices.cjs.map +1 -0
- package/dist/core/startup/initializeServices.d.ts +57 -0
- package/dist/core/startup/initializeServices.d.ts.map +1 -0
- package/dist/core/startup/initializeServices.js +124 -0
- package/dist/core/startup/initializeServices.js.map +1 -0
- package/dist/core/startup/performanceTracker.cjs +181 -0
- package/dist/core/startup/performanceTracker.cjs.map +1 -0
- package/dist/core/startup/performanceTracker.d.ts +105 -0
- package/dist/core/startup/performanceTracker.d.ts.map +1 -0
- package/dist/core/startup/performanceTracker.js +167 -0
- package/dist/core/startup/performanceTracker.js.map +1 -0
- package/dist/core/startup/renderApp.cjs +275 -0
- package/dist/core/startup/renderApp.cjs.map +1 -0
- package/dist/core/startup/renderApp.d.ts +71 -0
- package/dist/core/startup/renderApp.d.ts.map +1 -0
- package/dist/core/startup/renderApp.js +226 -0
- package/dist/core/startup/renderApp.js.map +1 -0
- package/dist/core/startup/startApp.cjs +151 -0
- package/dist/core/startup/startApp.cjs.map +1 -0
- package/dist/core/startup/startApp.d.ts +15 -0
- package/dist/core/startup/startApp.d.ts.map +1 -0
- package/dist/core/startup/startApp.js +147 -0
- package/dist/core/startup/startApp.js.map +1 -0
- package/dist/core/types.cjs +6 -0
- package/dist/core/types.cjs.map +1 -0
- package/dist/core/types.d.ts +461 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.cjs +152 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/library/index.cjs +21 -0
- package/dist/library/index.cjs.map +1 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.d.ts.map +1 -0
- package/dist/library/index.js +4 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/locale/index.cjs +56 -0
- package/dist/library/locale/index.cjs.map +1 -0
- package/dist/library/locale/index.d.ts +6 -0
- package/dist/library/locale/index.d.ts.map +1 -0
- package/dist/library/locale/index.js +30 -0
- package/dist/library/locale/index.js.map +1 -0
- package/dist/library/locale/langs/en-us/index.cjs +34 -0
- package/dist/library/locale/langs/en-us/index.cjs.map +1 -0
- package/dist/library/locale/langs/en-us/index.d.ts +4 -0
- package/dist/library/locale/langs/en-us/index.d.ts.map +1 -0
- package/dist/library/locale/langs/en-us/index.js +24 -0
- package/dist/library/locale/langs/en-us/index.js.map +1 -0
- package/dist/library/locale/langs/zh-cn/index.cjs +34 -0
- package/dist/library/locale/langs/zh-cn/index.cjs.map +1 -0
- package/dist/library/locale/langs/zh-cn/index.d.ts +4 -0
- package/dist/library/locale/langs/zh-cn/index.d.ts.map +1 -0
- package/dist/library/locale/langs/zh-cn/index.js +24 -0
- package/dist/library/locale/langs/zh-cn/index.js.map +1 -0
- package/dist/library/locale/types.cjs +6 -0
- package/dist/library/locale/types.cjs.map +1 -0
- package/dist/library/locale/types.d.ts +39 -0
- package/dist/library/locale/types.d.ts.map +1 -0
- package/dist/library/locale/types.js +3 -0
- package/dist/library/locale/types.js.map +1 -0
- package/dist/library/storage/cache.cjs +245 -0
- package/dist/library/storage/cache.cjs.map +1 -0
- package/dist/library/storage/cache.d.ts +58 -0
- package/dist/library/storage/cache.d.ts.map +1 -0
- package/dist/library/storage/cache.js +237 -0
- package/dist/library/storage/cache.js.map +1 -0
- package/dist/library/storage/encryption.cjs +150 -0
- package/dist/library/storage/encryption.cjs.map +1 -0
- package/dist/library/storage/encryption.d.ts +46 -0
- package/dist/library/storage/encryption.d.ts.map +1 -0
- package/dist/library/storage/encryption.js +142 -0
- package/dist/library/storage/encryption.js.map +1 -0
- package/dist/library/storage/index.cjs +126 -0
- package/dist/library/storage/index.cjs.map +1 -0
- package/dist/library/storage/index.d.ts +62 -0
- package/dist/library/storage/index.d.ts.map +1 -0
- package/dist/library/storage/index.js +106 -0
- package/dist/library/storage/index.js.map +1 -0
- package/dist/request/adapter/RequestAdapter.cjs +78 -0
- package/dist/request/adapter/RequestAdapter.cjs.map +1 -0
- package/dist/request/adapter/RequestAdapter.d.ts +86 -0
- package/dist/request/adapter/RequestAdapter.d.ts.map +1 -0
- package/dist/request/adapter/RequestAdapter.js +70 -0
- package/dist/request/adapter/RequestAdapter.js.map +1 -0
- package/dist/request/adapter/axiosAdapter.cjs +164 -0
- package/dist/request/adapter/axiosAdapter.cjs.map +1 -0
- package/dist/request/adapter/axiosAdapter.d.ts +11 -0
- package/dist/request/adapter/axiosAdapter.d.ts.map +1 -0
- package/dist/request/adapter/axiosAdapter.js +115 -0
- package/dist/request/adapter/axiosAdapter.js.map +1 -0
- package/dist/request/adapter/fetchAdapter.cjs +134 -0
- package/dist/request/adapter/fetchAdapter.cjs.map +1 -0
- package/dist/request/adapter/fetchAdapter.d.ts +11 -0
- package/dist/request/adapter/fetchAdapter.d.ts.map +1 -0
- package/dist/request/adapter/fetchAdapter.js +126 -0
- package/dist/request/adapter/fetchAdapter.js.map +1 -0
- package/dist/request/adapter/index.cjs +80 -0
- package/dist/request/adapter/index.cjs.map +1 -0
- package/dist/request/adapter/index.d.ts +10 -0
- package/dist/request/adapter/index.d.ts.map +1 -0
- package/dist/request/adapter/index.js +14 -0
- package/dist/request/adapter/index.js.map +1 -0
- package/dist/request/adapter/kyAdapter.cjs +191 -0
- package/dist/request/adapter/kyAdapter.cjs.map +1 -0
- package/dist/request/adapter/kyAdapter.d.ts +11 -0
- package/dist/request/adapter/kyAdapter.d.ts.map +1 -0
- package/dist/request/adapter/kyAdapter.js +142 -0
- package/dist/request/adapter/kyAdapter.js.map +1 -0
- package/dist/request/adapter/undiciAdapter.cjs +213 -0
- package/dist/request/adapter/undiciAdapter.cjs.map +1 -0
- package/dist/request/adapter/undiciAdapter.d.ts +11 -0
- package/dist/request/adapter/undiciAdapter.d.ts.map +1 -0
- package/dist/request/adapter/undiciAdapter.js +164 -0
- package/dist/request/adapter/undiciAdapter.js.map +1 -0
- package/dist/request/core/RequestClient.cjs +539 -0
- package/dist/request/core/RequestClient.cjs.map +1 -0
- package/dist/request/core/RequestClient.d.ts +127 -0
- package/dist/request/core/RequestClient.d.ts.map +1 -0
- package/dist/request/core/RequestClient.js +490 -0
- package/dist/request/core/RequestClient.js.map +1 -0
- package/dist/request/core/index.cjs +15 -0
- package/dist/request/core/index.cjs.map +1 -0
- package/dist/request/core/index.d.ts +6 -0
- package/dist/request/core/index.d.ts.map +1 -0
- package/dist/request/core/index.js +5 -0
- package/dist/request/core/index.js.map +1 -0
- package/dist/request/index.cjs +146 -0
- package/dist/request/index.cjs.map +1 -0
- package/dist/request/index.d.ts +43 -0
- package/dist/request/index.d.ts.map +1 -0
- package/dist/request/index.js +50 -0
- package/dist/request/index.js.map +1 -0
- package/dist/request/plugin/RequestPlugin.cjs +218 -0
- package/dist/request/plugin/RequestPlugin.cjs.map +1 -0
- package/dist/request/plugin/RequestPlugin.d.ts +171 -0
- package/dist/request/plugin/RequestPlugin.d.ts.map +1 -0
- package/dist/request/plugin/RequestPlugin.js +203 -0
- package/dist/request/plugin/RequestPlugin.js.map +1 -0
- package/dist/request/plugin/cache.cjs +269 -0
- package/dist/request/plugin/cache.cjs.map +1 -0
- package/dist/request/plugin/cache.d.ts +34 -0
- package/dist/request/plugin/cache.d.ts.map +1 -0
- package/dist/request/plugin/cache.js +264 -0
- package/dist/request/plugin/cache.js.map +1 -0
- package/dist/request/plugin/csrfPlugin.cjs +40 -0
- package/dist/request/plugin/csrfPlugin.cjs.map +1 -0
- package/dist/request/plugin/csrfPlugin.d.ts +22 -0
- package/dist/request/plugin/csrfPlugin.d.ts.map +1 -0
- package/dist/request/plugin/csrfPlugin.js +44 -0
- package/dist/request/plugin/csrfPlugin.js.map +1 -0
- package/dist/request/plugin/index.cjs +49 -0
- package/dist/request/plugin/index.cjs.map +1 -0
- package/dist/request/plugin/index.d.ts +11 -0
- package/dist/request/plugin/index.d.ts.map +1 -0
- package/dist/request/plugin/index.js +11 -0
- package/dist/request/plugin/index.js.map +1 -0
- package/dist/request/plugin/monitoring.cjs +216 -0
- package/dist/request/plugin/monitoring.cjs.map +1 -0
- package/dist/request/plugin/monitoring.d.ts +113 -0
- package/dist/request/plugin/monitoring.d.ts.map +1 -0
- package/dist/request/plugin/monitoring.js +205 -0
- package/dist/request/plugin/monitoring.js.map +1 -0
- package/dist/request/plugin/retry.cjs +98 -0
- package/dist/request/plugin/retry.cjs.map +1 -0
- package/dist/request/plugin/retry.d.ts +35 -0
- package/dist/request/plugin/retry.d.ts.map +1 -0
- package/dist/request/plugin/retry.js +93 -0
- package/dist/request/plugin/retry.js.map +1 -0
- package/dist/request/plugin/validation.cjs +121 -0
- package/dist/request/plugin/validation.cjs.map +1 -0
- package/dist/request/plugin/validation.d.ts +27 -0
- package/dist/request/plugin/validation.d.ts.map +1 -0
- package/dist/request/plugin/validation.js +116 -0
- package/dist/request/plugin/validation.js.map +1 -0
- package/dist/request/runtime/RequestContext.cjs +77 -0
- package/dist/request/runtime/RequestContext.cjs.map +1 -0
- package/dist/request/runtime/RequestContext.d.ts +51 -0
- package/dist/request/runtime/RequestContext.d.ts.map +1 -0
- package/dist/request/runtime/RequestContext.js +86 -0
- package/dist/request/runtime/RequestContext.js.map +1 -0
- package/dist/request/runtime/index.cjs +32 -0
- package/dist/request/runtime/index.cjs.map +1 -0
- package/dist/request/runtime/index.d.ts +5 -0
- package/dist/request/runtime/index.d.ts.map +1 -0
- package/dist/request/runtime/index.js +5 -0
- package/dist/request/runtime/index.js.map +1 -0
- package/dist/request/types.cjs +112 -0
- package/dist/request/types.cjs.map +1 -0
- package/dist/request/types.d.ts +395 -0
- package/dist/request/types.d.ts.map +1 -0
- package/dist/request/types.js +97 -0
- package/dist/request/types.js.map +1 -0
- package/dist/request/utils/dependencyCheck.cjs +237 -0
- package/dist/request/utils/dependencyCheck.cjs.map +1 -0
- package/dist/request/utils/dependencyCheck.d.ts +64 -0
- package/dist/request/utils/dependencyCheck.d.ts.map +1 -0
- package/dist/request/utils/dependencyCheck.js +192 -0
- package/dist/request/utils/dependencyCheck.js.map +1 -0
- package/dist/request/utils/index.cjs +26 -0
- package/dist/request/utils/index.cjs.map +1 -0
- package/dist/request/utils/index.d.ts +5 -0
- package/dist/request/utils/index.d.ts.map +1 -0
- package/dist/request/utils/index.js +5 -0
- package/dist/request/utils/index.js.map +1 -0
- package/dist/state/StateManager.cjs +168 -0
- package/dist/state/StateManager.cjs.map +1 -0
- package/dist/state/StateManager.d.ts +121 -0
- package/dist/state/StateManager.d.ts.map +1 -0
- package/dist/state/StateManager.js +160 -0
- package/dist/state/StateManager.js.map +1 -0
- package/dist/state/adapters/AdapterFactory.cjs +91 -0
- package/dist/state/adapters/AdapterFactory.cjs.map +1 -0
- package/dist/state/adapters/AdapterFactory.d.ts +52 -0
- package/dist/state/adapters/AdapterFactory.d.ts.map +1 -0
- package/dist/state/adapters/AdapterFactory.js +85 -0
- package/dist/state/adapters/AdapterFactory.js.map +1 -0
- package/dist/state/adapters/DefaultAdapter.cjs +77 -0
- package/dist/state/adapters/DefaultAdapter.cjs.map +1 -0
- package/dist/state/adapters/DefaultAdapter.d.ts +39 -0
- package/dist/state/adapters/DefaultAdapter.d.ts.map +1 -0
- package/dist/state/adapters/DefaultAdapter.js +71 -0
- package/dist/state/adapters/DefaultAdapter.js.map +1 -0
- package/dist/state/adapters/ReduxAdapter.cjs +445 -0
- package/dist/state/adapters/ReduxAdapter.cjs.map +1 -0
- package/dist/state/adapters/ReduxAdapter.d.ts +130 -0
- package/dist/state/adapters/ReduxAdapter.d.ts.map +1 -0
- package/dist/state/adapters/ReduxAdapter.js +439 -0
- package/dist/state/adapters/ReduxAdapter.js.map +1 -0
- package/dist/state/adapters/ZustandAdapter.cjs +71 -0
- package/dist/state/adapters/ZustandAdapter.cjs.map +1 -0
- package/dist/state/adapters/ZustandAdapter.d.ts +47 -0
- package/dist/state/adapters/ZustandAdapter.d.ts.map +1 -0
- package/dist/state/adapters/ZustandAdapter.js +70 -0
- package/dist/state/adapters/ZustandAdapter.js.map +1 -0
- package/dist/state/adapters/index.cjs +46 -0
- package/dist/state/adapters/index.cjs.map +1 -0
- package/dist/state/adapters/index.d.ts +9 -0
- package/dist/state/adapters/index.d.ts.map +1 -0
- package/dist/state/adapters/index.js +9 -0
- package/dist/state/adapters/index.js.map +1 -0
- package/dist/state/adapters/types.cjs +22 -0
- package/dist/state/adapters/types.cjs.map +1 -0
- package/dist/state/adapters/types.d.ts +5 -0
- package/dist/state/adapters/types.d.ts.map +1 -0
- package/dist/state/adapters/types.js +5 -0
- package/dist/state/adapters/types.js.map +1 -0
- package/dist/state/core/DerivedStateInstance.cjs +176 -0
- package/dist/state/core/DerivedStateInstance.cjs.map +1 -0
- package/dist/state/core/DerivedStateInstance.d.ts +101 -0
- package/dist/state/core/DerivedStateInstance.d.ts.map +1 -0
- package/dist/state/core/DerivedStateInstance.js +173 -0
- package/dist/state/core/DerivedStateInstance.js.map +1 -0
- package/dist/state/core/StateInstance.cjs +172 -0
- package/dist/state/core/StateInstance.cjs.map +1 -0
- package/dist/state/core/StateInstance.d.ts +86 -0
- package/dist/state/core/StateInstance.d.ts.map +1 -0
- package/dist/state/core/StateInstance.js +168 -0
- package/dist/state/core/StateInstance.js.map +1 -0
- package/dist/state/core/StateRegistry.cjs +112 -0
- package/dist/state/core/StateRegistry.cjs.map +1 -0
- package/dist/state/core/StateRegistry.d.ts +56 -0
- package/dist/state/core/StateRegistry.d.ts.map +1 -0
- package/dist/state/core/StateRegistry.js +106 -0
- package/dist/state/core/StateRegistry.js.map +1 -0
- package/dist/state/core/StateScope.cjs +139 -0
- package/dist/state/core/StateScope.cjs.map +1 -0
- package/dist/state/core/StateScope.d.ts +72 -0
- package/dist/state/core/StateScope.d.ts.map +1 -0
- package/dist/state/core/StateScope.js +133 -0
- package/dist/state/core/StateScope.js.map +1 -0
- package/dist/state/core/index.cjs +32 -0
- package/dist/state/core/index.cjs.map +1 -0
- package/dist/state/core/index.d.ts +8 -0
- package/dist/state/core/index.d.ts.map +1 -0
- package/dist/state/core/index.js +8 -0
- package/dist/state/core/index.js.map +1 -0
- package/dist/state/index.cjs +32 -0
- package/dist/state/index.cjs.map +1 -0
- package/dist/state/index.d.ts +9 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +12 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/types.cjs +14 -0
- package/dist/state/types.cjs.map +1 -0
- package/dist/state/types.d.ts +231 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/state/types.js +13 -0
- package/dist/state/types.js.map +1 -0
- package/dist/types.cjs +6 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/analytics.cjs +219 -0
- package/dist/utils/analytics.cjs.map +1 -0
- package/dist/utils/analytics.d.ts +128 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +204 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/configSecurity.cjs +184 -0
- package/dist/utils/configSecurity.cjs.map +1 -0
- package/dist/utils/configSecurity.d.ts +101 -0
- package/dist/utils/configSecurity.d.ts.map +1 -0
- package/dist/utils/configSecurity.js +176 -0
- package/dist/utils/configSecurity.js.map +1 -0
- package/dist/utils/csrf.cjs +159 -0
- package/dist/utils/csrf.cjs.map +1 -0
- package/dist/utils/csrf.d.ts +73 -0
- package/dist/utils/csrf.d.ts.map +1 -0
- package/dist/utils/csrf.js +144 -0
- package/dist/utils/csrf.js.map +1 -0
- package/dist/utils/errors/ErrorCodes.cjs +97 -0
- package/dist/utils/errors/ErrorCodes.cjs.map +1 -0
- package/dist/utils/errors/ErrorCodes.d.ts +46 -0
- package/dist/utils/errors/ErrorCodes.d.ts.map +1 -0
- package/dist/utils/errors/ErrorCodes.js +86 -0
- package/dist/utils/errors/ErrorCodes.js.map +1 -0
- package/dist/utils/errors.cjs +343 -0
- package/dist/utils/errors.cjs.map +1 -0
- package/dist/utils/errors.d.ts +179 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +311 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.cjs +137 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.ts +40 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +48 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.cjs +396 -0
- package/dist/utils/logger.cjs.map +1 -0
- package/dist/utils/logger.d.ts +190 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +381 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/logger.types.cjs +22 -0
- package/dist/utils/logger.types.cjs.map +1 -0
- package/dist/utils/logger.types.d.ts +58 -0
- package/dist/utils/logger.types.d.ts.map +1 -0
- package/dist/utils/logger.types.js +12 -0
- package/dist/utils/logger.types.js.map +1 -0
- package/dist/utils/monitoring.cjs +311 -0
- package/dist/utils/monitoring.cjs.map +1 -0
- package/dist/utils/monitoring.d.ts +164 -0
- package/dist/utils/monitoring.d.ts.map +1 -0
- package/dist/utils/monitoring.js +296 -0
- package/dist/utils/monitoring.js.map +1 -0
- package/dist/utils/performance.cjs +371 -0
- package/dist/utils/performance.cjs.map +1 -0
- package/dist/utils/performance.d.ts +247 -0
- package/dist/utils/performance.d.ts.map +1 -0
- package/dist/utils/performance.js +356 -0
- package/dist/utils/performance.js.map +1 -0
- package/dist/utils/resourceLoader.cjs +322 -0
- package/dist/utils/resourceLoader.cjs.map +1 -0
- package/dist/utils/resourceLoader.d.ts +131 -0
- package/dist/utils/resourceLoader.d.ts.map +1 -0
- package/dist/utils/resourceLoader.js +307 -0
- package/dist/utils/resourceLoader.js.map +1 -0
- package/dist/utils/runtimeSecurity.cjs +151 -0
- package/dist/utils/runtimeSecurity.cjs.map +1 -0
- package/dist/utils/runtimeSecurity.d.ts +105 -0
- package/dist/utils/runtimeSecurity.d.ts.map +1 -0
- package/dist/utils/runtimeSecurity.js +143 -0
- package/dist/utils/runtimeSecurity.js.map +1 -0
- package/dist/utils/security.cjs +332 -0
- package/dist/utils/security.cjs.map +1 -0
- package/dist/utils/security.d.ts +81 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +313 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/traceId.cjs +140 -0
- package/dist/utils/traceId.cjs.map +1 -0
- package/dist/utils/traceId.d.ts +64 -0
- package/dist/utils/traceId.d.ts.map +1 -0
- package/dist/utils/traceId.js +118 -0
- package/dist/utils/traceId.js.map +1 -0
- package/dist/utils/validation.cjs +191 -0
- package/dist/utils/validation.cjs.map +1 -0
- package/dist/utils/validation.d.ts +111 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +177 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "transformRoutes", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return transformRoutes;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _utils = require("../../../utils");
|
|
12
|
+
function _define_property(obj, key, value) {
|
|
13
|
+
if (key in obj) {
|
|
14
|
+
Object.defineProperty(obj, key, {
|
|
15
|
+
value: value,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
obj[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
25
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
26
|
+
if (typeof WeakMap !== "function") return null;
|
|
27
|
+
var cacheBabelInterop = new WeakMap();
|
|
28
|
+
var cacheNodeInterop = new WeakMap();
|
|
29
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
30
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
31
|
+
})(nodeInterop);
|
|
32
|
+
}
|
|
33
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
34
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
35
|
+
return obj;
|
|
36
|
+
}
|
|
37
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
38
|
+
return {
|
|
39
|
+
default: obj
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
43
|
+
if (cache && cache.has(obj)) {
|
|
44
|
+
return cache.get(obj);
|
|
45
|
+
}
|
|
46
|
+
var newObj = {
|
|
47
|
+
__proto__: null
|
|
48
|
+
};
|
|
49
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
50
|
+
for(var key in obj){
|
|
51
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
52
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
53
|
+
if (desc && (desc.get || desc.set)) {
|
|
54
|
+
Object.defineProperty(newObj, key, desc);
|
|
55
|
+
} else {
|
|
56
|
+
newObj[key] = obj[key];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
newObj.default = obj;
|
|
61
|
+
if (cache) {
|
|
62
|
+
cache.set(obj, newObj);
|
|
63
|
+
}
|
|
64
|
+
return newObj;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* LRU 缓存实现
|
|
68
|
+
*/ let LRUCache = class LRUCache {
|
|
69
|
+
get(key) {
|
|
70
|
+
const item = this.cache.get(key);
|
|
71
|
+
if (item) {
|
|
72
|
+
// 更新访问时间
|
|
73
|
+
item.accessTime = Date.now();
|
|
74
|
+
// 移动到末尾(最近使用)
|
|
75
|
+
this.cache.delete(key);
|
|
76
|
+
this.cache.set(key, item);
|
|
77
|
+
}
|
|
78
|
+
return item;
|
|
79
|
+
}
|
|
80
|
+
set(key, value) {
|
|
81
|
+
// 如果已存在,先删除
|
|
82
|
+
if (this.cache.has(key)) {
|
|
83
|
+
this.cache.delete(key);
|
|
84
|
+
} else if (this.cache.size >= this.maxSize) {
|
|
85
|
+
// 如果达到最大大小,删除最久未使用的项(第一个)
|
|
86
|
+
const firstKey = this.cache.keys().next().value;
|
|
87
|
+
if (firstKey) {
|
|
88
|
+
this.cache.delete(firstKey);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
value.accessTime = Date.now();
|
|
92
|
+
this.cache.set(key, value);
|
|
93
|
+
}
|
|
94
|
+
delete(key) {
|
|
95
|
+
return this.cache.delete(key);
|
|
96
|
+
}
|
|
97
|
+
clear() {
|
|
98
|
+
this.cache.clear();
|
|
99
|
+
}
|
|
100
|
+
size() {
|
|
101
|
+
return this.cache.size;
|
|
102
|
+
}
|
|
103
|
+
cleanupExpired(cacheTTL) {
|
|
104
|
+
const now = Date.now();
|
|
105
|
+
for (const [key, item] of this.cache.entries()){
|
|
106
|
+
if (now - item.timestamp > cacheTTL) {
|
|
107
|
+
this.cache.delete(key);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
constructor(maxSize = 50){
|
|
112
|
+
_define_property(this, "cache", new Map());
|
|
113
|
+
_define_property(this, "maxSize", void 0);
|
|
114
|
+
this.maxSize = maxSize;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* 转换缓存(使用 LRU 缓存)
|
|
119
|
+
*/ let transformCache = null;
|
|
120
|
+
/**
|
|
121
|
+
* 默认配置
|
|
122
|
+
*/ const DEFAULT_OPTIONS = {
|
|
123
|
+
pathValidation: {
|
|
124
|
+
enablePathValidation: true,
|
|
125
|
+
allowedPathPrefixes: [],
|
|
126
|
+
maxPathLength: 500,
|
|
127
|
+
allowAbsolutePaths: false
|
|
128
|
+
},
|
|
129
|
+
performance: {
|
|
130
|
+
enableCache: true,
|
|
131
|
+
cacheTTL: 5 * 60 * 1000,
|
|
132
|
+
maxCacheSize: 50,
|
|
133
|
+
maxRecursionDepth: 100,
|
|
134
|
+
enableParallelProcessing: true,
|
|
135
|
+
parallelBatchSize: 10
|
|
136
|
+
},
|
|
137
|
+
enableDebugLog: false
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* 优化的字符串哈希函数(用于缓存键)
|
|
141
|
+
* 使用更高效的哈希算法,支持大字符串
|
|
142
|
+
*/ function optimizedHash(str) {
|
|
143
|
+
// 对于小字符串,使用快速哈希
|
|
144
|
+
if (str.length < 100) {
|
|
145
|
+
let hash = 0;
|
|
146
|
+
for(let i = 0; i < str.length; i++){
|
|
147
|
+
const char = str.charCodeAt(i);
|
|
148
|
+
hash = (hash << 5) - hash + char;
|
|
149
|
+
hash = hash & hash; // 转换为 32 位整数
|
|
150
|
+
}
|
|
151
|
+
return Math.abs(hash).toString(36);
|
|
152
|
+
}
|
|
153
|
+
// 对于大字符串,使用分段哈希
|
|
154
|
+
let hash = 0;
|
|
155
|
+
const step = Math.max(1, Math.floor(str.length / 100));
|
|
156
|
+
for(let i = 0; i < str.length; i += step){
|
|
157
|
+
const char = str.charCodeAt(i);
|
|
158
|
+
hash = (hash << 5) - hash + char;
|
|
159
|
+
hash = hash & hash;
|
|
160
|
+
}
|
|
161
|
+
return Math.abs(hash).toString(36);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 使用 crypto API 的哈希函数(如果可用)
|
|
165
|
+
* 保留此函数供未来使用(异步哈希场景)
|
|
166
|
+
*/ // async function cryptoHash(str: string): Promise<string> {
|
|
167
|
+
// // 检查是否支持 crypto API
|
|
168
|
+
// if (typeof crypto !== 'undefined' && crypto.subtle && crypto.subtle.digest) {
|
|
169
|
+
// try {
|
|
170
|
+
// const encoder = new TextEncoder();
|
|
171
|
+
// const data = encoder.encode(str);
|
|
172
|
+
// const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
173
|
+
// const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
174
|
+
// return hashArray.map(b => b.toString(16).padStart(2, '0')).join('').substring(0, 16);
|
|
175
|
+
// } catch {
|
|
176
|
+
// // 如果 crypto API 失败,回退到优化哈希
|
|
177
|
+
// return optimizedHash(str);
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
// return optimizedHash(str);
|
|
181
|
+
// }
|
|
182
|
+
/**
|
|
183
|
+
* 同步哈希函数(用于同步场景)
|
|
184
|
+
*/ function simpleHash(str) {
|
|
185
|
+
return optimizedHash(str);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* 配置序列化缓存(避免重复序列化)
|
|
189
|
+
*/ const configStringCache = new Map();
|
|
190
|
+
/**
|
|
191
|
+
* 生成配置哈希(用于缓存键)
|
|
192
|
+
* 优化:缓存序列化结果,避免重复序列化
|
|
193
|
+
*/ function generateConfigHash(routes) {
|
|
194
|
+
try {
|
|
195
|
+
// 快速检查:如果路由数量为 0,直接返回
|
|
196
|
+
if (routes.length === 0) {
|
|
197
|
+
return 'empty';
|
|
198
|
+
}
|
|
199
|
+
// 使用路由数量作为快速键的一部分
|
|
200
|
+
const quickKey = `${routes.length}_${routes[0]?.name || ''}_${routes[routes.length - 1]?.name || ''}`;
|
|
201
|
+
// 检查序列化缓存
|
|
202
|
+
if (configStringCache.has(quickKey)) {
|
|
203
|
+
const cachedStr = configStringCache.get(quickKey);
|
|
204
|
+
// 验证缓存是否仍然有效(简单检查)
|
|
205
|
+
const currentStr = JSON.stringify(routes, null, 0).substring(0, 100);
|
|
206
|
+
if (cachedStr.startsWith(currentStr.substring(0, 50))) {
|
|
207
|
+
return simpleHash(cachedStr);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// 使用 JSON.stringify 生成配置的字符串表示
|
|
211
|
+
// 只包含影响转换结果的字段
|
|
212
|
+
const configStr = JSON.stringify(routes, (key, value)=>{
|
|
213
|
+
// 只序列化相关字段
|
|
214
|
+
if ([
|
|
215
|
+
'name',
|
|
216
|
+
'path',
|
|
217
|
+
'page',
|
|
218
|
+
'layout',
|
|
219
|
+
'errors',
|
|
220
|
+
'loading',
|
|
221
|
+
'isGroup',
|
|
222
|
+
'enableRedirection',
|
|
223
|
+
'children'
|
|
224
|
+
].includes(key)) {
|
|
225
|
+
return value;
|
|
226
|
+
}
|
|
227
|
+
if (key === 'handle' && value && typeof value === 'object') {
|
|
228
|
+
// 只序列化 handle 的基本字段
|
|
229
|
+
return {
|
|
230
|
+
title: value.title,
|
|
231
|
+
order: value.order
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return undefined;
|
|
235
|
+
});
|
|
236
|
+
// 缓存序列化结果(限制缓存大小)
|
|
237
|
+
if (configStringCache.size < 20) {
|
|
238
|
+
configStringCache.set(quickKey, configStr);
|
|
239
|
+
}
|
|
240
|
+
return simpleHash(configStr);
|
|
241
|
+
} catch {
|
|
242
|
+
// 如果序列化失败,返回空字符串(不使用缓存)
|
|
243
|
+
return '';
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* 路径验证缓存(已验证的路径)
|
|
248
|
+
*/ const validatedPathCache = new Set();
|
|
249
|
+
/**
|
|
250
|
+
* 预编译的正则表达式(用于路径验证)
|
|
251
|
+
*/ const PATH_TRAVERSAL_REGEX = /\.\.(\/|\\)|\.\.%2[Ff]|\.\.%5[Cc]|%2[Ee]%2[Ee]%2[Ff]|%2[Ee]%2[Ee]%5[Cc]/i;
|
|
252
|
+
const ABSOLUTE_PATH_REGEX = /^\/|^[A-Za-z]:\\/;
|
|
253
|
+
const CONTROL_CHAR_REGEX = /[\x00-\x1f\x7f]/;
|
|
254
|
+
const NULL_BYTE_REGEX = /%00|\\0|\x00/;
|
|
255
|
+
// 保留供未来使用(命令注入检测)
|
|
256
|
+
// const COMMAND_INJECTION_REGEX = /[;|&$`]/;
|
|
257
|
+
// const ALLOWED_CHARS_REGEX = /^[a-zA-Z0-9\/\-_.@]+$/;
|
|
258
|
+
/**
|
|
259
|
+
* 验证路径是否安全
|
|
260
|
+
* 优化:添加验证缓存、预编译正则、早期返回
|
|
261
|
+
*/ function validatePath(path, config) {
|
|
262
|
+
// 早期返回:检查缓存
|
|
263
|
+
if (validatedPathCache.has(path)) {
|
|
264
|
+
return {
|
|
265
|
+
valid: true
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
// 早期返回:检查路径长度(最快检查)
|
|
269
|
+
if (path.length > config.maxPathLength) {
|
|
270
|
+
return {
|
|
271
|
+
valid: false,
|
|
272
|
+
error: process.env.NODE_ENV === 'development' ? `路径长度超过最大限制 ${config.maxPathLength} 字符` : '路径验证失败'
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
// 早期返回:检查空字符串
|
|
276
|
+
if (path.length === 0) {
|
|
277
|
+
return {
|
|
278
|
+
valid: false,
|
|
279
|
+
error: '路径不能为空'
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
// 检查路径遍历攻击(使用预编译正则)
|
|
283
|
+
if (PATH_TRAVERSAL_REGEX.test(path)) {
|
|
284
|
+
return {
|
|
285
|
+
valid: false,
|
|
286
|
+
error: process.env.NODE_ENV === 'development' ? '路径包含路径遍历字符(../),可能存在安全风险' : '路径验证失败'
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
// 检查空字节注入
|
|
290
|
+
if (NULL_BYTE_REGEX.test(path)) {
|
|
291
|
+
return {
|
|
292
|
+
valid: false,
|
|
293
|
+
error: process.env.NODE_ENV === 'development' ? '路径包含空字节,可能存在安全风险' : '路径验证失败'
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
// 检查控制字符
|
|
297
|
+
if (CONTROL_CHAR_REGEX.test(path)) {
|
|
298
|
+
return {
|
|
299
|
+
valid: false,
|
|
300
|
+
error: process.env.NODE_ENV === 'development' ? '路径包含控制字符,可能存在安全风险' : '路径验证失败'
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
// 检查命令注入字符(可选,根据需求决定是否启用)
|
|
304
|
+
// if (COMMAND_INJECTION_REGEX.test(path)) {
|
|
305
|
+
// return {
|
|
306
|
+
// valid: false,
|
|
307
|
+
// error: process.env.NODE_ENV === 'development'
|
|
308
|
+
// ? '路径包含潜在的命令注入字符'
|
|
309
|
+
// : '路径验证失败',
|
|
310
|
+
// };
|
|
311
|
+
// }
|
|
312
|
+
// 检查绝对路径(使用预编译正则)
|
|
313
|
+
if (!config.allowAbsolutePaths && ABSOLUTE_PATH_REGEX.test(path)) {
|
|
314
|
+
return {
|
|
315
|
+
valid: false,
|
|
316
|
+
error: process.env.NODE_ENV === 'development' ? '不允许使用绝对路径' : '路径验证失败'
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
// 检查路径前缀白名单(优化:使用 Set 提高查找速度)
|
|
320
|
+
if (config.allowedPathPrefixes.length > 0) {
|
|
321
|
+
const prefixSet = new Set(config.allowedPathPrefixes);
|
|
322
|
+
const isAllowed = Array.from(prefixSet).some((prefix)=>path.startsWith(prefix));
|
|
323
|
+
if (!isAllowed) {
|
|
324
|
+
return {
|
|
325
|
+
valid: false,
|
|
326
|
+
error: process.env.NODE_ENV === 'development' ? `路径不在允许的前缀列表中: ${config.allowedPathPrefixes.join(', ')}` : '路径验证失败'
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// 使用 SecurityUtils 验证输入(最后检查,因为可能较慢)
|
|
331
|
+
const validation = _utils.SecurityUtils.validateInput(path);
|
|
332
|
+
if (!validation.safe) {
|
|
333
|
+
return {
|
|
334
|
+
valid: false,
|
|
335
|
+
error: process.env.NODE_ENV === 'development' ? validation.reason || '路径包含潜在的危险内容' : '路径验证失败'
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
// 验证通过,添加到缓存(限制缓存大小)
|
|
339
|
+
if (validatedPathCache.size < 1000) {
|
|
340
|
+
validatedPathCache.add(path);
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
valid: true
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* 预编译的正则表达式(用于路径规范化)
|
|
348
|
+
*/ const NORMALIZE_REGEX = {
|
|
349
|
+
multipleSlashes: /\/+/g,
|
|
350
|
+
dotSlash: /\/\.\//g,
|
|
351
|
+
trailingDot: /\/\.$/
|
|
352
|
+
};
|
|
353
|
+
/**
|
|
354
|
+
* 规范化路径
|
|
355
|
+
* 优化:合并正则表达式,减少替换次数
|
|
356
|
+
*/ function normalizePath(path) {
|
|
357
|
+
// 合并多个替换操作,减少字符串遍历次数
|
|
358
|
+
return path.replace(NORMALIZE_REGEX.multipleSlashes, '/').replace(NORMALIZE_REGEX.dotSlash, '/').replace(NORMALIZE_REGEX.trailingDot, '').trim();
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* 类型守卫:检查是否为有效路径字符串
|
|
362
|
+
*/ function isValidPathString(path) {
|
|
363
|
+
return typeof path === 'string' && path.length > 0;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 类型守卫:检查是否为动态导入函数
|
|
367
|
+
*/ function isComponentImport(path) {
|
|
368
|
+
return typeof path === 'function';
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* 创建动态导入函数
|
|
372
|
+
*
|
|
373
|
+
* 将组件路径字符串转换为动态导入函数,用于代码分割和懒加载
|
|
374
|
+
*
|
|
375
|
+
* @param path - 组件路径字符串,支持相对路径和别名路径(如 '@/pages/home.tsx')
|
|
376
|
+
* @returns 返回动态导入函数,调用后会返回 Promise,resolve 后的值为组件模块对象
|
|
377
|
+
*
|
|
378
|
+
* @remarks
|
|
379
|
+
* - 使用 `@vite-ignore` 注释告诉 Vite 忽略此动态导入的静态分析
|
|
380
|
+
* - 使用类型断言 `as any` 是因为 TypeScript 的 `import()` 需要静态字符串字面量
|
|
381
|
+
* - 在运行时,我们可以使用动态路径进行导入
|
|
382
|
+
* - 组件必须使用默认导出(export default)
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```typescript
|
|
386
|
+
* const importFn = createDynamicImport('@/pages/home.tsx');
|
|
387
|
+
* const module = await importFn();
|
|
388
|
+
* const HomePage = module.default;
|
|
389
|
+
* ```
|
|
390
|
+
*/ function createDynamicImport(path) {
|
|
391
|
+
// 使用类型断言,因为 TypeScript 的 import() 需要静态字符串
|
|
392
|
+
// 但在运行时,我们可以使用动态路径
|
|
393
|
+
return ()=>Promise.resolve(path).then((p)=>/*#__PURE__*/ _interop_require_wildcard(require(p)));
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* 提取并验证组件路径到 Map 中
|
|
397
|
+
*
|
|
398
|
+
* 如果路径有效且 Map 中不存在,则创建动态导入函数并存储到 Map 中
|
|
399
|
+
* 这样可以避免重复创建相同路径的动态导入函数,提高性能
|
|
400
|
+
*
|
|
401
|
+
* @param path - 组件路径,可能是字符串、动态导入函数、null 或 undefined
|
|
402
|
+
* @param map - 目标 Map,用于存储路径到动态导入函数的映射
|
|
403
|
+
* @param config - 路径验证配置
|
|
404
|
+
* @param options - 转换选项
|
|
405
|
+
* @returns 如果成功提取,返回动态导入函数;否则返回 null
|
|
406
|
+
*
|
|
407
|
+
* @remarks
|
|
408
|
+
* - 如果 path 是函数,直接返回,不添加到 Map(函数本身就可以直接使用)
|
|
409
|
+
* - 只有当路径是有效的非空字符串时才会处理并添加到 Map
|
|
410
|
+
* - 如果 Map 中已存在该路径,则直接返回已有的导入函数
|
|
411
|
+
* - 优化:使用 `get()` 一次获取,判断是否为 undefined,减少函数调用
|
|
412
|
+
* - 会进行路径验证和清理
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* ```typescript
|
|
416
|
+
* const pages = new Map<string, () => Promise<any>>();
|
|
417
|
+
* const importFn1 = extractAndValidatePath('@/pages/home.tsx', pages, config, options);
|
|
418
|
+
* const importFn2 = extractAndValidatePath(() => import('@/pages/home.tsx'), pages, config, options);
|
|
419
|
+
* ```
|
|
420
|
+
*/ function extractAndValidatePath(path, map, config, options) {
|
|
421
|
+
// 早期返回:如果是函数,直接返回,不添加到 Map
|
|
422
|
+
if (isComponentImport(path)) {
|
|
423
|
+
return path;
|
|
424
|
+
}
|
|
425
|
+
// 早期返回:检查是否为有效路径字符串
|
|
426
|
+
if (!isValidPathString(path)) {
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
429
|
+
// 规范化路径
|
|
430
|
+
const normalizedPath = normalizePath(path);
|
|
431
|
+
// 优化:先检查 Map 中是否已存在(避免不必要的验证)
|
|
432
|
+
const existingImport = map.get(normalizedPath);
|
|
433
|
+
if (existingImport !== undefined) {
|
|
434
|
+
return existingImport;
|
|
435
|
+
}
|
|
436
|
+
// 路径验证(仅在 Map 中不存在时进行)
|
|
437
|
+
if (config.enablePathValidation) {
|
|
438
|
+
const validation = validatePath(normalizedPath, config);
|
|
439
|
+
if (!validation.valid) {
|
|
440
|
+
// 生产环境错误信息脱敏
|
|
441
|
+
const errorMessage = process.env.NODE_ENV === 'development' ? `路径验证失败: ${validation.error}` : '路径验证失败';
|
|
442
|
+
const error = new _utils.SecurityError(errorMessage, undefined, process.env.NODE_ENV === 'development' ? {
|
|
443
|
+
path: normalizedPath
|
|
444
|
+
} : {});
|
|
445
|
+
if (options.enableDebugLog) {
|
|
446
|
+
_utils.logger.error('路径验证失败:', error);
|
|
447
|
+
}
|
|
448
|
+
// 开发环境抛出错误,生产环境记录警告并跳过
|
|
449
|
+
if (process.env.NODE_ENV === 'development') {
|
|
450
|
+
throw error;
|
|
451
|
+
} else {
|
|
452
|
+
// 生产环境日志脱敏
|
|
453
|
+
_utils.logger.warn('路径验证失败,已跳过');
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// 创建动态导入函数并存储
|
|
459
|
+
const importFn = createDynamicImport(normalizedPath);
|
|
460
|
+
map.set(normalizedPath, importFn);
|
|
461
|
+
if (options.enableDebugLog) {
|
|
462
|
+
_utils.logger.debug('提取路径:', normalizedPath);
|
|
463
|
+
}
|
|
464
|
+
return importFn;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* 对象池:复用栈节点对象,减少 GC 压力
|
|
468
|
+
*/ let StackNodePool = class StackNodePool {
|
|
469
|
+
acquire(route, depth) {
|
|
470
|
+
if (this.pool.length > 0) {
|
|
471
|
+
const node = this.pool.pop();
|
|
472
|
+
node.route = route;
|
|
473
|
+
node.depth = depth;
|
|
474
|
+
return node;
|
|
475
|
+
}
|
|
476
|
+
return {
|
|
477
|
+
route,
|
|
478
|
+
depth
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
release(node) {
|
|
482
|
+
if (this.pool.length < this.maxPoolSize) {
|
|
483
|
+
this.pool.push(node);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
constructor(){
|
|
487
|
+
_define_property(this, "pool", []);
|
|
488
|
+
_define_property(this, "maxPoolSize", 100);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
const stackNodePool = new StackNodePool();
|
|
492
|
+
/**
|
|
493
|
+
* 只提取组件路径到 Map 中,不转换路由配置
|
|
494
|
+
*
|
|
495
|
+
* 使用迭代方式遍历所有路由(包括子路由),提取组件路径到对应的 Map 中
|
|
496
|
+
* 这种设计可以确保:
|
|
497
|
+
* - 相同的组件路径只会创建一个动态导入函数
|
|
498
|
+
* - 使用迭代而非递归,避免栈溢出
|
|
499
|
+
* - 优化:支持并行处理、使用对象池、预分配数组
|
|
500
|
+
*
|
|
501
|
+
* @param routes - 原始路由配置列表
|
|
502
|
+
* @param result - 结果对象,用于累积收集的组件路径
|
|
503
|
+
* @param config - 路径验证配置
|
|
504
|
+
* @param options - 转换选项
|
|
505
|
+
* @param maxDepth - 最大递归深度
|
|
506
|
+
*/ async function extractPathsOnly(routes, result, config, options, maxDepth) {
|
|
507
|
+
const enableParallel = options.performance?.enableParallelProcessing ?? true;
|
|
508
|
+
const batchSize = options.performance?.parallelBatchSize ?? 10;
|
|
509
|
+
// 如果启用并行处理且路由数量较多,使用并行处理
|
|
510
|
+
if (enableParallel && routes.length > batchSize) {
|
|
511
|
+
// 收集所有需要处理的路径(只收集字符串类型,函数类型不需要处理)
|
|
512
|
+
const pathsToProcess = [];
|
|
513
|
+
// 遍历所有路由,收集路径
|
|
514
|
+
const stack = [];
|
|
515
|
+
for(let i = routes.length - 1; i >= 0; i--){
|
|
516
|
+
stack.push({
|
|
517
|
+
route: routes[i],
|
|
518
|
+
depth: 0
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
while(stack.length > 0){
|
|
522
|
+
const { route, depth } = stack.pop();
|
|
523
|
+
if (depth > maxDepth) {
|
|
524
|
+
_utils.logger.warn(`路径提取达到最大深度 ${maxDepth},跳过路由:`, route.name);
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
// 收集路径(只收集字符串类型,函数类型不需要处理,会直接使用)
|
|
528
|
+
if (route.page && typeof route.page === 'string') {
|
|
529
|
+
pathsToProcess.push({
|
|
530
|
+
path: route.page,
|
|
531
|
+
map: result.pages
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
if (route.layout && typeof route.layout === 'string') {
|
|
535
|
+
pathsToProcess.push({
|
|
536
|
+
path: route.layout,
|
|
537
|
+
map: result.layouts
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
if (route.errors && typeof route.errors === 'string') {
|
|
541
|
+
pathsToProcess.push({
|
|
542
|
+
path: route.errors,
|
|
543
|
+
map: result.errors
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
if (route.loading && typeof route.loading === 'string') {
|
|
547
|
+
pathsToProcess.push({
|
|
548
|
+
path: route.loading,
|
|
549
|
+
map: result.loadings
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
// 处理子路由
|
|
553
|
+
if (route.children && Array.isArray(route.children) && route.children.length > 0) {
|
|
554
|
+
for(let i = route.children.length - 1; i >= 0; i--){
|
|
555
|
+
stack.push({
|
|
556
|
+
route: route.children[i],
|
|
557
|
+
depth: depth + 1
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
// 并行处理路径(分批处理)
|
|
563
|
+
for(let i = 0; i < pathsToProcess.length; i += batchSize){
|
|
564
|
+
const batch = pathsToProcess.slice(i, i + batchSize);
|
|
565
|
+
await Promise.all(batch.map(({ path, map })=>Promise.resolve(extractAndValidatePath(path, map, config, options))));
|
|
566
|
+
}
|
|
567
|
+
} else {
|
|
568
|
+
// 串行处理(原有逻辑,优化:使用对象池)
|
|
569
|
+
const stack = [];
|
|
570
|
+
// 初始化栈:将所有路由推入栈中
|
|
571
|
+
for(let i = routes.length - 1; i >= 0; i--){
|
|
572
|
+
stack.push(stackNodePool.acquire(routes[i], 0));
|
|
573
|
+
}
|
|
574
|
+
// 迭代处理栈中的路由
|
|
575
|
+
while(stack.length > 0){
|
|
576
|
+
const node = stack.pop();
|
|
577
|
+
const { route, depth } = node;
|
|
578
|
+
// 检查递归深度
|
|
579
|
+
if (depth > maxDepth) {
|
|
580
|
+
_utils.logger.warn(`路径提取达到最大深度 ${maxDepth},跳过路由:`, route.name);
|
|
581
|
+
stackNodePool.release(node);
|
|
582
|
+
continue;
|
|
583
|
+
}
|
|
584
|
+
// 提取组件路径到 Map 中(同时进行验证)
|
|
585
|
+
extractAndValidatePath(route.page, result.pages, config, options);
|
|
586
|
+
extractAndValidatePath(route.layout, result.layouts, config, options);
|
|
587
|
+
extractAndValidatePath(route.errors, result.errors, config, options);
|
|
588
|
+
extractAndValidatePath(route.loading, result.loadings, config, options);
|
|
589
|
+
// 处理子路由
|
|
590
|
+
if (route.children && Array.isArray(route.children) && route.children.length > 0) {
|
|
591
|
+
// 将子路由推入栈中(逆序推入,保证处理顺序正确)
|
|
592
|
+
for(let i = route.children.length - 1; i >= 0; i--){
|
|
593
|
+
stack.push(stackNodePool.acquire(route.children[i], depth + 1));
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
// 释放节点到对象池
|
|
597
|
+
stackNodePool.release(node);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* 清理过期缓存
|
|
603
|
+
* 优化:使用 LRU 缓存的清理方法
|
|
604
|
+
*/ function cleanupExpiredCache(cacheTTL) {
|
|
605
|
+
if (transformCache) {
|
|
606
|
+
transformCache.cleanupExpired(cacheTTL);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
async function transformRoutes(routes, options = {}) {
|
|
610
|
+
const startTime = performance.now();
|
|
611
|
+
const mergedOptions = {
|
|
612
|
+
pathValidation: {
|
|
613
|
+
...DEFAULT_OPTIONS.pathValidation,
|
|
614
|
+
...options.pathValidation
|
|
615
|
+
},
|
|
616
|
+
performance: {
|
|
617
|
+
...DEFAULT_OPTIONS.performance,
|
|
618
|
+
...options.performance
|
|
619
|
+
},
|
|
620
|
+
enableDebugLog: options.enableDebugLog ?? DEFAULT_OPTIONS.enableDebugLog
|
|
621
|
+
};
|
|
622
|
+
// 早期返回:如果 routes 为空或未定义,直接返回空结果
|
|
623
|
+
if (!routes) {
|
|
624
|
+
if (mergedOptions.enableDebugLog) {
|
|
625
|
+
_utils.logger.debug('路由配置为空,返回空结果');
|
|
626
|
+
}
|
|
627
|
+
return {
|
|
628
|
+
pages: new Map(),
|
|
629
|
+
layouts: new Map(),
|
|
630
|
+
errors: new Map(),
|
|
631
|
+
loadings: new Map(),
|
|
632
|
+
routes: []
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
// 处理 routes 可能是函数的情况
|
|
636
|
+
let routesArray;
|
|
637
|
+
try {
|
|
638
|
+
routesArray = typeof routes === 'function' ? await routes() : routes;
|
|
639
|
+
} catch (error) {
|
|
640
|
+
const err = error instanceof Error ? error : new Error('路由配置加载失败');
|
|
641
|
+
_utils.logger.error('路由配置加载失败:', err);
|
|
642
|
+
throw new _utils.ValidationError('路由配置加载失败', {
|
|
643
|
+
originalError: err
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
// 早期返回:如果 routesArray 不是数组,直接返回空结果
|
|
647
|
+
if (!Array.isArray(routesArray) || routesArray.length === 0) {
|
|
648
|
+
if (mergedOptions.enableDebugLog) {
|
|
649
|
+
_utils.logger.debug('路由配置不是数组或为空,返回空结果');
|
|
650
|
+
}
|
|
651
|
+
return {
|
|
652
|
+
pages: new Map(),
|
|
653
|
+
layouts: new Map(),
|
|
654
|
+
errors: new Map(),
|
|
655
|
+
loadings: new Map(),
|
|
656
|
+
routes: []
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
// 检查缓存
|
|
660
|
+
const cacheTTL = mergedOptions.performance.cacheTTL ?? DEFAULT_OPTIONS.performance.cacheTTL;
|
|
661
|
+
const maxCacheSize = mergedOptions.performance.maxCacheSize ?? DEFAULT_OPTIONS.performance.maxCacheSize;
|
|
662
|
+
if (mergedOptions.performance.enableCache) {
|
|
663
|
+
// 初始化 LRU 缓存(如果尚未初始化或大小发生变化)
|
|
664
|
+
if (!transformCache || transformCache.size() !== maxCacheSize) {
|
|
665
|
+
transformCache = new LRUCache(maxCacheSize);
|
|
666
|
+
}
|
|
667
|
+
const configHash = generateConfigHash(routesArray);
|
|
668
|
+
if (configHash) {
|
|
669
|
+
const cached = transformCache.get(configHash);
|
|
670
|
+
if (cached && Date.now() - cached.timestamp < cacheTTL) {
|
|
671
|
+
if (mergedOptions.enableDebugLog) {
|
|
672
|
+
_utils.logger.debug('使用缓存结果');
|
|
673
|
+
}
|
|
674
|
+
// 直接返回缓存结果(LRU 缓存已处理访问时间更新)
|
|
675
|
+
return cached.result;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
// 清理过期缓存
|
|
679
|
+
cleanupExpiredCache(cacheTTL);
|
|
680
|
+
}
|
|
681
|
+
// 初始化结果对象
|
|
682
|
+
const result = {
|
|
683
|
+
pages: new Map(),
|
|
684
|
+
layouts: new Map(),
|
|
685
|
+
errors: new Map(),
|
|
686
|
+
loadings: new Map(),
|
|
687
|
+
routes: []
|
|
688
|
+
};
|
|
689
|
+
try {
|
|
690
|
+
// 性能监控:记录各阶段耗时
|
|
691
|
+
const extractStartTime = performance.now();
|
|
692
|
+
// 提取组件路径到 Map 中(不转换路由配置)
|
|
693
|
+
const pathValidation = {
|
|
694
|
+
enablePathValidation: mergedOptions.pathValidation.enablePathValidation ?? DEFAULT_OPTIONS.pathValidation.enablePathValidation,
|
|
695
|
+
allowedPathPrefixes: mergedOptions.pathValidation.allowedPathPrefixes ?? DEFAULT_OPTIONS.pathValidation.allowedPathPrefixes,
|
|
696
|
+
maxPathLength: mergedOptions.pathValidation.maxPathLength ?? DEFAULT_OPTIONS.pathValidation.maxPathLength,
|
|
697
|
+
allowAbsolutePaths: mergedOptions.pathValidation.allowAbsolutePaths ?? DEFAULT_OPTIONS.pathValidation.allowAbsolutePaths
|
|
698
|
+
};
|
|
699
|
+
const maxRecursionDepth = mergedOptions.performance.maxRecursionDepth ?? DEFAULT_OPTIONS.performance.maxRecursionDepth;
|
|
700
|
+
// 异步提取路径(支持并行处理)
|
|
701
|
+
await extractPathsOnly(routesArray, result, pathValidation, mergedOptions, maxRecursionDepth);
|
|
702
|
+
const extractEndTime = performance.now();
|
|
703
|
+
const extractDuration = extractEndTime - extractStartTime;
|
|
704
|
+
// 直接使用原始路由配置,不进行转换
|
|
705
|
+
result.routes = routesArray;
|
|
706
|
+
// 缓存结果
|
|
707
|
+
const cacheStartTime = performance.now();
|
|
708
|
+
if (mergedOptions.performance.enableCache && transformCache) {
|
|
709
|
+
const configHash = generateConfigHash(routesArray);
|
|
710
|
+
if (configHash) {
|
|
711
|
+
// 使用结构化克隆(如果可用)或浅拷贝 + 深拷贝 routes
|
|
712
|
+
let cachedResult;
|
|
713
|
+
if (typeof structuredClone !== 'undefined') {
|
|
714
|
+
// 使用结构化克隆(更快且更安全)
|
|
715
|
+
cachedResult = structuredClone(result);
|
|
716
|
+
// Map 需要手动克隆(structuredClone 可能不支持 Map)
|
|
717
|
+
cachedResult.pages = new Map(result.pages);
|
|
718
|
+
cachedResult.layouts = new Map(result.layouts);
|
|
719
|
+
cachedResult.errors = new Map(result.errors);
|
|
720
|
+
cachedResult.loadings = new Map(result.loadings);
|
|
721
|
+
} else {
|
|
722
|
+
// 回退到手动深拷贝
|
|
723
|
+
cachedResult = {
|
|
724
|
+
pages: new Map(result.pages),
|
|
725
|
+
layouts: new Map(result.layouts),
|
|
726
|
+
errors: new Map(result.errors),
|
|
727
|
+
loadings: new Map(result.loadings),
|
|
728
|
+
routes: JSON.parse(JSON.stringify(result.routes))
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
transformCache.set(configHash, {
|
|
732
|
+
result: cachedResult,
|
|
733
|
+
timestamp: Date.now(),
|
|
734
|
+
hash: configHash,
|
|
735
|
+
accessTime: Date.now()
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
const cacheEndTime = performance.now();
|
|
740
|
+
const cacheDuration = cacheEndTime - cacheStartTime;
|
|
741
|
+
const endTime = performance.now();
|
|
742
|
+
const totalDuration = endTime - startTime;
|
|
743
|
+
if (mergedOptions.enableDebugLog) {
|
|
744
|
+
// 详细的性能报告
|
|
745
|
+
_utils.logger.debug(`路由转换完成,总耗时: ${totalDuration.toFixed(2)}ms`, {
|
|
746
|
+
routeCount: result.routes.length,
|
|
747
|
+
pageCount: result.pages.size,
|
|
748
|
+
layoutCount: result.layouts.size,
|
|
749
|
+
errorCount: result.errors.size,
|
|
750
|
+
loadingCount: result.loadings.size,
|
|
751
|
+
performance: {
|
|
752
|
+
extractDuration: `${extractDuration.toFixed(2)}ms`,
|
|
753
|
+
cacheDuration: `${cacheDuration.toFixed(2)}ms`,
|
|
754
|
+
totalDuration: `${totalDuration.toFixed(2)}ms`
|
|
755
|
+
},
|
|
756
|
+
cache: {
|
|
757
|
+
hit: transformCache ? 'miss' : 'disabled',
|
|
758
|
+
size: transformCache?.size() ?? 0
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
return result;
|
|
763
|
+
} catch (error) {
|
|
764
|
+
const err = error instanceof Error ? error : new Error('路由转换失败');
|
|
765
|
+
_utils.logger.error('路由转换失败:', err);
|
|
766
|
+
throw new _utils.ValidationError('路由转换失败', {
|
|
767
|
+
originalError: err
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
//# sourceMappingURL=transform.js.map
|