tungsten 0.6.2 → 0.7.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/dist/.build-complete +1 -1
- package/dist/Brands.d.ts +16 -0
- package/dist/Brands.d.ts.map +1 -0
- package/dist/Brands.js +22 -0
- package/dist/Components.d.ts +4 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +24 -6
- package/dist/ContentNode.d.ts +3 -2
- package/dist/ContentNode.d.ts.map +1 -1
- package/dist/ContentNode.js +11 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +23 -4
- package/dist/FrameworkConfig.d.ts +7 -1
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FunctionComponent.d.ts +1 -0
- package/dist/FunctionComponent.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.d.ts.map +1 -1
- package/dist/Instance/Instance.d.ts +29 -12
- package/dist/Instance/Instance.d.ts.map +1 -1
- package/dist/Instance/Instance.js +59 -21
- package/dist/Instance/InstanceConfig.d.ts +2 -1
- package/dist/Instance/InstanceConfig.d.ts.map +1 -1
- package/dist/RenderedContentNode.d.ts.map +1 -1
- package/dist/RenderingNode.d.ts.map +1 -1
- package/dist/Servers/DevServer.d.ts +4 -2
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +62 -20
- package/dist/Servers/ProdServer.d.ts +4 -2
- package/dist/Servers/ProdServer.d.ts.map +1 -1
- package/dist/Servers/ProdServer.js +77 -18
- package/dist/Servers/StaticSiteServer.d.ts +1 -1
- package/dist/Servers/StaticSiteServer.d.ts.map +1 -1
- package/dist/Servers/TungstenServer.d.ts +2 -1
- package/dist/Servers/TungstenServer.d.ts.map +1 -1
- package/dist/Servers/TungstenServer.js +7 -0
- package/dist/Servers/cacheVersioned.d.ts +3 -0
- package/dist/Servers/cacheVersioned.d.ts.map +1 -0
- package/dist/Servers/cacheVersioned.js +23 -0
- package/dist/Servers/devErrorPageAutoRetry.d.ts.map +1 -1
- package/dist/Servers/devErrorPageAutoRetry.js +1 -0
- package/dist/Servers/initStores.d.ts +4 -4
- package/dist/Servers/initStores.d.ts.map +1 -1
- package/dist/Servers/initStores.js +2 -2
- package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
- package/dist/Servers/loadEnvsDev.js +7 -6
- package/dist/Servers/resetRegistrations.d.ts +2 -0
- package/dist/Servers/resetRegistrations.d.ts.map +1 -0
- package/dist/Servers/resetRegistrations.js +13 -0
- package/dist/Servers/routing.d.ts +3 -2
- package/dist/Servers/routing.d.ts.map +1 -1
- package/dist/Servers/routing.js +3 -2
- package/dist/Store/InternalStoreSchema.d.ts +1 -1
- package/dist/Store/Store.js +2 -1
- package/dist/Store/StoreSchemaClass.d.ts +6 -3
- package/dist/Store/StoreSchemaClass.d.ts.map +1 -1
- package/dist/Store/StoreSchemaClass.js +8 -1
- package/dist/Store/TypeSafeStore.js +2 -1
- package/dist/Store/createStores.d.ts +3 -3
- package/dist/Store/createStores.d.ts.map +1 -1
- package/dist/Store/createStores.js +7 -2
- package/dist/Store/getInternalStore.d.ts.map +1 -1
- package/dist/Store/registerStore.d.ts.map +1 -1
- package/dist/Store/registerStore.js +2 -2
- package/dist/Store/storeCreators.d.ts +2 -2
- package/dist/Store/storeCreators.d.ts.map +1 -1
- package/dist/TungstenApp.d.ts +3 -3
- package/dist/TungstenApp.d.ts.map +1 -1
- package/dist/_client/cjsHelpers.d.ts.map +1 -1
- package/dist/_client/cjsHelpers.js +5 -3
- package/dist/_client/client.d.ts +2 -0
- package/dist/_client/client.d.ts.map +1 -1
- package/dist/_client/client.js +10 -3
- package/dist/api/getApiRoutes.d.ts.map +1 -1
- package/dist/api/getExport.d.ts +1 -1
- package/dist/api/getExport.d.ts.map +1 -1
- package/dist/api/getExport.js +2 -1
- package/dist/api/getExportDev.d.ts +1 -1
- package/dist/api/getExportDev.d.ts.map +1 -1
- package/dist/appBuilder.d.ts +69 -0
- package/dist/appBuilder.d.ts.map +1 -0
- package/dist/appBuilder.js +98 -0
- package/dist/appBuilder.types.test.d.ts +110 -0
- package/dist/appBuilder.types.test.d.ts.map +1 -0
- package/dist/appBuilder.types.test.js +240 -0
- package/dist/babelPlugins/BabelTransformBindDirect.js +7 -7
- package/dist/babelPlugins/BabelTransformBindVar.js +7 -7
- package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.js +5 -5
- package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformCssImports.js +2 -2
- package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +11 -6
- package/dist/babelPlugins/BabelTransformRemoveDevBlocks.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformRemoveServerBlocks.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +2 -2
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +2 -1
- package/dist/build/CompilationInfo.d.ts +3 -0
- package/dist/build/CompilationInfo.d.ts.map +1 -1
- package/dist/build/assetVersions.d.ts +9 -0
- package/dist/build/assetVersions.d.ts.map +1 -0
- package/dist/build/assetVersions.js +39 -0
- package/dist/build/babel.user.common.config.d.ts.map +1 -1
- package/dist/build/bundle.d.ts.map +1 -1
- package/dist/build/bundle.js +2 -1
- package/dist/build/bundleBabelOptions.d.ts.map +1 -1
- package/dist/build/clientRoutesFile.d.ts +2 -0
- package/dist/build/clientRoutesFile.d.ts.map +1 -0
- package/dist/build/clientRoutesFile.js +13 -0
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +4 -3
- package/dist/build/compileStyles.d.ts +2 -1
- package/dist/build/compileStyles.d.ts.map +1 -1
- package/dist/build/compileStyles.js +38 -83
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/componentStylesCache.d.ts.map +1 -1
- package/dist/build/componentStylesCache.js +3 -2
- package/dist/build/copyAssets.d.ts.map +1 -1
- package/dist/build/copyAssets.js +2 -1
- package/dist/build/copyPackageModulesToPackagesFolder.d.ts.map +1 -1
- package/dist/build/copyPackageModulesToPackagesFolder.js +1 -1
- package/dist/build/copyPublicFiles.d.ts.map +1 -1
- package/dist/build/copyPublicFiles.js +2 -1
- package/dist/build/createClientFiles.d.ts.map +1 -1
- package/dist/build/createClientFiles.js +9 -5
- package/dist/build/createInstanceConfigFile.d.ts +1 -1
- package/dist/build/createInstanceConfigFile.d.ts.map +1 -1
- package/dist/build/createInstanceConfigFile.js +9 -3
- package/dist/build/frameworkDestLocation.d.ts.map +1 -1
- package/dist/build/frameworkDestLocation.js +5 -6
- package/dist/build/frameworkStylesheets.d.ts.map +1 -1
- package/dist/build/frameworkStylesheets.js +1 -1
- package/dist/build/makeBabelRawConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts +2 -2
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +5 -3
- package/dist/build/rollupProdConstants.d.ts +5 -0
- package/dist/build/rollupProdConstants.d.ts.map +1 -0
- package/dist/build/rollupProdConstants.js +21 -0
- package/dist/cacheControl.d.ts +13 -0
- package/dist/cacheControl.d.ts.map +1 -0
- package/dist/cacheControl.js +22 -0
- package/dist/compat/types.d.ts +1 -1
- package/dist/compat/types.d.ts.map +1 -1
- package/dist/componentHelpers.d.ts +18 -0
- package/dist/componentHelpers.d.ts.map +1 -0
- package/dist/componentHelpers.js +28 -0
- package/dist/componentProxyHandlers.d.ts.map +1 -1
- package/dist/components/Fragment.d.ts +8 -0
- package/dist/components/Fragment.d.ts.map +1 -0
- package/dist/components/Fragment.js +10 -0
- package/dist/components/Link.d.ts +4 -3
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/Link.js +1 -0
- package/dist/components/NoEscape.d.ts +8 -0
- package/dist/components/NoEscape.d.ts.map +1 -0
- package/dist/components/NoEscape.js +6 -0
- package/dist/components/RouteRedirectComponent.d.ts.map +1 -1
- package/dist/components/RouteRedirectComponent.js +1 -1
- package/dist/components/WebRedirectComponent.d.ts.map +1 -1
- package/dist/components/WebRedirectComponent.js +1 -1
- package/dist/components/bindable/BindVariable.d.ts +1 -0
- package/dist/components/bindable/BindVariable.d.ts.map +1 -1
- package/dist/components/bindable/BindableCheckbox.d.ts +7 -7
- package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
- package/dist/components/bindable/BindableInput.d.ts +7 -7
- package/dist/components/bindable/BindableInput.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputNonString.d.ts +2 -2
- package/dist/components/bindable/BindableInputNonString.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputString.d.ts +2 -2
- package/dist/components/bindable/BindableInputString.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputTyped.d.ts +3 -3
- package/dist/components/bindable/BindableInputTyped.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts +3 -3
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
- package/dist/components/bindable/BindableRadio.js +2 -2
- package/dist/components/bindable/BindableSelect.d.ts +13 -10
- package/dist/components/bindable/BindableSelect.d.ts.map +1 -1
- package/dist/components/bindable/BindableSelectNaive.js +3 -3
- package/dist/components/bindable/BindableTextarea.d.ts +7 -7
- package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
- package/dist/components/bindable/bindableCandidates.comparison.d.ts +136 -0
- package/dist/components/bindable/bindableCandidates.comparison.d.ts.map +1 -0
- package/dist/components/bindable/bindableCandidates.comparison.js +268 -0
- package/dist/components/bindable/bindableProps.types.test.d.ts +50 -0
- package/dist/components/bindable/bindableProps.types.test.d.ts.map +1 -0
- package/dist/components/bindable/bindableProps.types.test.js +252 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/library/RichTextEditor/contentTree.d.ts.map +1 -1
- package/dist/components/makeTypedLink.d.ts +9 -0
- package/dist/components/makeTypedLink.d.ts.map +1 -0
- package/dist/components/makeTypedLink.js +15 -0
- package/dist/context/registerContext.d.ts +22 -0
- package/dist/context/registerContext.d.ts.map +1 -0
- package/dist/context/registerContext.js +18 -0
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +2 -1
- package/dist/fileVersions.d.ts +9 -0
- package/dist/fileVersions.d.ts.map +1 -0
- package/dist/fileVersions.js +28 -0
- package/dist/findUserConfig.d.ts +1 -1
- package/dist/findUserConfig.d.ts.map +1 -1
- package/dist/findUserConfig.js +2 -1
- package/dist/frameworkConfigSchema.d.ts +14 -2
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +11 -2
- package/dist/getComponent.d.ts.map +1 -1
- package/dist/getComponent.js +4 -3
- package/dist/getRoutes.d.ts.map +1 -1
- package/dist/getRoutes.js +9 -8
- package/dist/hmr/applyHmrModule.d.ts.map +1 -1
- package/dist/hmr/componentIdentity.js +1 -1
- package/dist/hooks/getCurrentComponent.d.ts +1 -1
- package/dist/hooks/getCurrentComponent.d.ts.map +1 -1
- package/dist/hydrate/hydrate.d.ts +5 -1
- package/dist/hydrate/hydrate.d.ts.map +1 -1
- package/dist/hydrate/hydrate.js +59 -46
- package/dist/hydrate/hydrateGlobalData.d.ts +4 -3
- package/dist/hydrate/hydrateGlobalData.d.ts.map +1 -1
- package/dist/hydrate/reconcileHydratedAttributes.d.ts +2 -1
- package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
- package/dist/hydrate/reconcileHydratedAttributes.js +4 -3
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -1
- package/dist/hydrate/renderHydrationMismatchBanner.js +2 -1
- package/dist/importDevModuleWithRetry.d.ts +2 -1
- package/dist/importDevModuleWithRetry.d.ts.map +1 -1
- package/dist/importDevModuleWithRetry.js +2 -1
- package/dist/importModule.d.ts +3 -0
- package/dist/importModule.d.ts.map +1 -0
- package/dist/importModule.js +4 -0
- package/dist/index.js +2 -1
- package/dist/indexInner.d.ts +30 -7
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +37 -2
- package/dist/json.d.ts +12 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +8 -0
- package/dist/jsxHelpers.d.ts +3 -0
- package/dist/jsxHelpers.d.ts.map +1 -0
- package/dist/jsxHelpers.js +6 -0
- package/dist/jsxRuntime.d.ts +1 -0
- package/dist/jsxRuntime.d.ts.map +1 -1
- package/dist/jsxRuntime.js +3 -1
- package/dist/jsxRuntimeSignals.d.ts.map +1 -1
- package/dist/jsxRuntimeSignals.js +1 -0
- package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -0
- package/dist/mergeConfigs.d.ts.map +1 -1
- package/dist/mergeConfigs.js +2 -6
- package/dist/nbsp.d.ts +1 -2
- package/dist/nbsp.d.ts.map +1 -1
- package/dist/nbsp.js +3 -7
- package/dist/objectMap.d.ts +1 -1
- package/dist/objectMap.d.ts.map +1 -1
- package/dist/pipeline/PipelineRequestHandler.d.ts +25 -0
- package/dist/pipeline/PipelineRequestHandler.d.ts.map +1 -0
- package/dist/pipeline/PipelineRequestHandler.js +96 -0
- package/dist/pipeline/contextStore.d.ts +12 -0
- package/dist/pipeline/contextStore.d.ts.map +1 -0
- package/dist/pipeline/contextStore.js +13 -0
- package/dist/pipeline/hydratePipeline.d.ts +4 -0
- package/dist/pipeline/hydratePipeline.d.ts.map +1 -0
- package/dist/pipeline/hydratePipeline.js +64 -0
- package/dist/pipeline/importRoutesModule.d.ts +6 -0
- package/dist/pipeline/importRoutesModule.d.ts.map +1 -0
- package/dist/pipeline/importRoutesModule.js +33 -0
- package/dist/pipeline/networkedTransport.d.ts +11 -0
- package/dist/pipeline/networkedTransport.d.ts.map +1 -0
- package/dist/pipeline/networkedTransport.js +54 -0
- package/dist/pipeline/pipeline.d.ts +105 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/pipeline.js +108 -0
- package/dist/pipeline/pipeline.types.test.d.ts +650 -0
- package/dist/pipeline/pipeline.types.test.d.ts.map +1 -0
- package/dist/pipeline/pipeline.types.test.js +342 -0
- package/dist/pipeline/pipelineDefinition.d.ts +67 -0
- package/dist/pipeline/pipelineDefinition.d.ts.map +1 -0
- package/dist/pipeline/pipelineDefinition.js +11 -0
- package/dist/pipeline/pipelineSplit.types.test.d.ts +1971 -0
- package/dist/pipeline/pipelineSplit.types.test.d.ts.map +1 -0
- package/dist/pipeline/pipelineSplit.types.test.js +440 -0
- package/dist/pipeline/runPipeline.d.ts +31 -0
- package/dist/pipeline/runPipeline.d.ts.map +1 -0
- package/dist/pipeline/runPipeline.js +71 -0
- package/dist/pipeline/runSplitPipeline.d.ts +10 -0
- package/dist/pipeline/runSplitPipeline.d.ts.map +1 -0
- package/dist/pipeline/runSplitPipeline.js +48 -0
- package/dist/pipeline/splitPipeline.d.ts +62 -0
- package/dist/pipeline/splitPipeline.d.ts.map +1 -0
- package/dist/pipeline/splitPipeline.js +76 -0
- package/dist/pop.js +1 -1
- package/dist/rawHtml/filterContentNode.d.ts.map +1 -1
- package/dist/render/HeadData.d.ts +3 -1
- package/dist/render/HeadData.d.ts.map +1 -1
- package/dist/render/classComponentNodeToRenderingTree.d.ts.map +1 -1
- package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
- package/dist/render/contentToHtml.d.ts +2 -2
- package/dist/render/contentToHtml.d.ts.map +1 -1
- package/dist/render/contentToHtml.js +2 -1
- package/dist/render/contentToHtmlDev.d.ts +1 -1
- package/dist/render/contentToHtmlDev.d.ts.map +1 -1
- package/dist/render/contentTreeToRenderingTree.d.ts.map +1 -1
- package/dist/render/contentTreeToRenderingTree.js +2 -1
- package/dist/render/functionComponentNodeToRenderingTree.d.ts.map +1 -1
- package/dist/render/functionComponentNodeToRenderingTree.js +2 -2
- package/dist/render/instantiateComponent.d.ts.map +1 -1
- package/dist/render/processHead.d.ts.map +1 -1
- package/dist/render/processHead.js +12 -18
- package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
- package/dist/render/renderingTreeToHtml.js +6 -3
- package/dist/render/rootToHtml.d.ts +2 -2
- package/dist/render/rootToHtml.d.ts.map +1 -1
- package/dist/requests/fetch/delete.d.ts.map +1 -1
- package/dist/requests/fetch/delete.js +5 -2
- package/dist/requests/fetch/get.js +1 -1
- package/dist/requests/fetch/patch.d.ts.map +1 -1
- package/dist/requests/fetch/patch.js +5 -2
- package/dist/requests/fetch/post.d.ts.map +1 -1
- package/dist/requests/fetch/post.js +5 -2
- package/dist/requests/fetch/put.d.ts.map +1 -1
- package/dist/requests/fetch/put.js +5 -2
- package/dist/routesLocationParts.d.ts +6 -0
- package/dist/routesLocationParts.d.ts.map +1 -0
- package/dist/routesLocationParts.js +10 -0
- package/dist/routing/AppRoutes.d.ts +5 -3
- package/dist/routing/AppRoutes.d.ts.map +1 -1
- package/dist/routing/MatchedRouteInfo.d.ts +11 -0
- package/dist/routing/MatchedRouteInfo.d.ts.map +1 -0
- package/dist/routing/RouteContentFunction.d.ts +1 -2
- package/dist/routing/RouteContentFunction.d.ts.map +1 -1
- package/dist/routing/RouteDataFunction.type.d.ts +4 -2
- package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
- package/dist/routing/RoutePaths.d.ts +12 -0
- package/dist/routing/RoutePaths.d.ts.map +1 -0
- package/dist/routing/RoutePaths.js +1 -0
- package/dist/routing/RouteTypes.d.ts +6 -4
- package/dist/routing/RouteTypes.d.ts.map +1 -1
- package/dist/routing/Routes.d.ts +17 -11
- package/dist/routing/Routes.d.ts.map +1 -1
- package/dist/routing/RoutesFunction.d.ts +11 -2
- package/dist/routing/RoutesFunction.d.ts.map +1 -1
- package/dist/routing/Serializable.d.ts +5 -0
- package/dist/routing/Serializable.d.ts.map +1 -0
- package/dist/routing/Serializable.js +1 -0
- package/dist/routing/builder.d.ts +99 -0
- package/dist/routing/builder.d.ts.map +1 -0
- package/dist/routing/builder.js +213 -0
- package/dist/routing/builder.trial.d.ts +2 -0
- package/dist/routing/builder.trial.d.ts.map +1 -0
- package/dist/routing/builder.trial.js +85 -0
- package/dist/routing/defineRoutes.d.ts +8 -0
- package/dist/routing/defineRoutes.d.ts.map +1 -0
- package/dist/routing/defineRoutes.js +3 -0
- package/dist/routing/pyramidRouting.d.ts +2 -0
- package/dist/routing/pyramidRouting.d.ts.map +1 -0
- package/dist/routing/pyramidRouting.js +13 -0
- package/dist/routing/registerGlobalData.d.ts +11 -3
- package/dist/routing/registerGlobalData.d.ts.map +1 -1
- package/dist/routing/registerGlobalData.js +6 -0
- package/dist/routing/registerParts.types.test.d.ts +2 -0
- package/dist/routing/registerParts.types.test.d.ts.map +1 -0
- package/dist/routing/registerParts.types.test.js +139 -0
- package/dist/routing/registerRoutes.d.ts +10 -0
- package/dist/routing/registerRoutes.d.ts.map +1 -0
- package/dist/routing/registerRoutes.js +9 -0
- package/dist/routing/registerRouting.d.ts +36 -0
- package/dist/routing/registerRouting.d.ts.map +1 -0
- package/dist/routing/registerRouting.js +34 -0
- package/dist/routing/registerRouting.types.test.d.ts +80 -0
- package/dist/routing/registerRouting.types.test.d.ts.map +1 -0
- package/dist/routing/registerRouting.types.test.js +120 -0
- package/dist/routing/registrationTypes.d.ts +11 -0
- package/dist/routing/registrationTypes.d.ts.map +1 -0
- package/dist/routing/registrationTypes.js +1 -0
- package/dist/routing/resolveAppRoutes.d.ts +5 -0
- package/dist/routing/resolveAppRoutes.d.ts.map +1 -0
- package/dist/routing/resolveAppRoutes.js +25 -0
- package/dist/routing/routeUrl.d.ts +4 -0
- package/dist/routing/routeUrl.d.ts.map +1 -1
- package/dist/routing/routeUrl.js +4 -0
- package/dist/routing/routesArray.d.ts +23 -0
- package/dist/routing/routesArray.d.ts.map +1 -0
- package/dist/routing/routesArray.js +20 -0
- package/dist/routing/routesArray.types.test.d.ts +2 -0
- package/dist/routing/routesArray.types.test.d.ts.map +1 -0
- package/dist/routing/routesArray.types.test.js +132 -0
- package/dist/routing/routingBuilder.d.ts +34 -0
- package/dist/routing/routingBuilder.d.ts.map +1 -0
- package/dist/routing/routingBuilder.js +33 -0
- package/dist/routing/routingBuilder.types.test.d.ts +2 -0
- package/dist/routing/routingBuilder.types.test.d.ts.map +1 -0
- package/dist/routing/routingBuilder.types.test.js +171 -0
- package/dist/routing/routingRegistry.d.ts +19 -0
- package/dist/routing/routingRegistry.d.ts.map +1 -0
- package/dist/routing/routingRegistry.js +29 -0
- package/dist/staticGen/getAppRoutes.d.ts +2 -2
- package/dist/staticGen/getAppRoutes.d.ts.map +1 -1
- package/dist/staticGen/getAppRoutes.js +9 -6
- package/dist/staticGen/staticGen.d.ts.map +1 -1
- package/dist/staticGen/staticGen.js +8 -2
- package/dist/style/styleContentSxy.d.ts.map +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +2 -0
- package/dist/syncServer/index.cjs +1 -2
- package/dist/syncServer/preload.js +2 -0
- package/dist/testing/createTestApp.d.ts +25 -1
- package/dist/testing/createTestApp.d.ts.map +1 -1
- package/dist/testing/createTestApp.js +12 -3
- package/dist/testing/createTestPipelineApp.d.ts +25 -0
- package/dist/testing/createTestPipelineApp.d.ts.map +1 -0
- package/dist/testing/createTestPipelineApp.js +153 -0
- package/dist/testing/ensure.d.ts +108 -0
- package/dist/testing/ensure.d.ts.map +1 -0
- package/dist/testing/ensure.js +522 -0
- package/dist/testing/ensure.trial.d.ts +2 -0
- package/dist/testing/ensure.trial.d.ts.map +1 -0
- package/dist/testing/ensure.trial.js +9 -0
- package/dist/testing/helpers/contentHtmlElements.d.ts.map +1 -1
- package/dist/testing/host.d.ts +80 -9
- package/dist/testing/host.d.ts.map +1 -1
- package/dist/testing/host.js +81 -20
- package/dist/testing/hostPipeline.d.ts +157 -0
- package/dist/testing/hostPipeline.d.ts.map +1 -0
- package/dist/testing/hostPipeline.js +341 -0
- package/dist/testing/hydrateTestApp.d.ts +17 -0
- package/dist/testing/hydrateTestApp.d.ts.map +1 -1
- package/dist/testing/hydrateTestApp.js +26 -6
- package/dist/testing/hydrateTestPipelineApp.d.ts +30 -0
- package/dist/testing/hydrateTestPipelineApp.d.ts.map +1 -0
- package/dist/testing/hydrateTestPipelineApp.js +190 -0
- package/dist/testing/index.d.ts +6 -3
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +4 -1
- package/dist/testing/resolveContent.d.ts +16 -0
- package/dist/testing/resolveContent.d.ts.map +1 -0
- package/dist/testing/resolveContent.js +65 -0
- package/dist/testing/testingComponentPackage.d.ts +3 -1
- package/dist/testing/testingComponentPackage.d.ts.map +1 -1
- package/dist/testing/testingComponentPackage.js +16 -1
- package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
- package/dist/update/integrateUpdateVdom.js +35 -31
- package/dist/update/integrateUpdateVdomPrebuild.js +20 -20
- package/dist/validChildren.d.ts.map +1 -1
- package/dist/zones/react.d.ts.map +1 -1
- package/package.json +20 -18
- package/types/helpers.d.ts +11 -2
- package/types/jsx/html.d.ts +29 -25
- package/types/jsx/jsx.d.ts +8 -8
- package/types/modules.d.ts +14 -3
- package/types/testing.d.ts +0 -0
- package/vendor/babel-core.js +5 -5
- package/vendor/babel-parser.js +1 -1
- package/vendor/babel-preset-react.js +32 -34
- package/vendor/babel-preset-typescript.js +5 -5
- package/vendor/chalk-extensions.js +3 -146
- package/vendor/chokidar.js +311 -5
- package/vendor/chunk-B34JUlnS.js +169 -0
- package/vendor/{chunk-Bu8ZRE-c.js → chunk-B9ttgKqg.js} +28 -25
- package/vendor/{chunk-D2EnpcLg.js → chunk-BGvapINa.js} +3 -164
- package/vendor/{chunk-Cqrj-Zqr.js → chunk-BmAiqUzD.js} +22 -8
- package/vendor/{chunk-BiUcnLhT.js → chunk-But4T5N_.js} +8 -3
- package/vendor/{chunk-OUnVY4Wm.js → chunk-DuR6SGzI.js} +162 -35
- package/vendor/dotenv.js +2 -2
- package/vendor/express.js +61 -10
- package/vendor/manifest.json +2 -2
- package/vendor/postcss.js +1 -1
- package/vendor/precinct.js +5914 -3591
- package/vendor/valibot.js +418 -504
- package/dist/Servers/MatchedRouteInfo.d.ts +0 -11
- package/dist/Servers/MatchedRouteInfo.d.ts.map +0 -1
- package/dist/routing/__fluentRouteBuilder.d.ts +0 -80
- package/dist/routing/__fluentRouteBuilder.d.ts.map +0 -1
- package/dist/routing/__fluentRouteBuilder.js +0 -183
- package/dist/routing/__fluentRoutes.d.ts +0 -2
- package/dist/routing/__fluentRoutes.d.ts.map +0 -1
- package/dist/routing/__fluentRoutes.js +0 -59
- package/vendor/chunk-Hy-cCmu-.js +0 -23
- /package/dist/{Servers → routing}/MatchedRouteInfo.js +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ErrorRouteType } from './ErrorRouteType.js';
|
|
2
|
+
import type { Routes, RoutesWithSettings } from './Routes.js';
|
|
3
|
+
import type { Endpoint, Path } from './RouteTypes.js';
|
|
4
|
+
export type RouteEntry<G extends object = object> = (Endpoint<any, any, G> & {
|
|
5
|
+
path: Path | 'default' | '404';
|
|
6
|
+
}) | (ErrorRouteType & {
|
|
7
|
+
path: 'error';
|
|
8
|
+
});
|
|
9
|
+
export type RoutesArray<G extends object = object> = readonly RouteEntry<G>[];
|
|
10
|
+
export declare function routesFromArray(entries: RoutesArray<any>, dev: boolean): Routes<any>;
|
|
11
|
+
export declare const toRoutes: <Rs extends object>(routes: Rs | RoutesArray<any>, dev: boolean) => Rs | RoutesWithSettings<any>;
|
|
12
|
+
export type KeyedRoutes<Rs> = Rs extends RoutesArray<any> ? {
|
|
13
|
+
[Entry in Rs[number] as Entry['path']]: Omit<Entry, 'path'>;
|
|
14
|
+
} : Rs;
|
|
15
|
+
type IsOnePath<P extends PropertyKey> = Record<never, never> extends Record<P, 1> ? false : true;
|
|
16
|
+
type DuplicatePath<T, Seen = never> = T extends readonly [infer H, ...infer Rest] ? H extends {
|
|
17
|
+
path: infer P extends PropertyKey;
|
|
18
|
+
} ? IsOnePath<P> extends false ? DuplicatePath<Rest, Seen> : P extends Seen ? P : DuplicatePath<Rest, Seen | P> : DuplicatePath<Rest, Seen> : never;
|
|
19
|
+
type ReturnedRoutes<R> = R extends (...args: never[]) => infer Rs ? Rs : R;
|
|
20
|
+
type GivenTwice<P extends string> = `The routes give the path '${P}' twice. Each path can have one route.`;
|
|
21
|
+
export type NoDuplicatePaths<R> = [DuplicatePath<ReturnedRoutes<R>>] extends [never] ? unknown : GivenTwice<DuplicatePath<ReturnedRoutes<R>> & string>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=routesArray.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routesArray.d.ts","sourceRoot":"","sources":["../../src/routing/routesArray.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAOrD,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAC1C,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG;IAAE,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,KAAK,CAAA;CAAE,CAAC,GAC5D,CAAC,cAAc,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAE1C,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,CAAA;AAI7E,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAYpF;AAGD,eAAO,MAAM,QAAQ,GAAI,EAAE,SAAS,MAAM,EACtC,QAAQ,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,OAAO,KAC5C,EAAE,GAAG,kBAAkB,CAAC,GAAG,CACmC,CAAA;AAQjE,MAAM,MAAM,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,GACnD;KAAG,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;CAAE,GAC/D,EAAE,CAAA;AAMR,KAAK,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAA;AAChG,KAAK,aAAa,CAAC,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,IAAI,CAAC,GAC3E,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,SAAS,WAAW,CAAA;CAAE,GAC3C,SAAS,CAAC,CAAC,CAAC,SAAS,KAAK,GACtB,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,GACzB,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,GACtD,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,GAC7B,KAAK,CAAA;AACX,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAE1E,KAAK,UAAU,CAAC,CAAC,SAAS,MAAM,IAC1B,6BAA6B,CAAC,wCAAwC,CAAA;AAG5E,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAC9E,OAAO,GACP,UAAU,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TungstenError } from '../TungstenError.js';
|
|
2
|
+
// the array form as the object form. A path given twice is an error in dev; otherwise the last
|
|
3
|
+
// one wins, as a repeated key does in an object
|
|
4
|
+
export function routesFromArray(entries, dev) {
|
|
5
|
+
const routes = {};
|
|
6
|
+
for (const {
|
|
7
|
+
path,
|
|
8
|
+
...endpoint
|
|
9
|
+
} of entries) {
|
|
10
|
+
if (dev && Object.hasOwn(routes, path)) {
|
|
11
|
+
throw new TungstenError(`The routes give the path '${path}' twice. Each path can have one route.`);
|
|
12
|
+
}
|
|
13
|
+
routes[path] = endpoint;
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- keyed by entry path
|
|
16
|
+
return routes;
|
|
17
|
+
}
|
|
18
|
+
// the array form carries no RoutesSettings, so they read as unset
|
|
19
|
+
export const toRoutes = (routes, dev) => isRoutesArray(routes) ? routesFromArray(routes, dev) : routes;
|
|
20
|
+
const isRoutesArray = routes => Array.isArray(routes);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routesArray.types.test.d.ts","sourceRoot":"","sources":["../../src/routing/routesArray.types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { appBuilder } from '../appBuilder.js';
|
|
2
|
+
import { pipeline } from '../pipeline/pipeline.js';
|
|
3
|
+
import { route } from './builder.js';
|
|
4
|
+
/*
|
|
5
|
+
* Type tests for the array routes form. tsc is the assertion - nothing here runs.
|
|
6
|
+
*/
|
|
7
|
+
const _routes = () => [route({
|
|
8
|
+
path: '/leads/:id<1+>',
|
|
9
|
+
content: null
|
|
10
|
+
}), route({
|
|
11
|
+
path: '/about',
|
|
12
|
+
content: null
|
|
13
|
+
}), route({
|
|
14
|
+
path: '404',
|
|
15
|
+
content: null
|
|
16
|
+
})];
|
|
17
|
+
// the route and path types read the array form as they read the object form
|
|
18
|
+
const leadPath = '/leads/5';
|
|
19
|
+
const aboutPath = '/about';
|
|
20
|
+
// @ts-expect-error -- not a route
|
|
21
|
+
const nopePath = '/nope';
|
|
22
|
+
const routeKeys = ['/leads/:id<1+>', '/about', '404'];
|
|
23
|
+
// @ts-expect-error -- not a route key
|
|
24
|
+
const nopeKey = '/nope';
|
|
25
|
+
void leadPath;
|
|
26
|
+
void aboutPath;
|
|
27
|
+
void nopePath;
|
|
28
|
+
void routeKeys;
|
|
29
|
+
void nopeKey;
|
|
30
|
+
// a plain array works too
|
|
31
|
+
const _array = [route({
|
|
32
|
+
path: '/a',
|
|
33
|
+
content: null
|
|
34
|
+
})];
|
|
35
|
+
const arrayPath = '/a';
|
|
36
|
+
void arrayPath;
|
|
37
|
+
// a path starts with / or names a special route
|
|
38
|
+
// @ts-expect-error -- neither
|
|
39
|
+
route({
|
|
40
|
+
path: 'foo',
|
|
41
|
+
content: null
|
|
42
|
+
});
|
|
43
|
+
// the error route's content is a function without data, which route() does not take: a plain entry
|
|
44
|
+
appBuilder.routes(() => [route({
|
|
45
|
+
path: '/e',
|
|
46
|
+
content: null
|
|
47
|
+
}), {
|
|
48
|
+
path: 'error',
|
|
49
|
+
content: () => null
|
|
50
|
+
}]);
|
|
51
|
+
// @ts-expect-error -- and it is typed as the error route
|
|
52
|
+
appBuilder.routes(() => [{
|
|
53
|
+
path: 'error',
|
|
54
|
+
content: info => info.nope
|
|
55
|
+
}]);
|
|
56
|
+
// the app builder takes the array form
|
|
57
|
+
appBuilder.routes(() => [route({
|
|
58
|
+
path: '/b',
|
|
59
|
+
content: null
|
|
60
|
+
})]);
|
|
61
|
+
appBuilder.routes([route({
|
|
62
|
+
path: '/c',
|
|
63
|
+
content: null
|
|
64
|
+
})]);
|
|
65
|
+
// ---- a path given twice, at registration ------------------------------------
|
|
66
|
+
appBuilder.routes(() => [route({
|
|
67
|
+
path: '/a',
|
|
68
|
+
content: null
|
|
69
|
+
}), route({
|
|
70
|
+
path: '/b',
|
|
71
|
+
content: null
|
|
72
|
+
}), route({
|
|
73
|
+
path: '404',
|
|
74
|
+
content: null
|
|
75
|
+
})]);
|
|
76
|
+
// @ts-expect-error -- '/a' twice
|
|
77
|
+
appBuilder.routes(() => [route({
|
|
78
|
+
path: '/a',
|
|
79
|
+
content: null
|
|
80
|
+
}), route({
|
|
81
|
+
path: '/a',
|
|
82
|
+
content: 'x'
|
|
83
|
+
})]);
|
|
84
|
+
// @ts-expect-error -- given directly, too
|
|
85
|
+
appBuilder.routes([route({
|
|
86
|
+
path: '/a',
|
|
87
|
+
content: null
|
|
88
|
+
}), route({
|
|
89
|
+
path: '/a',
|
|
90
|
+
content: null
|
|
91
|
+
})]);
|
|
92
|
+
// @ts-expect-error -- and without route()
|
|
93
|
+
appBuilder.routes(() => [{
|
|
94
|
+
path: '/a',
|
|
95
|
+
content: null
|
|
96
|
+
}, {
|
|
97
|
+
path: '/a',
|
|
98
|
+
content: null
|
|
99
|
+
}]);
|
|
100
|
+
// @ts-expect-error -- and in the pipeline
|
|
101
|
+
pipeline.server('express').routes(() => [route({
|
|
102
|
+
path: '/a',
|
|
103
|
+
content: null
|
|
104
|
+
}), route({
|
|
105
|
+
path: '/a',
|
|
106
|
+
content: null
|
|
107
|
+
})]);
|
|
108
|
+
appBuilder.routes(() => [route({
|
|
109
|
+
path: somePath,
|
|
110
|
+
content: null
|
|
111
|
+
}), route({
|
|
112
|
+
path: '/a',
|
|
113
|
+
content: null
|
|
114
|
+
})]);
|
|
115
|
+
// a computed array is not a tuple, so it is left to the check when the routes are read
|
|
116
|
+
const computed = [route({
|
|
117
|
+
path: '/a',
|
|
118
|
+
content: null
|
|
119
|
+
}), route({
|
|
120
|
+
path: '/a',
|
|
121
|
+
content: null
|
|
122
|
+
})];
|
|
123
|
+
appBuilder.routes(() => computed);
|
|
124
|
+
// the object form is untouched
|
|
125
|
+
appBuilder.routes(() => ({
|
|
126
|
+
'/a': {
|
|
127
|
+
content: null
|
|
128
|
+
},
|
|
129
|
+
'404': {
|
|
130
|
+
content: null
|
|
131
|
+
}
|
|
132
|
+
}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReqRes, ReqResOrNull } from '../ReqRes.js';
|
|
2
|
+
import type { RoutesWithSettings } from './Routes.js';
|
|
3
|
+
import type { ContextClasses } from '../context/registerContext.js';
|
|
4
|
+
import type { Routing, RoutesFunctionGeneric, Serializable } from './registerRouting.js';
|
|
5
|
+
import type { Fixed } from './registrationTypes.js';
|
|
6
|
+
type NetworkedStoreClass<C, ND> = (new (reqRes: ReqResOrNull, context: C) => ND) & (new (reqRes: ReqResOrNull, context: C) => Serializable<NoInfer<ND>>);
|
|
7
|
+
type GetGlobalData<C, ND, G extends object> = ((reqRes: ReqRes | null, context: C, networkedData: ND) => Promise<G>) & ((reqRes: ReqRes | null, context: C, networkedData: ND) => Promise<Serializable<NoInfer<G>>>);
|
|
8
|
+
type RoutesMethod<C, ND, G extends object> = {
|
|
9
|
+
routes: <Rs extends RoutesWithSettings<G>>(getRoutes: RoutesFunctionGeneric<G, C, ND, Rs>) => Routing<Rs, G, C, ND>;
|
|
10
|
+
};
|
|
11
|
+
type GlobalDataMethod<C, ND> = {
|
|
12
|
+
globalData: <G extends object>(getGlobalData: GetGlobalData<C, ND, G>) => RoutesStage<C, ND, G>;
|
|
13
|
+
};
|
|
14
|
+
type NetworkedDataMethod<C> = {
|
|
15
|
+
networkedData: <ND extends object>(networkedDataInitializer: NetworkedStoreClass<C, ND>) => GlobalDataStage<C, ND>;
|
|
16
|
+
};
|
|
17
|
+
type RoutesStage<C, ND, G extends object> = RoutesMethod<C, ND, G> & Fixed<{
|
|
18
|
+
context: C;
|
|
19
|
+
networkedStore: ND;
|
|
20
|
+
globalData: G;
|
|
21
|
+
}>;
|
|
22
|
+
type GlobalDataStage<C, ND> = RoutesMethod<C, ND, object> & GlobalDataMethod<C, ND> & Fixed<{
|
|
23
|
+
context: C;
|
|
24
|
+
networkedStore: ND;
|
|
25
|
+
}>;
|
|
26
|
+
type NetworkedDataStage<C> = RoutesMethod<C, undefined, object> & GlobalDataMethod<C, undefined> & NetworkedDataMethod<C> & Fixed<{
|
|
27
|
+
context: C;
|
|
28
|
+
}>;
|
|
29
|
+
type ContextStage = RoutesMethod<undefined, undefined, object> & GlobalDataMethod<undefined, undefined> & NetworkedDataMethod<undefined> & {
|
|
30
|
+
context: <C extends object>(contextInitializer: (new (reqRes: ReqResOrNull) => C) | ContextClasses) => NetworkedDataStage<C>;
|
|
31
|
+
};
|
|
32
|
+
export declare const register: ContextStage;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=routingBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routingBuilder.d.ts","sourceRoot":"","sources":["../../src/routing/routingBuilder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEjF,OAAO,KAAK,EACmB,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAC1E,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAoCnD,KAAK,mBAAmB,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAC1E,CAAC,KAAK,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,KAAK,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAG3E,KAAK,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,MAAM,IACpC,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,KAAK,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAQnG,KAAK,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,MAAM,IAAI;IAEzC,MAAM,EAAE,CAAC,EAAE,SAAS,kBAAkB,CAAC,CAAC,CAAC,EACrC,SAAS,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KAC7C,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;CAC7B,CAAA;AAED,KAAK,gBAAgB,CAAC,CAAC,EAAE,EAAE,IAAI;IAC3B,UAAU,EAAE,CAAC,CAAC,SAAS,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;CAClG,CAAA;AAED,KAAK,mBAAmB,CAAC,CAAC,IAAI;IAE1B,aAAa,EAAE,CAAC,EAAE,SAAS,MAAM,EAC7B,wBAAwB,EAAE,mBAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,KACnD,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;CAC9B,CAAA;AAED,KAAK,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,MAAM,IAClC,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;IAAE,OAAO,EAAE,CAAC,CAAC;IAAC,cAAc,EAAE,EAAE,CAAC;IAAC,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,CAAA;AAGvF,KAAK,eAAe,CAAC,CAAC,EAAE,EAAE,IACpB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,GACrD,KAAK,CAAC;IAAE,OAAO,EAAE,CAAC,CAAC;IAAC,cAAc,EAAE,EAAE,CAAA;CAAE,CAAC,CAAA;AAE/C,KAAK,kBAAkB,CAAC,CAAC,IACnB,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,GAC5F,KAAK,CAAC;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,CAAA;AAG3B,KAAK,YAAY,GAAG,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,GACxD,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,GAAG;IACxE,OAAO,EAAE,CAAC,CAAC,SAAS,MAAM,EACtB,kBAAkB,EAAE,CAAC,KAAK,MAAM,EAAE,YAAY,KAAK,CAAC,CAAC,GAAG,cAAc,KACrE,kBAAkB,CAAC,CAAC,CAAC,CAAA;CAC7B,CAAA;AAgCL,eAAO,MAAM,QAAQ,EAAE,YAA6B,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { registeredRouting, registeredNetworkedStore } from './routingRegistry.js';
|
|
2
|
+
import { contextRegistration } from '../context/registerContext.js';
|
|
3
|
+
import { globalDataFunc } from './registerGlobalData.js';
|
|
4
|
+
function makeStages(pending) {
|
|
5
|
+
return {
|
|
6
|
+
context: contextInitializer => makeStages({
|
|
7
|
+
...pending,
|
|
8
|
+
context: contextInitializer
|
|
9
|
+
}),
|
|
10
|
+
// eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- C is erased at the registry, which holds the class unparameterised
|
|
11
|
+
networkedData: networkedDataInitializer => makeStages({
|
|
12
|
+
...pending,
|
|
13
|
+
networkedStore: networkedDataInitializer
|
|
14
|
+
}),
|
|
15
|
+
globalData: getGlobalData => makeStages({
|
|
16
|
+
...pending,
|
|
17
|
+
globalData: getGlobalData
|
|
18
|
+
}),
|
|
19
|
+
routes: getRoutes => {
|
|
20
|
+
registeredRouting.value = getRoutes;
|
|
21
|
+
if (pending.globalData !== undefined) globalDataFunc.value = pending.globalData;
|
|
22
|
+
if (pending.context !== undefined) contextRegistration.value = pending.context;
|
|
23
|
+
if (pending.networkedStore !== undefined) {
|
|
24
|
+
registeredNetworkedStore.value = pending.networkedStore;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
// unchecked: every method hands back this one untyped shape, not the stage it promises, and the
|
|
29
|
+
// Fixed records exist only in the types
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// the entry point. Every stage is optional except .routes(), which commits the chain
|
|
33
|
+
export const register = makeStages({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routingBuilder.types.test.d.ts","sourceRoot":"","sources":["../../src/routing/routingBuilder.types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import { register } from './routingBuilder.js';
|
|
5
|
+
/*
|
|
6
|
+
* Type tests for the staged builder. tsc is the assertion - nothing here runs.
|
|
7
|
+
*
|
|
8
|
+
* What is being pinned: each stage fixes ONE type parameter from ONE argument, so every later
|
|
9
|
+
* stage sees a concrete type. The cases below check that the later callbacks really do see the
|
|
10
|
+
* earlier types, that skipping a stage leaves `undefined` rather than collapsing, and that the
|
|
11
|
+
* serializable checks land on the argument at fault.
|
|
12
|
+
*/
|
|
13
|
+
const routes = {
|
|
14
|
+
default: {
|
|
15
|
+
content: null
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
class AppContext {
|
|
19
|
+
constructor(reqRes) {
|
|
20
|
+
_defineProperty(this, "user", {
|
|
21
|
+
id: 1
|
|
22
|
+
});
|
|
23
|
+
void reqRes;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class AppStore {
|
|
27
|
+
// the store is built after the context, so it may read it
|
|
28
|
+
constructor(reqRes, context) {
|
|
29
|
+
_defineProperty(this, "userId", void 0);
|
|
30
|
+
_defineProperty(this, "token", 'abc');
|
|
31
|
+
void reqRes;
|
|
32
|
+
this.userId = context.user.id;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// ---- the full chain ---------------------------------------------------------
|
|
36
|
+
const _full = register.context(AppContext).networkedData(AppStore).globalData(async (reqRes, context, networkedData) => {
|
|
37
|
+
// both earlier stages are concrete here, with no annotation and no cast
|
|
38
|
+
const id = context.user.id;
|
|
39
|
+
const token = networkedData.token;
|
|
40
|
+
return await Promise.resolve({
|
|
41
|
+
id,
|
|
42
|
+
token
|
|
43
|
+
});
|
|
44
|
+
}).routes((reqRes, context, networkedData) => {
|
|
45
|
+
// and so are they here, alongside the global data's own type
|
|
46
|
+
const id = context.user.id;
|
|
47
|
+
const token = networkedData.token;
|
|
48
|
+
void id;
|
|
49
|
+
void token;
|
|
50
|
+
return routes;
|
|
51
|
+
});
|
|
52
|
+
const fullContext = fullC;
|
|
53
|
+
const fullStore = fullNd;
|
|
54
|
+
const fullData = fullG;
|
|
55
|
+
const fullRoutes = fullRs;
|
|
56
|
+
void fullContext;
|
|
57
|
+
void fullStore;
|
|
58
|
+
void fullData;
|
|
59
|
+
void fullRoutes;
|
|
60
|
+
// the cases above would pass just as well if the parameters were silently `any`, so each one is
|
|
61
|
+
// probed for a member that does not exist. Without these, "the later stages see the types" can
|
|
62
|
+
// mean only that we have stopped checking
|
|
63
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment -- suppressing the type error leaves the
|
|
64
|
+
property error-typed, which is exactly what these cases are for */
|
|
65
|
+
register.context(AppContext).networkedData(AppStore)
|
|
66
|
+
// @ts-expect-error -- `nope` is not on AppContext, so the context is not any
|
|
67
|
+
.globalData(async (reqRes, context) => Promise.resolve({
|
|
68
|
+
x: context.nope
|
|
69
|
+
})).routes(() => routes);
|
|
70
|
+
register.context(AppContext).networkedData(AppStore)
|
|
71
|
+
// @ts-expect-error -- `nope` is not on AppStore, so the store is not any
|
|
72
|
+
.globalData(async (reqRes, context, networkedData) => Promise.resolve({
|
|
73
|
+
x: networkedData.nope
|
|
74
|
+
})).routes(() => routes);
|
|
75
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
|
|
76
|
+
register.context(AppContext).routes((reqRes, context) => {
|
|
77
|
+
// @ts-expect-error -- and the same inside the routes callback
|
|
78
|
+
void context.nope;
|
|
79
|
+
return routes;
|
|
80
|
+
});
|
|
81
|
+
// ---- reading a type off an unfinished chain ---------------------------------
|
|
82
|
+
// an app augments Context from the stage after .context(): read off the finished routing, a
|
|
83
|
+
// callback in the chain that names the augmented type would be part of its own definition
|
|
84
|
+
const withContext = register.context(AppContext);
|
|
85
|
+
const stageContext = stageC;
|
|
86
|
+
const withStore = withContext.networkedData(AppStore);
|
|
87
|
+
const stageStore = stageNd;
|
|
88
|
+
const stageStoreContext = stageStoreC;
|
|
89
|
+
void stageContext;
|
|
90
|
+
void stageStore;
|
|
91
|
+
void stageStoreContext;
|
|
92
|
+
const _staged = withStore.globalData(async (reqRes, context, networkedData) => Promise.resolve({
|
|
93
|
+
id: context.user.id,
|
|
94
|
+
token: networkedData.token
|
|
95
|
+
})).routes(() => routes);
|
|
96
|
+
const stagedData = stagedG;
|
|
97
|
+
void stagedData;
|
|
98
|
+
// ---- skipping stages --------------------------------------------------------
|
|
99
|
+
const _noneAtAll = register.routes(() => routes);
|
|
100
|
+
const skippedContext = noneC;
|
|
101
|
+
void skippedContext;
|
|
102
|
+
const _contextOnly = register.context(AppContext).routes((reqRes, context) => {
|
|
103
|
+
const id = context.user.id;
|
|
104
|
+
void id;
|
|
105
|
+
return routes;
|
|
106
|
+
});
|
|
107
|
+
const keptContext = contextOnlyC;
|
|
108
|
+
void keptContext;
|
|
109
|
+
const _dataOnly = register.globalData(async () => Promise.resolve({
|
|
110
|
+
n: 1
|
|
111
|
+
})).routes(() => routes);
|
|
112
|
+
const keptData = dataOnlyG;
|
|
113
|
+
void keptData;
|
|
114
|
+
// ---- a stage cannot be taken twice, or out of order -------------------------
|
|
115
|
+
// @ts-expect-error -- .context is gone once taken
|
|
116
|
+
register.context(AppContext).context(AppContext);
|
|
117
|
+
// @ts-expect-error -- .context cannot follow .globalData
|
|
118
|
+
register.globalData(async () => Promise.resolve({})).context(AppContext);
|
|
119
|
+
// @ts-expect-error -- .networkedData cannot follow .globalData
|
|
120
|
+
register.globalData(async () => Promise.resolve({})).networkedData(AppStore);
|
|
121
|
+
// ---- what cannot cross the network ------------------------------------------
|
|
122
|
+
class StoreHoldingReqRes {
|
|
123
|
+
constructor(reqRes) {
|
|
124
|
+
_defineProperty(this, "reqRes", void 0);
|
|
125
|
+
_defineProperty(this, "token", 'abc');
|
|
126
|
+
this.reqRes = reqRes;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
register.context(AppContext)
|
|
130
|
+
// @ts-expect-error -- on THIS argument: "Type 'Request' is not assignable to type 'JsonValue'"
|
|
131
|
+
.networkedData(StoreHoldingReqRes).routes(() => routes);
|
|
132
|
+
register
|
|
133
|
+
// @ts-expect-error -- on THIS callback: "Types of property 'leaked' are incompatible"
|
|
134
|
+
.globalData(async reqRes => Promise.resolve({
|
|
135
|
+
leaked: reqRes
|
|
136
|
+
})).routes(() => routes);
|
|
137
|
+
// ---- the routes are checked against the global data -------------------------
|
|
138
|
+
// Rs is constrained by RoutesWithSettings<G>, with G already concrete by this point
|
|
139
|
+
register.globalData(async () => Promise.resolve({
|
|
140
|
+
n: 1
|
|
141
|
+
}))
|
|
142
|
+
// @ts-expect-error -- routes must have a `default` or a `404`
|
|
143
|
+
.routes(() => ({
|
|
144
|
+
'/somewhere': {
|
|
145
|
+
content: null
|
|
146
|
+
}
|
|
147
|
+
}));
|
|
148
|
+
// G reaches a route's content function, which is the point of fixing it first: by the time
|
|
149
|
+
// .routes() is called G is a concrete type, not a parameter still being inferred elsewhere
|
|
150
|
+
register.globalData(async () => Promise.resolve({
|
|
151
|
+
n: 1
|
|
152
|
+
})).routes(() => ({
|
|
153
|
+
default: {
|
|
154
|
+
content: (routeData, routeParams, props, globalData) => {
|
|
155
|
+
const n = globalData.n;
|
|
156
|
+
void n;
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}));
|
|
161
|
+
register.globalData(async () => Promise.resolve({
|
|
162
|
+
n: 1
|
|
163
|
+
})).routes(() => ({
|
|
164
|
+
default: {
|
|
165
|
+
content: (routeData, routeParams, props, globalData) => {
|
|
166
|
+
// @ts-expect-error -- and it is checked: `nope` is not on the global data
|
|
167
|
+
void globalData.nope;
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AppRoutes } from './AppRoutes.js';
|
|
2
|
+
import type { ReqRes } from '../ReqRes.js';
|
|
3
|
+
import type { BrandedContext, BrandedNetworkedData } from '../Brands.js';
|
|
4
|
+
import type { Context } from '../context/registerContext.js';
|
|
5
|
+
import type { Serializable } from './Serializable.js';
|
|
6
|
+
import type { Fixed } from './registrationTypes.js';
|
|
7
|
+
export interface NetworkedData {
|
|
8
|
+
}
|
|
9
|
+
export declare const registeredRouting: {
|
|
10
|
+
value: AppRoutes<any> | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const registeredNetworkedStore: {
|
|
13
|
+
value: (new (reqRes: ReqRes | null, context: BrandedContext) => object) | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare function registerNetworkedData<ND extends object>(store: (new (reqRes: ReqRes | null, context: Context) => ND) & (new (reqRes: ReqRes | null, context: Context) => Serializable<NoInfer<ND>>)): Fixed<{
|
|
16
|
+
networkedStore: ND;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function createNetworkedData(reqRes: ReqRes | null, context: BrandedContext): BrandedNetworkedData;
|
|
19
|
+
//# sourceMappingURL=routingRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routingRegistry.d.ts","sourceRoot":"","sources":["../../src/routing/routingRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAmB,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAMnD,MAAM,WAAW,aAAa;CAAG;AAIjC,eAAO,MAAM,iBAAiB,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS,CAAA;CAAyB,CAAA;AAG5F,eAAO,MAAM,wBAAwB,EAAE;IACnC,KAAK,EAAE,CAAC,KAAK,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,cAAc,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;CAC/D,CAAA;AAKxB,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,MAAM,EACnD,KAAK,EAAE,CAAC,KAAK,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,KAAK,EAAE,CAAC,GAEtD,CAAC,KAAK,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,KAAK,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,GACnF,KAAK,CAAC;IAAE,cAAc,EAAE,EAAE,CAAA;CAAE,CAAC,CAI/B;AAQD,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,cAAc,GAC/C,oBAAoB,CAKtB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// all set by registerRouting() when the app's routes module is imported. The routes stand in for
|
|
2
|
+
// routesLocation's named export. Reset per request in dev, like globalDataFunc
|
|
3
|
+
export const registeredRouting = {
|
|
4
|
+
value: undefined
|
|
5
|
+
};
|
|
6
|
+
// handed the request's context, whichever way the store was registered
|
|
7
|
+
export const registeredNetworkedStore = {
|
|
8
|
+
value: undefined
|
|
9
|
+
};
|
|
10
|
+
// the store is handed the global Context; ND is inferred from the class, and handed back as a
|
|
11
|
+
// type-only token for NetworkedData's augmentation - `NetworkedDataType<typeof registration>`.
|
|
12
|
+
// Also set by registerRouting() and the routing builder - the last registration wins
|
|
13
|
+
export function registerNetworkedData(store) {
|
|
14
|
+
registeredNetworkedStore.value = store;
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- the token is type-only
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
// made per request on the server, once per page on the client - beside createContext(), because
|
|
19
|
+
// the routes function receives it and that runs before initStores(). {} when none is registered,
|
|
20
|
+
// so nothing downstream tests for absence (as createContext does)
|
|
21
|
+
// the context is passed too: it is built first, so a store registered through routingBuilder may
|
|
22
|
+
// take it as a second constructor argument. A one-argument store simply ignores it. Required, not
|
|
23
|
+
// defaulted: a default handed the store a different context from the one the request made
|
|
24
|
+
export function createNetworkedData(reqRes, context) {
|
|
25
|
+
const registered = registeredNetworkedStore.value;
|
|
26
|
+
if (registered === undefined) return {};
|
|
27
|
+
// as createContext: the app's class returns an object, which carries no symbol index signature
|
|
28
|
+
return new registered(reqRes, context);
|
|
29
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AppRoutes } from '
|
|
1
|
+
import type { AppRoutes } from '../routing/AppRoutes.js';
|
|
2
2
|
import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
|
|
3
3
|
import type { CompilationInfo } from '../build/CompilationInfo.js';
|
|
4
|
-
export declare function getAppRoutes(compilationInfo: CompilationInfo, config: FrameworkConfigComplete, quiet?: boolean): Promise<AppRoutes
|
|
4
|
+
export declare function getAppRoutes(compilationInfo: CompilationInfo, config: FrameworkConfigComplete, quiet?: boolean): Promise<AppRoutes<any>>;
|
|
5
5
|
//# sourceMappingURL=getAppRoutes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAppRoutes.d.ts","sourceRoot":"","sources":["../../src/staticGen/getAppRoutes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getAppRoutes.d.ts","sourceRoot":"","sources":["../../src/staticGen/getAppRoutes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAalE,wBAAsB,YAAY,CAC9B,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,uBAAuB,EAAE,KAAK,UAAQ,GACjF,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAuBzB"}
|
|
@@ -2,11 +2,16 @@ import { join } from 'path';
|
|
|
2
2
|
import { fixExtension } from '../fixExtension.js';
|
|
3
3
|
import { TungstenError } from '../TungstenError.js';
|
|
4
4
|
import { cliLog } from '../cliOutput.js';
|
|
5
|
+
import { importModule } from '../importModule.js';
|
|
6
|
+
import { routesLocationParts } from '../routesLocationParts.js';
|
|
7
|
+
import { resolveAppRoutes } from '../routing/resolveAppRoutes.js';
|
|
5
8
|
// prod: const appRoutes: AppRoutes = await getRoutes(this.compilationInfo, this.config)
|
|
6
9
|
// this file is outdated and may not work correctly
|
|
7
10
|
// should compare this to the functions used by Servers
|
|
8
11
|
export async function getAppRoutes(compilationInfo, config, quiet = false) {
|
|
9
|
-
const
|
|
12
|
+
const {
|
|
13
|
+
routesFile
|
|
14
|
+
} = routesLocationParts(config.routesLocation);
|
|
10
15
|
try {
|
|
11
16
|
const filePath = fixExtension(join(compilationInfo.buildCodeLocation, routesFile));
|
|
12
17
|
if (!quiet) {
|
|
@@ -17,11 +22,9 @@ export async function getAppRoutes(compilationInfo, config, quiet = false) {
|
|
|
17
22
|
}
|
|
18
23
|
const target = 'file://' + filePath;
|
|
19
24
|
if (!quiet) cliLog('[1] target', target);
|
|
20
|
-
const module = await
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return module[routeExport];
|
|
25
|
+
const module = await importModule(target);
|
|
26
|
+
// importing the module is what runs the app's registerRouting() call
|
|
27
|
+
return resolveAppRoutes(module, config.routesLocation, 'prod');
|
|
25
28
|
} catch (e) {
|
|
26
29
|
throw new TungstenError(`Error loading app routes.` + ` You can specify the location of your routes object in tungsten.config.js,` + ` e.g. routesLocation: ['Routes.jsx', 'routes'] (file, exportName)` + `\n${e}`);
|
|
27
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticGen.d.ts","sourceRoot":"","sources":["../../src/staticGen/staticGen.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"staticGen.d.ts","sourceRoot":"","sources":["../../src/staticGen/staticGen.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAqBhD,wBAAsB,SAAS,CAAC,SAAS,EAAE,SAAS,iBA4NnD"}
|
|
@@ -9,6 +9,7 @@ import { staticSiteFolder, staticFolder, assetsFolder, publicFolder, bundleFolde
|
|
|
9
9
|
import { getAppRoutes } from './getAppRoutes.js';
|
|
10
10
|
import { cliError, cliLog, cliWarn } from '../cliOutput.js';
|
|
11
11
|
import { matchPath } from '../routing/matchPath.js';
|
|
12
|
+
import { toRoutes } from '../routing/routesArray.js';
|
|
12
13
|
import { throwError } from '../throwError.js';
|
|
13
14
|
import { RouteKeyIsPath, StringIsPath } from '../routing/RouteTypes.js';
|
|
14
15
|
import { findLinks, pathToLink, pathToFileName, rewriteLinks } from './staticGenFunctions.js';
|
|
@@ -26,8 +27,10 @@ export async function staticGen(framework) {
|
|
|
26
27
|
const projectDir = process.cwd();
|
|
27
28
|
//let appRoutes: RouteDefinition[] | Record<RouteKey, RouteDefinition> = await getAppRoutes(framework.compilationInfo, config)
|
|
28
29
|
const getRoutes = await getAppRoutes(framework.compilationInfo, config, quiet);
|
|
30
|
+
// only the paths are read here, with no request - nothing reads the networked store
|
|
31
|
+
const networkedData = {};
|
|
29
32
|
// ! unsure about this
|
|
30
|
-
//
|
|
33
|
+
// the routes proper, without RoutesSettings, whose symbol keys iteration never meets
|
|
31
34
|
const appRoutes = getRoutes === null ? {
|
|
32
35
|
'/': {
|
|
33
36
|
content: 'Code for static rendering SPA TBC'
|
|
@@ -35,7 +38,10 @@ export async function staticGen(framework) {
|
|
|
35
38
|
404: {
|
|
36
39
|
content: '404 TBC'
|
|
37
40
|
}
|
|
38
|
-
}
|
|
41
|
+
}
|
|
42
|
+
// only the paths are read here, with no request; each page is then fetched from the prod
|
|
43
|
+
// server, whose request makes its context
|
|
44
|
+
: toRoutes(typeof getRoutes === 'function' ? getRoutes(null, {}, networkedData) : getRoutes, false);
|
|
39
45
|
const buildLocation = framework.compilationInfo.location;
|
|
40
46
|
const server = await framework.createProdServer();
|
|
41
47
|
const serverLocation = await server.start(null, true); // port, mute
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleContentSxy.d.ts","sourceRoot":"","sources":["../../src/style/styleContentSxy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"styleContentSxy.d.ts","sourceRoot":"","sources":["../../src/style/styleContentSxy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EACH,KAAK,WAAW,EAEnB,MAAM,mBAAmB,CAAA;AAe1B,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,eAIrE"}
|
package/dist/sync/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAMxE,eAAO,MAAM,IAAI,SAAK,CAAA;AAEtB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,QAM7F"}
|
package/dist/sync/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// @
|
|
4
|
-
module.exports = global.__tungsten_framework_modules;
|
|
3
|
+
module.exports = globalThis.__tungsten_framework_modules; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|