@real-router/core 0.32.0 → 0.34.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/README.md +42 -29
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/metafile-cjs.json +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/metafile-esm.json +1 -1
- package/package.json +3 -3
- package/src/Router.ts +41 -22
- package/src/api/getPluginApi.ts +57 -20
- package/src/constants.ts +1 -0
- package/src/internals.ts +40 -25
- package/src/namespaces/NavigationNamespace/validators.ts +1 -41
- package/src/wiring/RouterWiringBuilder.ts +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"../event-emitter/dist/esm/index.mjs":{"bytes":1617,"imports":[],"format":"esm"},"../type-guards/dist/esm/index.mjs":{"bytes":3575,"imports":[],"format":"esm"},"src/constants.ts":{"bytes":3988,"imports":[],"format":"esm"},"src/fsm/routerFSM.ts":{"bytes":3369,"imports":[{"path":"@real-router/fsm","kind":"import-statement","external":true}],"format":"esm"},"src/fsm/index.ts":{"bytes":188,"imports":[{"path":"src/fsm/routerFSM.ts","kind":"import-statement","original":"./routerFSM"}],"format":"esm"},"src/helpers.ts":{"bytes":5658,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/internals.ts":{"bytes":3792,"imports":[],"format":"esm"},"src/namespaces/DependenciesNamespace/dependenciesStore.ts":{"bytes":828,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/DependenciesNamespace/index.ts":{"bytes":190,"imports":[{"path":"src/namespaces/DependenciesNamespace/dependenciesStore.ts","kind":"import-statement","original":"./dependenciesStore"}],"format":"esm"},"src/namespaces/OptionsNamespace/constants.ts":{"bytes":1156,"imports":[],"format":"esm"},"src/namespaces/OptionsNamespace/helpers.ts":{"bytes":1627,"imports":[],"format":"esm"},"src/namespaces/OptionsNamespace/validators.ts":{"bytes":6937,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/OptionsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/OptionsNamespace/OptionsNamespace.ts":{"bytes":1613,"imports":[{"path":"src/namespaces/OptionsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/OptionsNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/namespaces/OptionsNamespace/validators.ts","kind":"import-statement","original":"./validators"}],"format":"esm"},"src/namespaces/OptionsNamespace/index.ts":{"bytes":265,"imports":[{"path":"src/namespaces/OptionsNamespace/OptionsNamespace.ts","kind":"import-statement","original":"./OptionsNamespace"},{"path":"src/namespaces/OptionsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/OptionsNamespace/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/namespaces/StateNamespace/helpers.ts":{"bytes":1045,"imports":[],"format":"esm"},"src/namespaces/StateNamespace/StateNamespace.ts":{"bytes":7632,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/StateNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../../helpers"}],"format":"esm"},"src/namespaces/StateNamespace/index.ts":{"bytes":168,"imports":[{"path":"src/namespaces/StateNamespace/StateNamespace.ts","kind":"import-statement","original":"./StateNamespace"}],"format":"esm"},"src/namespaces/PluginsNamespace/constants.ts":{"bytes":1120,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/PluginsNamespace/validators.ts":{"bytes":2525,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/PluginsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/PluginsNamespace/PluginsNamespace.ts":{"bytes":9720,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"src/namespaces/PluginsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/PluginsNamespace/validators.ts","kind":"import-statement","original":"./validators"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../../helpers"}],"format":"esm"},"src/namespaces/PluginsNamespace/index.ts":{"bytes":230,"imports":[{"path":"src/namespaces/PluginsNamespace/PluginsNamespace.ts","kind":"import-statement","original":"./PluginsNamespace"},{"path":"src/namespaces/PluginsNamespace/constants.ts","kind":"import-statement","original":"./constants"}],"format":"esm"},"src/namespaces/RouteLifecycleNamespace/validators.ts":{"bytes":1873,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.ts":{"bytes":14154,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/RouteLifecycleNamespace/validators.ts","kind":"import-statement","original":"./validators"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../../helpers"}],"format":"esm"},"src/namespaces/RouteLifecycleNamespace/index.ts":{"bytes":195,"imports":[{"path":"src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.ts","kind":"import-statement","original":"./RouteLifecycleNamespace"}],"format":"esm"},"src/namespaces/RoutesNamespace/constants.ts":{"bytes":503,"imports":[],"format":"esm"},"src/namespaces/RoutesNamespace/helpers.ts":{"bytes":3038,"imports":[],"format":"esm"},"../path-matcher/dist/esm/index.mjs":{"bytes":9525,"imports":[],"format":"esm"},"../search-params/dist/esm/index.mjs":{"bytes":3813,"imports":[],"format":"esm"},"../route-tree/dist/esm/index.mjs":{"bytes":6514,"imports":[{"path":"../path-matcher/dist/esm/index.mjs","kind":"import-statement","original":"path-matcher"},{"path":"../search-params/dist/esm/index.mjs","kind":"import-statement","original":"search-params"}],"format":"esm"},"src/namespaces/RoutesNamespace/forwardToValidation.ts":{"bytes":11832,"imports":[{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/namespaces/RoutesNamespace/validators.ts":{"bytes":15719,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/RoutesNamespace/forwardToValidation.ts","kind":"import-statement","original":"./forwardToValidation"}],"format":"esm"},"src/namespaces/RoutesNamespace/routesStore.ts":{"bytes":11975,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"src/namespaces/RoutesNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/RoutesNamespace/forwardToValidation.ts","kind":"import-statement","original":"./forwardToValidation"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"./validators"}],"format":"esm"},"src/transitionPath.ts":{"bytes":12817,"imports":[],"format":"esm"},"src/namespaces/RoutesNamespace/RoutesNamespace.ts":{"bytes":15382,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/RoutesNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/namespaces/RoutesNamespace/routesStore.ts","kind":"import-statement","original":"./routesStore"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/transitionPath.ts","kind":"import-statement","original":"../../transitionPath"}],"format":"esm"},"src/namespaces/RoutesNamespace/index.ts":{"bytes":347,"imports":[{"path":"src/namespaces/RoutesNamespace/RoutesNamespace.ts","kind":"import-statement","original":"./RoutesNamespace"},{"path":"src/namespaces/RoutesNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/RouterError.ts":{"bytes":10101,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/namespaces/NavigationNamespace/transition/errorHandling.ts":{"bytes":2613,"imports":[{"path":"src/RouterError.ts","kind":"import-statement","original":"../../../RouterError"}],"format":"esm"},"src/namespaces/NavigationNamespace/transition/executeLifecycleGuards.ts":{"bytes":1575,"imports":[{"path":"src/namespaces/NavigationNamespace/transition/errorHandling.ts","kind":"import-statement","original":"./errorHandling"},{"path":"src/constants.ts","kind":"import-statement","original":"../../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../../RouterError"}],"format":"esm"},"src/namespaces/NavigationNamespace/transition/index.ts":{"bytes":2439,"imports":[{"path":"src/namespaces/NavigationNamespace/transition/executeLifecycleGuards.ts","kind":"import-statement","original":"./executeLifecycleGuards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../../RouterError"},{"path":"src/transitionPath.ts","kind":"import-statement","original":"../../../transitionPath"}],"format":"esm"},"src/namespaces/NavigationNamespace/validators.ts":{"bytes":2474,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/namespaces/NavigationNamespace/NavigationNamespace.ts":{"bytes":10421,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"src/namespaces/NavigationNamespace/transition/index.ts","kind":"import-statement","original":"./transition"},{"path":"src/namespaces/NavigationNamespace/validators.ts","kind":"import-statement","original":"./validators"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../RouterError"},{"path":"src/namespaces/OptionsNamespace/index.ts","kind":"import-statement","original":"../OptionsNamespace"}],"format":"esm"},"src/namespaces/NavigationNamespace/index.ts":{"bytes":203,"imports":[{"path":"src/namespaces/NavigationNamespace/NavigationNamespace.ts","kind":"import-statement","original":"./NavigationNamespace"}],"format":"esm"},"src/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.ts":{"bytes":5015,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../RouterError"}],"format":"esm"},"src/namespaces/RouterLifecycleNamespace/index.ts":{"bytes":199,"imports":[{"path":"src/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.ts","kind":"import-statement","original":"./RouterLifecycleNamespace"}],"format":"esm"},"src/namespaces/EventBusNamespace/EventBusNamespace.ts":{"bytes":6696,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/fsm/index.ts","kind":"import-statement","original":"../../fsm"}],"format":"esm"},"src/namespaces/EventBusNamespace/index.ts":{"bytes":166,"imports":[{"path":"src/namespaces/EventBusNamespace/EventBusNamespace.ts","kind":"import-statement","original":"./EventBusNamespace"}],"format":"esm"},"src/namespaces/index.ts":{"bytes":899,"imports":[{"path":"src/namespaces/DependenciesNamespace/index.ts","kind":"import-statement","original":"./DependenciesNamespace"},{"path":"src/namespaces/OptionsNamespace/index.ts","kind":"import-statement","original":"./OptionsNamespace"},{"path":"src/namespaces/StateNamespace/index.ts","kind":"import-statement","original":"./StateNamespace"},{"path":"src/namespaces/PluginsNamespace/index.ts","kind":"import-statement","original":"./PluginsNamespace"},{"path":"src/namespaces/RouteLifecycleNamespace/index.ts","kind":"import-statement","original":"./RouteLifecycleNamespace"},{"path":"src/namespaces/RoutesNamespace/index.ts","kind":"import-statement","original":"./RoutesNamespace"},{"path":"src/namespaces/NavigationNamespace/index.ts","kind":"import-statement","original":"./NavigationNamespace"},{"path":"src/namespaces/RouterLifecycleNamespace/index.ts","kind":"import-statement","original":"./RouterLifecycleNamespace"},{"path":"src/namespaces/EventBusNamespace/index.ts","kind":"import-statement","original":"./EventBusNamespace"}],"format":"esm"},"src/namespaces/DependenciesNamespace/validators.ts":{"bytes":2852,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/RouterLifecycleNamespace/constants.ts":{"bytes":1142,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../RouterError"}],"format":"esm"},"src/typeGuards.ts":{"bytes":1830,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/wiring/RouterWiringBuilder.ts":{"bytes":8331,"imports":[{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/validators"}],"format":"esm"},"src/wiring/wireRouter.ts":{"bytes":1106,"imports":[],"format":"esm"},"src/wiring/index.ts":{"bytes":190,"imports":[{"path":"src/wiring/RouterWiringBuilder.ts","kind":"import-statement","original":"./RouterWiringBuilder"},{"path":"src/wiring/wireRouter.ts","kind":"import-statement","original":"./wireRouter"}],"format":"esm"},"src/Router.ts":{"bytes":20660,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../event-emitter/dist/esm/index.mjs","kind":"import-statement","original":"event-emitter"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/fsm/index.ts","kind":"import-statement","original":"./fsm"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/internals.ts","kind":"import-statement","original":"./internals"},{"path":"src/namespaces/index.ts","kind":"import-statement","original":"./namespaces"},{"path":"src/namespaces/DependenciesNamespace/validators.ts","kind":"import-statement","original":"./namespaces/DependenciesNamespace/validators"},{"path":"src/namespaces/RouterLifecycleNamespace/constants.ts","kind":"import-statement","original":"./namespaces/RouterLifecycleNamespace/constants"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"./namespaces/RoutesNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"./RouterError"},{"path":"src/transitionPath.ts","kind":"import-statement","original":"./transitionPath"},{"path":"src/typeGuards.ts","kind":"import-statement","original":"./typeGuards"},{"path":"src/wiring/index.ts","kind":"import-statement","original":"./wiring"}],"format":"esm"},"src/createRouter.ts":{"bytes":897,"imports":[{"path":"src/Router.ts","kind":"import-statement","original":"./Router"}],"format":"esm"},"src/getNavigator.ts":{"bytes":438,"imports":[],"format":"esm"},"src/namespaces/EventBusNamespace/validators.ts":{"bytes":961,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/StateNamespace/validators.ts":{"bytes":1240,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/api/getPluginApi.ts":{"bytes":3687,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/EventBusNamespace/validators.ts","kind":"import-statement","original":"../namespaces/EventBusNamespace/validators"},{"path":"src/namespaces/NavigationNamespace/validators.ts","kind":"import-statement","original":"../namespaces/NavigationNamespace/validators"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/validators"},{"path":"src/namespaces/StateNamespace/validators.ts","kind":"import-statement","original":"../namespaces/StateNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/getRoutesApi.ts":{"bytes":17667,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/helpers"},{"path":"src/namespaces/RoutesNamespace/routesStore.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/routesStore"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/getDependenciesApi.ts":{"bytes":6267,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/DependenciesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/DependenciesNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/getLifecycleApi.ts":{"bytes":1983,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/RouteLifecycleNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RouteLifecycleNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/cloneRouter.ts":{"bytes":3216,"imports":[{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/Router.ts","kind":"import-statement","original":"../Router"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"},{"path":"src/api/getLifecycleApi.ts","kind":"import-statement","original":"./getLifecycleApi"}],"format":"esm"},"src/api/index.ts":{"bytes":349,"imports":[{"path":"src/api/getPluginApi.ts","kind":"import-statement","original":"./getPluginApi"},{"path":"src/api/getRoutesApi.ts","kind":"import-statement","original":"./getRoutesApi"},{"path":"src/api/getDependenciesApi.ts","kind":"import-statement","original":"./getDependenciesApi"},{"path":"src/api/getLifecycleApi.ts","kind":"import-statement","original":"./getLifecycleApi"},{"path":"src/api/cloneRouter.ts","kind":"import-statement","original":"./cloneRouter"}],"format":"esm"},"src/index.ts":{"bytes":1285,"imports":[{"path":"src/Router.ts","kind":"import-statement","original":"./Router"},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"./RouterError"},{"path":"src/createRouter.ts","kind":"import-statement","original":"./createRouter"},{"path":"src/getNavigator.ts","kind":"import-statement","original":"./getNavigator"},{"path":"src/api/index.ts","kind":"import-statement","original":"./api"}],"format":"esm"}},"outputs":{"dist/esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":355491},"dist/esm/index.mjs":{"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/fsm","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true}],"exports":["Router","RouterError","cloneRouter","constants","createRouter","errorCodes","events","getDependenciesApi","getLifecycleApi","getNavigator","getPluginApi","getRoutesApi"],"entryPoint":"src/index.ts","inputs":{"src/Router.ts":{"bytesInOutput":13772},"../event-emitter/dist/esm/index.mjs":{"bytesInOutput":2376},"../type-guards/dist/esm/index.mjs":{"bytesInOutput":3185},"src/constants.ts":{"bytesInOutput":2515},"src/fsm/routerFSM.ts":{"bytesInOutput":1269},"src/fsm/index.ts":{"bytesInOutput":0},"src/helpers.ts":{"bytesInOutput":1794},"src/internals.ts":{"bytesInOutput":617},"src/namespaces/DependenciesNamespace/dependenciesStore.ts":{"bytesInOutput":336},"src/namespaces/DependenciesNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/index.ts":{"bytesInOutput":0},"src/namespaces/OptionsNamespace/constants.ts":{"bytesInOutput":705},"src/namespaces/OptionsNamespace/helpers.ts":{"bytesInOutput":385},"src/namespaces/OptionsNamespace/validators.ts":{"bytesInOutput":4294},"src/namespaces/OptionsNamespace/OptionsNamespace.ts":{"bytesInOutput":930},"src/namespaces/OptionsNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/StateNamespace/helpers.ts":{"bytesInOutput":580},"src/namespaces/StateNamespace/StateNamespace.ts":{"bytesInOutput":5586},"src/namespaces/StateNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/PluginsNamespace/PluginsNamespace.ts":{"bytesInOutput":7228},"src/namespaces/PluginsNamespace/constants.ts":{"bytesInOutput":482},"src/namespaces/PluginsNamespace/validators.ts":{"bytesInOutput":1421},"src/namespaces/PluginsNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.ts":{"bytesInOutput":11488},"src/namespaces/RouteLifecycleNamespace/validators.ts":{"bytesInOutput":898},"src/namespaces/RouteLifecycleNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/RoutesNamespace/constants.ts":{"bytesInOutput":82},"src/namespaces/RoutesNamespace/helpers.ts":{"bytesInOutput":1653},"src/namespaces/RoutesNamespace/routesStore.ts":{"bytesInOutput":6346},"../path-matcher/dist/esm/index.mjs":{"bytesInOutput":13113},"../search-params/dist/esm/index.mjs":{"bytesInOutput":4202},"../route-tree/dist/esm/index.mjs":{"bytesInOutput":8191},"src/namespaces/RoutesNamespace/forwardToValidation.ts":{"bytesInOutput":7015},"src/namespaces/RoutesNamespace/validators.ts":{"bytesInOutput":7962},"src/transitionPath.ts":{"bytesInOutput":4080},"src/namespaces/RoutesNamespace/RoutesNamespace.ts":{"bytesInOutput":11313},"src/namespaces/RoutesNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/NavigationNamespace/NavigationNamespace.ts":{"bytesInOutput":8417},"src/RouterError.ts":{"bytesInOutput":8509},"src/namespaces/NavigationNamespace/transition/errorHandling.ts":{"bytesInOutput":949},"src/namespaces/NavigationNamespace/transition/executeLifecycleGuards.ts":{"bytesInOutput":855},"src/namespaces/NavigationNamespace/transition/index.ts":{"bytesInOutput":1605},"src/namespaces/NavigationNamespace/validators.ts":{"bytesInOutput":1390},"src/namespaces/NavigationNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.ts":{"bytesInOutput":3108},"src/namespaces/RouterLifecycleNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/EventBusNamespace/EventBusNamespace.ts":{"bytesInOutput":4749},"src/namespaces/EventBusNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/DependenciesNamespace/validators.ts":{"bytesInOutput":1493},"src/namespaces/RouterLifecycleNamespace/constants.ts":{"bytesInOutput":91},"src/typeGuards.ts":{"bytesInOutput":1154},"src/wiring/RouterWiringBuilder.ts":{"bytesInOutput":6323},"src/wiring/index.ts":{"bytesInOutput":0},"src/wiring/wireRouter.ts":{"bytesInOutput":268},"src/index.ts":{"bytesInOutput":0},"src/createRouter.ts":{"bytesInOutput":126},"src/getNavigator.ts":{"bytesInOutput":217},"src/namespaces/EventBusNamespace/validators.ts":{"bytesInOutput":369},"src/namespaces/StateNamespace/validators.ts":{"bytesInOutput":659},"src/api/getPluginApi.ts":{"bytesInOutput":2890},"src/api/index.ts":{"bytesInOutput":0},"src/api/getRoutesApi.ts":{"bytesInOutput":10613},"src/api/getDependenciesApi.ts":{"bytesInOutput":4307},"src/api/getLifecycleApi.ts":{"bytesInOutput":1274},"src/api/cloneRouter.ts":{"bytesInOutput":2366}},"bytes":189127}}}
|
|
1
|
+
{"inputs":{"../event-emitter/dist/esm/index.mjs":{"bytes":1617,"imports":[],"format":"esm"},"../type-guards/dist/esm/index.mjs":{"bytes":3451,"imports":[],"format":"esm"},"src/constants.ts":{"bytes":4090,"imports":[],"format":"esm"},"src/fsm/routerFSM.ts":{"bytes":3369,"imports":[{"path":"@real-router/fsm","kind":"import-statement","external":true}],"format":"esm"},"src/fsm/index.ts":{"bytes":188,"imports":[{"path":"src/fsm/routerFSM.ts","kind":"import-statement","original":"./routerFSM"}],"format":"esm"},"src/helpers.ts":{"bytes":5658,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/internals.ts":{"bytes":4548,"imports":[],"format":"esm"},"src/namespaces/DependenciesNamespace/dependenciesStore.ts":{"bytes":828,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/DependenciesNamespace/index.ts":{"bytes":190,"imports":[{"path":"src/namespaces/DependenciesNamespace/dependenciesStore.ts","kind":"import-statement","original":"./dependenciesStore"}],"format":"esm"},"src/namespaces/OptionsNamespace/constants.ts":{"bytes":1156,"imports":[],"format":"esm"},"src/namespaces/OptionsNamespace/helpers.ts":{"bytes":1627,"imports":[],"format":"esm"},"src/namespaces/OptionsNamespace/validators.ts":{"bytes":6937,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/OptionsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/OptionsNamespace/OptionsNamespace.ts":{"bytes":1613,"imports":[{"path":"src/namespaces/OptionsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/OptionsNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/namespaces/OptionsNamespace/validators.ts","kind":"import-statement","original":"./validators"}],"format":"esm"},"src/namespaces/OptionsNamespace/index.ts":{"bytes":265,"imports":[{"path":"src/namespaces/OptionsNamespace/OptionsNamespace.ts","kind":"import-statement","original":"./OptionsNamespace"},{"path":"src/namespaces/OptionsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/OptionsNamespace/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/namespaces/StateNamespace/helpers.ts":{"bytes":1045,"imports":[],"format":"esm"},"src/namespaces/StateNamespace/StateNamespace.ts":{"bytes":7632,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/StateNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../../helpers"}],"format":"esm"},"src/namespaces/StateNamespace/index.ts":{"bytes":168,"imports":[{"path":"src/namespaces/StateNamespace/StateNamespace.ts","kind":"import-statement","original":"./StateNamespace"}],"format":"esm"},"src/namespaces/PluginsNamespace/constants.ts":{"bytes":1120,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/PluginsNamespace/validators.ts":{"bytes":2525,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/PluginsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/PluginsNamespace/PluginsNamespace.ts":{"bytes":9720,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"src/namespaces/PluginsNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/PluginsNamespace/validators.ts","kind":"import-statement","original":"./validators"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../../helpers"}],"format":"esm"},"src/namespaces/PluginsNamespace/index.ts":{"bytes":230,"imports":[{"path":"src/namespaces/PluginsNamespace/PluginsNamespace.ts","kind":"import-statement","original":"./PluginsNamespace"},{"path":"src/namespaces/PluginsNamespace/constants.ts","kind":"import-statement","original":"./constants"}],"format":"esm"},"src/namespaces/RouteLifecycleNamespace/validators.ts":{"bytes":1873,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.ts":{"bytes":14154,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/RouteLifecycleNamespace/validators.ts","kind":"import-statement","original":"./validators"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../../helpers"}],"format":"esm"},"src/namespaces/RouteLifecycleNamespace/index.ts":{"bytes":195,"imports":[{"path":"src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.ts","kind":"import-statement","original":"./RouteLifecycleNamespace"}],"format":"esm"},"src/namespaces/RoutesNamespace/constants.ts":{"bytes":503,"imports":[],"format":"esm"},"src/namespaces/RoutesNamespace/helpers.ts":{"bytes":3038,"imports":[],"format":"esm"},"../path-matcher/dist/esm/index.mjs":{"bytes":9525,"imports":[],"format":"esm"},"../search-params/dist/esm/index.mjs":{"bytes":3813,"imports":[],"format":"esm"},"../route-tree/dist/esm/index.mjs":{"bytes":6514,"imports":[{"path":"../path-matcher/dist/esm/index.mjs","kind":"import-statement","original":"path-matcher"},{"path":"../search-params/dist/esm/index.mjs","kind":"import-statement","original":"search-params"}],"format":"esm"},"src/namespaces/RoutesNamespace/forwardToValidation.ts":{"bytes":11832,"imports":[{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/namespaces/RoutesNamespace/validators.ts":{"bytes":15719,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/RoutesNamespace/forwardToValidation.ts","kind":"import-statement","original":"./forwardToValidation"}],"format":"esm"},"src/namespaces/RoutesNamespace/routesStore.ts":{"bytes":11975,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"src/namespaces/RoutesNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/RoutesNamespace/forwardToValidation.ts","kind":"import-statement","original":"./forwardToValidation"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"./validators"}],"format":"esm"},"src/transitionPath.ts":{"bytes":12817,"imports":[],"format":"esm"},"src/namespaces/RoutesNamespace/RoutesNamespace.ts":{"bytes":15382,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/namespaces/RoutesNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/namespaces/RoutesNamespace/routesStore.ts","kind":"import-statement","original":"./routesStore"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/transitionPath.ts","kind":"import-statement","original":"../../transitionPath"}],"format":"esm"},"src/namespaces/RoutesNamespace/index.ts":{"bytes":347,"imports":[{"path":"src/namespaces/RoutesNamespace/RoutesNamespace.ts","kind":"import-statement","original":"./RoutesNamespace"},{"path":"src/namespaces/RoutesNamespace/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/RouterError.ts":{"bytes":10101,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/namespaces/NavigationNamespace/transition/errorHandling.ts":{"bytes":2613,"imports":[{"path":"src/RouterError.ts","kind":"import-statement","original":"../../../RouterError"}],"format":"esm"},"src/namespaces/NavigationNamespace/transition/executeLifecycleGuards.ts":{"bytes":1575,"imports":[{"path":"src/namespaces/NavigationNamespace/transition/errorHandling.ts","kind":"import-statement","original":"./errorHandling"},{"path":"src/constants.ts","kind":"import-statement","original":"../../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../../RouterError"}],"format":"esm"},"src/namespaces/NavigationNamespace/transition/index.ts":{"bytes":2439,"imports":[{"path":"src/namespaces/NavigationNamespace/transition/executeLifecycleGuards.ts","kind":"import-statement","original":"./executeLifecycleGuards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../../RouterError"},{"path":"src/transitionPath.ts","kind":"import-statement","original":"../../../transitionPath"}],"format":"esm"},"src/namespaces/NavigationNamespace/validators.ts":{"bytes":1409,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/namespaces/NavigationNamespace/NavigationNamespace.ts":{"bytes":10421,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"src/namespaces/NavigationNamespace/transition/index.ts","kind":"import-statement","original":"./transition"},{"path":"src/namespaces/NavigationNamespace/validators.ts","kind":"import-statement","original":"./validators"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../RouterError"},{"path":"src/namespaces/OptionsNamespace/index.ts","kind":"import-statement","original":"../OptionsNamespace"}],"format":"esm"},"src/namespaces/NavigationNamespace/index.ts":{"bytes":203,"imports":[{"path":"src/namespaces/NavigationNamespace/NavigationNamespace.ts","kind":"import-statement","original":"./NavigationNamespace"}],"format":"esm"},"src/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.ts":{"bytes":5015,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../RouterError"}],"format":"esm"},"src/namespaces/RouterLifecycleNamespace/index.ts":{"bytes":199,"imports":[{"path":"src/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.ts","kind":"import-statement","original":"./RouterLifecycleNamespace"}],"format":"esm"},"src/namespaces/EventBusNamespace/EventBusNamespace.ts":{"bytes":6696,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/fsm/index.ts","kind":"import-statement","original":"../../fsm"}],"format":"esm"},"src/namespaces/EventBusNamespace/index.ts":{"bytes":166,"imports":[{"path":"src/namespaces/EventBusNamespace/EventBusNamespace.ts","kind":"import-statement","original":"./EventBusNamespace"}],"format":"esm"},"src/namespaces/index.ts":{"bytes":899,"imports":[{"path":"src/namespaces/DependenciesNamespace/index.ts","kind":"import-statement","original":"./DependenciesNamespace"},{"path":"src/namespaces/OptionsNamespace/index.ts","kind":"import-statement","original":"./OptionsNamespace"},{"path":"src/namespaces/StateNamespace/index.ts","kind":"import-statement","original":"./StateNamespace"},{"path":"src/namespaces/PluginsNamespace/index.ts","kind":"import-statement","original":"./PluginsNamespace"},{"path":"src/namespaces/RouteLifecycleNamespace/index.ts","kind":"import-statement","original":"./RouteLifecycleNamespace"},{"path":"src/namespaces/RoutesNamespace/index.ts","kind":"import-statement","original":"./RoutesNamespace"},{"path":"src/namespaces/NavigationNamespace/index.ts","kind":"import-statement","original":"./NavigationNamespace"},{"path":"src/namespaces/RouterLifecycleNamespace/index.ts","kind":"import-statement","original":"./RouterLifecycleNamespace"},{"path":"src/namespaces/EventBusNamespace/index.ts","kind":"import-statement","original":"./EventBusNamespace"}],"format":"esm"},"src/namespaces/DependenciesNamespace/validators.ts":{"bytes":2852,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/RouterLifecycleNamespace/constants.ts":{"bytes":1142,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../../RouterError"}],"format":"esm"},"src/typeGuards.ts":{"bytes":1830,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/wiring/RouterWiringBuilder.ts":{"bytes":8440,"imports":[{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/validators"}],"format":"esm"},"src/wiring/wireRouter.ts":{"bytes":1106,"imports":[],"format":"esm"},"src/wiring/index.ts":{"bytes":190,"imports":[{"path":"src/wiring/RouterWiringBuilder.ts","kind":"import-statement","original":"./RouterWiringBuilder"},{"path":"src/wiring/wireRouter.ts","kind":"import-statement","original":"./wireRouter"}],"format":"esm"},"src/Router.ts":{"bytes":21135,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../event-emitter/dist/esm/index.mjs","kind":"import-statement","original":"event-emitter"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/fsm/index.ts","kind":"import-statement","original":"./fsm"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/internals.ts","kind":"import-statement","original":"./internals"},{"path":"src/namespaces/index.ts","kind":"import-statement","original":"./namespaces"},{"path":"src/namespaces/DependenciesNamespace/validators.ts","kind":"import-statement","original":"./namespaces/DependenciesNamespace/validators"},{"path":"src/namespaces/RouterLifecycleNamespace/constants.ts","kind":"import-statement","original":"./namespaces/RouterLifecycleNamespace/constants"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"./namespaces/RoutesNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"./RouterError"},{"path":"src/transitionPath.ts","kind":"import-statement","original":"./transitionPath"},{"path":"src/typeGuards.ts","kind":"import-statement","original":"./typeGuards"},{"path":"src/wiring/index.ts","kind":"import-statement","original":"./wiring"}],"format":"esm"},"src/createRouter.ts":{"bytes":897,"imports":[{"path":"src/Router.ts","kind":"import-statement","original":"./Router"}],"format":"esm"},"src/getNavigator.ts":{"bytes":438,"imports":[],"format":"esm"},"src/namespaces/EventBusNamespace/validators.ts":{"bytes":961,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../../constants"}],"format":"esm"},"src/namespaces/StateNamespace/validators.ts":{"bytes":1240,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"}],"format":"esm"},"src/api/getPluginApi.ts":{"bytes":4357,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/EventBusNamespace/validators.ts","kind":"import-statement","original":"../namespaces/EventBusNamespace/validators"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/validators"},{"path":"src/namespaces/StateNamespace/validators.ts","kind":"import-statement","original":"../namespaces/StateNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/getRoutesApi.ts":{"bytes":17667,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/RoutesNamespace/helpers.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/helpers"},{"path":"src/namespaces/RoutesNamespace/routesStore.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/routesStore"},{"path":"src/namespaces/RoutesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RoutesNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/getDependenciesApi.ts":{"bytes":6267,"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/DependenciesNamespace/validators.ts","kind":"import-statement","original":"../namespaces/DependenciesNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/getLifecycleApi.ts":{"bytes":1983,"imports":[{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/namespaces/RouteLifecycleNamespace/validators.ts","kind":"import-statement","original":"../namespaces/RouteLifecycleNamespace/validators"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"}],"format":"esm"},"src/api/cloneRouter.ts":{"bytes":3216,"imports":[{"path":"../route-tree/dist/esm/index.mjs","kind":"import-statement","original":"route-tree"},{"path":"../type-guards/dist/esm/index.mjs","kind":"import-statement","original":"type-guards"},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/internals.ts","kind":"import-statement","original":"../internals"},{"path":"src/Router.ts","kind":"import-statement","original":"../Router"},{"path":"src/RouterError.ts","kind":"import-statement","original":"../RouterError"},{"path":"src/api/getLifecycleApi.ts","kind":"import-statement","original":"./getLifecycleApi"}],"format":"esm"},"src/api/index.ts":{"bytes":349,"imports":[{"path":"src/api/getPluginApi.ts","kind":"import-statement","original":"./getPluginApi"},{"path":"src/api/getRoutesApi.ts","kind":"import-statement","original":"./getRoutesApi"},{"path":"src/api/getDependenciesApi.ts","kind":"import-statement","original":"./getDependenciesApi"},{"path":"src/api/getLifecycleApi.ts","kind":"import-statement","original":"./getLifecycleApi"},{"path":"src/api/cloneRouter.ts","kind":"import-statement","original":"./cloneRouter"}],"format":"esm"},"src/index.ts":{"bytes":1285,"imports":[{"path":"src/Router.ts","kind":"import-statement","original":"./Router"},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/RouterError.ts","kind":"import-statement","original":"./RouterError"},{"path":"src/createRouter.ts","kind":"import-statement","original":"./createRouter"},{"path":"src/getNavigator.ts","kind":"import-statement","original":"./getNavigator"},{"path":"src/api/index.ts","kind":"import-statement","original":"./api"}],"format":"esm"}},"outputs":{"dist/esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":357124},"dist/esm/index.mjs":{"imports":[{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/fsm","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true},{"path":"@real-router/logger","kind":"import-statement","external":true}],"exports":["Router","RouterError","cloneRouter","constants","createRouter","errorCodes","events","getDependenciesApi","getLifecycleApi","getNavigator","getPluginApi","getRoutesApi"],"entryPoint":"src/index.ts","inputs":{"src/Router.ts":{"bytesInOutput":14175},"../event-emitter/dist/esm/index.mjs":{"bytesInOutput":2376},"../type-guards/dist/esm/index.mjs":{"bytesInOutput":3187},"src/constants.ts":{"bytesInOutput":2619},"src/fsm/routerFSM.ts":{"bytesInOutput":1269},"src/fsm/index.ts":{"bytesInOutput":0},"src/helpers.ts":{"bytesInOutput":1794},"src/internals.ts":{"bytesInOutput":851},"src/namespaces/DependenciesNamespace/dependenciesStore.ts":{"bytesInOutput":336},"src/namespaces/DependenciesNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/index.ts":{"bytesInOutput":0},"src/namespaces/OptionsNamespace/constants.ts":{"bytesInOutput":705},"src/namespaces/OptionsNamespace/helpers.ts":{"bytesInOutput":385},"src/namespaces/OptionsNamespace/validators.ts":{"bytesInOutput":4294},"src/namespaces/OptionsNamespace/OptionsNamespace.ts":{"bytesInOutput":930},"src/namespaces/OptionsNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/StateNamespace/helpers.ts":{"bytesInOutput":580},"src/namespaces/StateNamespace/StateNamespace.ts":{"bytesInOutput":5586},"src/namespaces/StateNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/PluginsNamespace/PluginsNamespace.ts":{"bytesInOutput":7228},"src/namespaces/PluginsNamespace/constants.ts":{"bytesInOutput":482},"src/namespaces/PluginsNamespace/validators.ts":{"bytesInOutput":1421},"src/namespaces/PluginsNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.ts":{"bytesInOutput":11488},"src/namespaces/RouteLifecycleNamespace/validators.ts":{"bytesInOutput":898},"src/namespaces/RouteLifecycleNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/RoutesNamespace/constants.ts":{"bytesInOutput":82},"src/namespaces/RoutesNamespace/helpers.ts":{"bytesInOutput":1653},"src/namespaces/RoutesNamespace/routesStore.ts":{"bytesInOutput":6346},"../path-matcher/dist/esm/index.mjs":{"bytesInOutput":13115},"../search-params/dist/esm/index.mjs":{"bytesInOutput":4202},"../route-tree/dist/esm/index.mjs":{"bytesInOutput":8191},"src/namespaces/RoutesNamespace/forwardToValidation.ts":{"bytesInOutput":7015},"src/namespaces/RoutesNamespace/validators.ts":{"bytesInOutput":7964},"src/transitionPath.ts":{"bytesInOutput":4084},"src/namespaces/RoutesNamespace/RoutesNamespace.ts":{"bytesInOutput":11313},"src/namespaces/RoutesNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/NavigationNamespace/NavigationNamespace.ts":{"bytesInOutput":8417},"src/RouterError.ts":{"bytesInOutput":8509},"src/namespaces/NavigationNamespace/transition/errorHandling.ts":{"bytesInOutput":949},"src/namespaces/NavigationNamespace/transition/executeLifecycleGuards.ts":{"bytesInOutput":855},"src/namespaces/NavigationNamespace/transition/index.ts":{"bytesInOutput":1605},"src/namespaces/NavigationNamespace/validators.ts":{"bytesInOutput":651},"src/namespaces/NavigationNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.ts":{"bytesInOutput":3108},"src/namespaces/RouterLifecycleNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/EventBusNamespace/EventBusNamespace.ts":{"bytesInOutput":4749},"src/namespaces/EventBusNamespace/index.ts":{"bytesInOutput":0},"src/namespaces/DependenciesNamespace/validators.ts":{"bytesInOutput":1493},"src/namespaces/RouterLifecycleNamespace/constants.ts":{"bytesInOutput":91},"src/typeGuards.ts":{"bytesInOutput":1154},"src/wiring/RouterWiringBuilder.ts":{"bytesInOutput":6323},"src/wiring/index.ts":{"bytesInOutput":0},"src/wiring/wireRouter.ts":{"bytesInOutput":268},"src/index.ts":{"bytesInOutput":0},"src/createRouter.ts":{"bytesInOutput":126},"src/getNavigator.ts":{"bytesInOutput":217},"src/namespaces/EventBusNamespace/validators.ts":{"bytesInOutput":369},"src/namespaces/StateNamespace/validators.ts":{"bytesInOutput":660},"src/api/getPluginApi.ts":{"bytesInOutput":3492},"src/api/index.ts":{"bytesInOutput":0},"src/api/getRoutesApi.ts":{"bytesInOutput":10613},"src/api/getDependenciesApi.ts":{"bytesInOutput":4307},"src/api/getLifecycleApi.ts":{"bytesInOutput":1274},"src/api/cloneRouter.ts":{"bytesInOutput":2366}},"bytes":189742}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-router/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "A simple, powerful, view-agnostic, modular and extensible router",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@real-router/fsm": "^0.2.0",
|
|
51
51
|
"@real-router/logger": "^0.2.0",
|
|
52
|
-
"@real-router/types": "^0.
|
|
52
|
+
"@real-router/types": "^0.22.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"event-emitter": "^0.1.0",
|
|
56
56
|
"route-tree": "^0.3.3",
|
|
57
|
-
"type-guards": "^0.3.
|
|
57
|
+
"type-guards": "^0.3.4"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsup",
|
package/src/Router.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { errorCodes } from "./constants";
|
|
|
14
14
|
import { createRouterFSM } from "./fsm";
|
|
15
15
|
import { createLimits } from "./helpers";
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
createInterceptable,
|
|
18
18
|
getInternals,
|
|
19
19
|
registerInternals,
|
|
20
20
|
} from "./internals";
|
|
@@ -43,6 +43,7 @@ import { getTransitionPath } from "./transitionPath";
|
|
|
43
43
|
import { isLoggerConfig } from "./typeGuards";
|
|
44
44
|
import { RouterWiringBuilder, wireRouter } from "./wiring";
|
|
45
45
|
|
|
46
|
+
import type { RouterInternals } from "./internals";
|
|
46
47
|
import type { DependenciesStore } from "./namespaces";
|
|
47
48
|
import type { Limits, PluginFactory, Route, RouterEventMap } from "./types";
|
|
48
49
|
import type {
|
|
@@ -68,7 +69,7 @@ import type { CreateMatcherOptions } from "route-tree";
|
|
|
68
69
|
* - RoutesNamespace: route tree operations
|
|
69
70
|
* - RouteLifecycleNamespace: canActivate/canDeactivate guards
|
|
70
71
|
* - PluginsNamespace: plugin lifecycle
|
|
71
|
-
* - NavigationNamespace: navigate
|
|
72
|
+
* - NavigationNamespace: navigate
|
|
72
73
|
* - RouterLifecycleNamespace: start, stop, isStarted
|
|
73
74
|
*
|
|
74
75
|
* @internal This class implementation is internal. Use createRouter() instead.
|
|
@@ -206,31 +207,41 @@ export class Router<
|
|
|
206
207
|
// Register Internals (WeakMap for plugin/infrastructure access)
|
|
207
208
|
// =========================================================================
|
|
208
209
|
|
|
209
|
-
const
|
|
210
|
-
routeName: string,
|
|
211
|
-
params: Params,
|
|
212
|
-
) => Params)[] = [];
|
|
210
|
+
const interceptorsMap: RouterInternals["interceptors"] = new Map();
|
|
213
211
|
|
|
214
212
|
registerInternals(this, {
|
|
215
213
|
makeState: (name, params, path, meta, forceId) =>
|
|
216
214
|
this.#state.makeState(name, params, path, meta, forceId),
|
|
217
|
-
forwardState: (
|
|
215
|
+
forwardState: createInterceptable(
|
|
216
|
+
"forwardState",
|
|
217
|
+
(name, params) => this.#routes.forwardState(name, params),
|
|
218
|
+
interceptorsMap,
|
|
219
|
+
),
|
|
218
220
|
buildStateResolved: (name, params) =>
|
|
219
221
|
this.#routes.buildStateResolved(name, params),
|
|
220
222
|
matchPath: (path, matchOptions) =>
|
|
221
223
|
this.#routes.matchPath(path, matchOptions),
|
|
222
224
|
getOptions: () => this.#options.get(),
|
|
223
|
-
navigateToState: (toState, fromState, opts) =>
|
|
224
|
-
this.#navigation.navigateToState(toState, fromState, opts),
|
|
225
225
|
addEventListener: (eventName, cb) =>
|
|
226
226
|
this.#eventBus.addEventListener(eventName, cb),
|
|
227
|
-
buildPath: (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
227
|
+
buildPath: createInterceptable(
|
|
228
|
+
"buildPath",
|
|
229
|
+
(route: string, params?: Params) =>
|
|
230
|
+
this.#routes.buildPath(route, params ?? {}, this.#options.get()),
|
|
231
|
+
interceptorsMap,
|
|
232
|
+
),
|
|
233
|
+
start: createInterceptable(
|
|
234
|
+
"start",
|
|
235
|
+
(path: string) => {
|
|
236
|
+
if (!noValidate) {
|
|
237
|
+
RouterLifecycleNamespace.validateStartArgs([path]);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return this.#lifecycle.start(path);
|
|
241
|
+
},
|
|
242
|
+
interceptorsMap,
|
|
243
|
+
),
|
|
244
|
+
interceptors: interceptorsMap,
|
|
234
245
|
setRootPath: (rootPath) => {
|
|
235
246
|
this.#routes.setRootPath(rootPath);
|
|
236
247
|
},
|
|
@@ -259,6 +270,7 @@ export class Router<
|
|
|
259
270
|
setState: (state) => {
|
|
260
271
|
this.#state.set(state);
|
|
261
272
|
},
|
|
273
|
+
routerExtensions: [],
|
|
262
274
|
});
|
|
263
275
|
|
|
264
276
|
// =========================================================================
|
|
@@ -393,18 +405,13 @@ export class Router<
|
|
|
393
405
|
}
|
|
394
406
|
|
|
395
407
|
start(startPath: string): Promise<State> {
|
|
396
|
-
// Static validation
|
|
397
|
-
if (!this.#noValidate) {
|
|
398
|
-
RouterLifecycleNamespace.validateStartArgs([startPath]);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
408
|
if (!this.#eventBus.canStart()) {
|
|
402
409
|
return Promise.reject(CACHED_ALREADY_STARTED_ERROR);
|
|
403
410
|
}
|
|
404
411
|
|
|
405
412
|
this.#eventBus.sendStart();
|
|
406
413
|
|
|
407
|
-
const promiseState = this
|
|
414
|
+
const promiseState = getInternals(this)
|
|
408
415
|
.start(startPath)
|
|
409
416
|
.catch((error: unknown) => {
|
|
410
417
|
if (this.#eventBus.isReady()) {
|
|
@@ -451,6 +458,18 @@ export class Router<
|
|
|
451
458
|
this.#eventBus.clearAll();
|
|
452
459
|
|
|
453
460
|
this.#plugins.disposeAll();
|
|
461
|
+
|
|
462
|
+
// Safety net: clean up extensions plugins failed to remove in teardown
|
|
463
|
+
const ctx = getInternals(this);
|
|
464
|
+
|
|
465
|
+
for (const extension of ctx.routerExtensions) {
|
|
466
|
+
for (const key of extension.keys) {
|
|
467
|
+
delete (this as Record<string, unknown>)[key];
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
ctx.routerExtensions.length = 0;
|
|
472
|
+
|
|
454
473
|
this.#routes.clearRoutes();
|
|
455
474
|
this.#routeLifecycle.clearAll();
|
|
456
475
|
this.#state.reset();
|
package/src/api/getPluginApi.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { errorCodes } from "../constants";
|
|
2
2
|
import { getInternals } from "../internals";
|
|
3
3
|
import { validateListenerArgs } from "../namespaces/EventBusNamespace/validators";
|
|
4
|
-
import { validateNavigateToStateArgs } from "../namespaces/NavigationNamespace/validators";
|
|
5
4
|
import {
|
|
6
5
|
validateMatchPathArgs,
|
|
7
6
|
validateSetRootPathArgs,
|
|
@@ -11,7 +10,7 @@ import { validateMakeStateArgs } from "../namespaces/StateNamespace/validators";
|
|
|
11
10
|
import { RouterError } from "../RouterError";
|
|
12
11
|
|
|
13
12
|
import type { PluginApi } from "./types";
|
|
14
|
-
import type { DefaultDependencies, Router } from "@real-router/types";
|
|
13
|
+
import type { DefaultDependencies, Params, Router } from "@real-router/types";
|
|
15
14
|
|
|
16
15
|
function throwIfDisposed(isDisposed: () => boolean): void {
|
|
17
16
|
if (isDisposed()) {
|
|
@@ -41,7 +40,10 @@ export function getPluginApi<
|
|
|
41
40
|
|
|
42
41
|
return ctx.buildStateResolved(name, params);
|
|
43
42
|
},
|
|
44
|
-
forwardState:
|
|
43
|
+
forwardState: <P extends Params = Params>(
|
|
44
|
+
routeName: string,
|
|
45
|
+
routeParams: P,
|
|
46
|
+
) => {
|
|
45
47
|
if (!ctx.noValidate) {
|
|
46
48
|
validateStateBuilderArgs(routeName, routeParams, "forwardState");
|
|
47
49
|
}
|
|
@@ -65,15 +67,6 @@ export function getPluginApi<
|
|
|
65
67
|
ctx.setRootPath(rootPath);
|
|
66
68
|
},
|
|
67
69
|
getRootPath: ctx.getRootPath,
|
|
68
|
-
navigateToState: (toState, fromState, opts) => {
|
|
69
|
-
throwIfDisposed(ctx.isDisposed);
|
|
70
|
-
|
|
71
|
-
if (!ctx.noValidate) {
|
|
72
|
-
validateNavigateToStateArgs(toState, fromState, opts);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return ctx.navigateToState(toState, fromState, opts);
|
|
76
|
-
},
|
|
77
70
|
addEventListener: (eventName, cb) => {
|
|
78
71
|
throwIfDisposed(ctx.isDisposed);
|
|
79
72
|
|
|
@@ -109,19 +102,63 @@ export function getPluginApi<
|
|
|
109
102
|
},
|
|
110
103
|
getOptions: ctx.getOptions,
|
|
111
104
|
getTree: ctx.getTree,
|
|
112
|
-
|
|
113
|
-
setForwardState: (fn) => {
|
|
114
|
-
ctx.forwardState = fn;
|
|
115
|
-
},
|
|
116
|
-
addBuildPathInterceptor: (fn) => {
|
|
105
|
+
addInterceptor: (method, fn) => {
|
|
117
106
|
throwIfDisposed(ctx.isDisposed);
|
|
118
|
-
ctx.
|
|
107
|
+
let list = ctx.interceptors.get(method);
|
|
108
|
+
|
|
109
|
+
if (!list) {
|
|
110
|
+
list = [];
|
|
111
|
+
ctx.interceptors.set(method, list);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
list.push(fn);
|
|
119
115
|
|
|
120
116
|
return () => {
|
|
121
|
-
const index =
|
|
117
|
+
const index = list.indexOf(fn);
|
|
122
118
|
|
|
123
119
|
if (index !== -1) {
|
|
124
|
-
|
|
120
|
+
list.splice(index, 1);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
extendRouter: (extensions: Record<string, unknown>) => {
|
|
125
|
+
throwIfDisposed(ctx.isDisposed);
|
|
126
|
+
|
|
127
|
+
const keys = Object.keys(extensions);
|
|
128
|
+
|
|
129
|
+
for (const key of keys) {
|
|
130
|
+
if (key in router) {
|
|
131
|
+
throw new RouterError(errorCodes.PLUGIN_CONFLICT, {
|
|
132
|
+
message: `Cannot extend router: property "${key}" already exists`,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
for (const key of keys) {
|
|
138
|
+
(router as Record<string, unknown>)[key] = extensions[key];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const extensionRecord = { keys };
|
|
142
|
+
|
|
143
|
+
ctx.routerExtensions.push(extensionRecord);
|
|
144
|
+
|
|
145
|
+
let removed = false;
|
|
146
|
+
|
|
147
|
+
return () => {
|
|
148
|
+
if (removed) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
removed = true;
|
|
153
|
+
|
|
154
|
+
for (const key of extensionRecord.keys) {
|
|
155
|
+
delete (router as Record<string, unknown>)[key];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const idx = ctx.routerExtensions.indexOf(extensionRecord);
|
|
159
|
+
|
|
160
|
+
if (idx !== -1) {
|
|
161
|
+
ctx.routerExtensions.splice(idx, 1);
|
|
125
162
|
}
|
|
126
163
|
};
|
|
127
164
|
},
|
package/src/constants.ts
CHANGED
|
@@ -35,6 +35,7 @@ export const errorCodes: ErrorCodeToValueMap = Object.freeze({
|
|
|
35
35
|
TRANSITION_ERR: "TRANSITION_ERR", // Generic transition failure
|
|
36
36
|
TRANSITION_CANCELLED: "CANCELLED", // Navigation cancelled by user or new navigation
|
|
37
37
|
ROUTER_DISPOSED: "DISPOSED", // Router has been disposed
|
|
38
|
+
PLUGIN_CONFLICT: "PLUGIN_CONFLICT", // Plugin tried to extend router with already-existing property
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
/**
|
package/src/internals.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { EventMethodMap, GuardFnFactory, PluginFactory } from "./types";
|
|
|
5
5
|
import type {
|
|
6
6
|
DefaultDependencies,
|
|
7
7
|
EventName,
|
|
8
|
-
NavigationOptions,
|
|
9
8
|
Options,
|
|
10
9
|
Params,
|
|
11
10
|
Plugin,
|
|
@@ -29,8 +28,7 @@ export interface RouterInternals<
|
|
|
29
28
|
forceId?: number,
|
|
30
29
|
) => State<P, MP>;
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
forwardState: <P extends Params = Params>(
|
|
31
|
+
readonly forwardState: <P extends Params = Params>(
|
|
34
32
|
routeName: string,
|
|
35
33
|
routeParams: P,
|
|
36
34
|
) => SimpleState<P>;
|
|
@@ -47,12 +45,6 @@ export interface RouterInternals<
|
|
|
47
45
|
|
|
48
46
|
readonly getOptions: () => Options;
|
|
49
47
|
|
|
50
|
-
readonly navigateToState: (
|
|
51
|
-
toState: State,
|
|
52
|
-
fromState: State | undefined,
|
|
53
|
-
opts: NavigationOptions,
|
|
54
|
-
) => Promise<State>;
|
|
55
|
-
|
|
56
48
|
readonly addEventListener: <E extends EventName>(
|
|
57
49
|
eventName: E,
|
|
58
50
|
cb: Plugin[EventMethodMap[E]],
|
|
@@ -60,10 +52,14 @@ export interface RouterInternals<
|
|
|
60
52
|
|
|
61
53
|
readonly buildPath: (route: string, params?: Params) => string;
|
|
62
54
|
|
|
63
|
-
readonly
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
readonly start: (path: string) => Promise<State>;
|
|
56
|
+
|
|
57
|
+
/* eslint-disable @typescript-eslint/no-explicit-any -- heterogeneous map: stores different InterceptorFn<M> types under different keys */
|
|
58
|
+
readonly interceptors: Map<
|
|
59
|
+
string,
|
|
60
|
+
((next: (...args: any[]) => any, ...args: any[]) => any)[]
|
|
61
|
+
>;
|
|
62
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
67
63
|
|
|
68
64
|
readonly setRootPath: (rootPath: string) => void;
|
|
69
65
|
readonly getRootPath: () => string;
|
|
@@ -94,6 +90,7 @@ export interface RouterInternals<
|
|
|
94
90
|
readonly isTransitioning: () => boolean;
|
|
95
91
|
readonly clearState: () => void;
|
|
96
92
|
readonly setState: (state: State) => void;
|
|
93
|
+
readonly routerExtensions: { keys: string[] }[];
|
|
97
94
|
}
|
|
98
95
|
|
|
99
96
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- existential type: stores RouterInternals for all Dependencies types
|
|
@@ -120,20 +117,38 @@ export function registerInternals<D extends DefaultDependencies>(
|
|
|
120
117
|
internals.set(router, ctx);
|
|
121
118
|
}
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
let resolved = params ?? {};
|
|
120
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument -- internal chain execution: type safety enforced at public API boundary (PluginApi.addInterceptor) */
|
|
121
|
+
function executeInterceptorChain<T>(
|
|
122
|
+
interceptors: ((next: (...args: any[]) => any, ...args: any[]) => any)[],
|
|
123
|
+
original: (...args: any[]) => T,
|
|
124
|
+
args: any[],
|
|
125
|
+
): T {
|
|
126
|
+
let chain = original as (...args: any[]) => any;
|
|
133
127
|
|
|
134
128
|
for (const interceptor of interceptors) {
|
|
135
|
-
|
|
129
|
+
const prev = chain;
|
|
130
|
+
|
|
131
|
+
chain = (...a: any[]) => interceptor(prev, ...a);
|
|
136
132
|
}
|
|
137
133
|
|
|
138
|
-
return
|
|
134
|
+
return chain(...args) as T;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function createInterceptable<T extends (...args: any[]) => any>(
|
|
138
|
+
name: string,
|
|
139
|
+
original: T,
|
|
140
|
+
interceptors: Map<
|
|
141
|
+
string,
|
|
142
|
+
((next: (...args: any[]) => any, ...args: any[]) => any)[]
|
|
143
|
+
>,
|
|
144
|
+
): T {
|
|
145
|
+
return ((...args: any[]) => {
|
|
146
|
+
const chain = interceptors.get(name);
|
|
147
|
+
|
|
148
|
+
if (!chain || chain.length === 0) {
|
|
149
|
+
return original(...args);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return executeInterceptorChain(chain, original, args);
|
|
153
|
+
}) as T;
|
|
139
154
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { getTypeDescription, isNavigationOptions } from "type-guards";
|
|
9
9
|
|
|
10
|
-
import type { NavigationOptions
|
|
10
|
+
import type { NavigationOptions } from "@real-router/types";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Validates navigate route name argument.
|
|
@@ -20,46 +20,6 @@ export function validateNavigateArgs(name: unknown): asserts name is string {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* Validates navigateToState arguments.
|
|
25
|
-
*/
|
|
26
|
-
export function validateNavigateToStateArgs(
|
|
27
|
-
toState: unknown,
|
|
28
|
-
fromState: unknown,
|
|
29
|
-
opts: unknown,
|
|
30
|
-
): void {
|
|
31
|
-
// toState must be a valid state object
|
|
32
|
-
if (
|
|
33
|
-
!toState ||
|
|
34
|
-
typeof toState !== "object" ||
|
|
35
|
-
typeof (toState as State).name !== "string" ||
|
|
36
|
-
typeof (toState as State).path !== "string"
|
|
37
|
-
) {
|
|
38
|
-
throw new TypeError(
|
|
39
|
-
`[router.navigateToState] Invalid toState: expected State object with name and path`,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// fromState can be undefined or a valid state
|
|
44
|
-
if (
|
|
45
|
-
fromState !== undefined &&
|
|
46
|
-
(!fromState ||
|
|
47
|
-
typeof fromState !== "object" ||
|
|
48
|
-
typeof (fromState as State).name !== "string")
|
|
49
|
-
) {
|
|
50
|
-
throw new TypeError(
|
|
51
|
-
`[router.navigateToState] Invalid fromState: expected State object or undefined`,
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// opts must be an object
|
|
56
|
-
if (typeof opts !== "object" || opts === null) {
|
|
57
|
-
throw new TypeError(
|
|
58
|
-
`[router.navigateToState] Invalid opts: expected NavigationOptions object, got ${getTypeDescription(opts)}`,
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
23
|
/**
|
|
64
24
|
* Validates navigateToDefault arguments.
|
|
65
25
|
*/
|