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
|
@@ -4,7 +4,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
4
4
|
import { isClient } from '../isClient.js';
|
|
5
5
|
import { routing } from "../Servers/routing.js";
|
|
6
6
|
import { RoutingRedirect } from '../routing/RoutingRedirect.js';
|
|
7
|
-
import { routeKeyToUrl,
|
|
7
|
+
import { routeKeyToUrl, urlToLocation } from '../routing/routeUrl.js';
|
|
8
8
|
import { isProd } from '../isProd.js';
|
|
9
9
|
import { WebRedirect } from '../routing/WebRedirect.js';
|
|
10
10
|
import { RouteRedirectComponent } from "../components/RouteRedirectComponent.js";
|
|
@@ -14,13 +14,16 @@ import { ContentNodeIsClassComponent } from '../ContentNode.js';
|
|
|
14
14
|
import { $props, $type } from '../contentNodeSymbols.js';
|
|
15
15
|
import { errorOut } from '../appOutput.js';
|
|
16
16
|
import { makeTungstenErrorInfo } from '../routing/TungstenErrorInfo.js';
|
|
17
|
+
import { toRoutes } from '../routing/routesArray.js';
|
|
18
|
+
import { globalDataFunc } from '../routing/registerGlobalData.js';
|
|
17
19
|
import { tAssert } from '../assert.js';
|
|
18
20
|
import { throwError } from '../throwError.js';
|
|
21
|
+
import { clientRoute } from '../pipeline/pipelineDefinition.js';
|
|
19
22
|
export class Instance {
|
|
20
23
|
constructor(_location, instanceConfig, reqRes, appRoutes, routes,
|
|
21
24
|
//globalData: GlobalData,
|
|
22
25
|
//matchedRouteInfo: MatchedRouteInfo
|
|
23
|
-
internalStore, stores, storeSubscriptions,
|
|
26
|
+
internalStore, stores, storeSubscriptions, _globalData, _matchedRouteInfo, runtimeContext) {
|
|
24
27
|
_defineProperty(this, "location", void 0);
|
|
25
28
|
_defineProperty(this, "reqRes", void 0);
|
|
26
29
|
_defineProperty(this, "appRoutes", void 0);
|
|
@@ -36,10 +39,20 @@ export class Instance {
|
|
|
36
39
|
//routerDataError?: unknown
|
|
37
40
|
//routerData?: any
|
|
38
41
|
_defineProperty(this, "config", void 0);
|
|
39
|
-
|
|
40
|
-
_defineProperty(this, "
|
|
42
|
+
// prod: web path of each site file -> content hash, for ?v= cache busting (fileVersions.ts)
|
|
43
|
+
_defineProperty(this, "fileVersions", undefined);
|
|
44
|
+
// the registered context (registerRouting): one per request on the server, per page on the
|
|
45
|
+
// client. Never undefined - createContext() gives {} when the app registered none
|
|
46
|
+
_defineProperty(this, "context", {});
|
|
47
|
+
// replaced after construction, not using undef to avoid type issues
|
|
48
|
+
// the registered networked store, made beside the context and before routing, since the
|
|
49
|
+
// routes function takes it. Same {} when none is registered
|
|
50
|
+
_defineProperty(this, "networkedData", {});
|
|
51
|
+
// replaced after construction, not using undef to avoid type issues
|
|
41
52
|
_defineProperty(this, "globalData", void 0);
|
|
42
53
|
_defineProperty(this, "matchedRouteInfo", void 0);
|
|
54
|
+
_defineProperty(this, "title", void 0);
|
|
55
|
+
_defineProperty(this, "defaultTitle", '');
|
|
43
56
|
_defineProperty(this, "persistentHeadChildren", void 0);
|
|
44
57
|
//navigationIndex: number = 0
|
|
45
58
|
//lastNavigation: number = 0
|
|
@@ -48,16 +61,22 @@ export class Instance {
|
|
|
48
61
|
_defineProperty(this, "registeredComponents", []);
|
|
49
62
|
// set when the server has answered the request with a redirect, so it sends nothing more
|
|
50
63
|
_defineProperty(this, "redirected", undefined);
|
|
64
|
+
// the pipeline's, set by hydratePipeline(): client navigation routes with Init's context, as
|
|
65
|
+
// the server did, and reruns the all-routes data. Unset, goto() takes the classic path
|
|
66
|
+
_defineProperty(this, "pipeline", undefined);
|
|
67
|
+
// the split pipeline's networked data as the page carries it, on both sides: createStore's
|
|
68
|
+
// second argument
|
|
69
|
+
_defineProperty(this, "pipelineNetworked", {});
|
|
51
70
|
_defineProperty(this, "routeKeyToUrl", routeKey => {
|
|
52
71
|
return routeKeyToUrl(routeKey, this.config.siteBasePath, isProd && this.config.staticSite);
|
|
53
72
|
});
|
|
54
73
|
// unchecked: goto's routing() does the pattern matching and 404 fallback
|
|
55
|
-
_defineProperty(this, "
|
|
56
|
-
const
|
|
57
|
-
return
|
|
74
|
+
_defineProperty(this, "urlToLocation", url => {
|
|
75
|
+
const location = urlToLocation(url, this.config.siteBasePath, isProd && this.config.staticSite);
|
|
76
|
+
return location; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
58
77
|
});
|
|
59
78
|
_defineProperty(this, "getRoutes", () => {
|
|
60
|
-
return typeof this.appRoutes === 'function' ? this.appRoutes(this.reqRes) : this.appRoutes;
|
|
79
|
+
return toRoutes(typeof this.appRoutes === 'function' ? this.appRoutes(this.reqRes, this.context, this.networkedData) : this.appRoutes, !this.config.prod);
|
|
61
80
|
});
|
|
62
81
|
_defineProperty(this, "updateLocation", location => {
|
|
63
82
|
//if (this.internalStore === undefined) {
|
|
@@ -66,18 +85,19 @@ export class Instance {
|
|
|
66
85
|
this.location = location;
|
|
67
86
|
this.internalStore.location.set(location);
|
|
68
87
|
});
|
|
88
|
+
// 'history': the browser has already moved to path (back/forward)
|
|
69
89
|
_defineProperty(this, "goto", async (path, {
|
|
70
|
-
|
|
90
|
+
cause = 'navigate'
|
|
71
91
|
} = {}) => {
|
|
72
92
|
if (isServer) {
|
|
73
93
|
this.redirect(this.routeKeyToUrl(path));
|
|
74
94
|
return;
|
|
75
95
|
}
|
|
76
|
-
//
|
|
77
|
-
|
|
96
|
+
// a history move within the page (a #fragment): the browser has already scrolled
|
|
97
|
+
if (cause === 'history' && path === this.location) return;
|
|
78
98
|
if (!this.config.clientSideNav) {
|
|
79
99
|
// if clientSideNav is off, these navs should turn into requests to the server
|
|
80
|
-
this.httpTo(this.routeKeyToUrl(path));
|
|
100
|
+
if (cause === 'history') this.httpReload();else this.httpTo(this.routeKeyToUrl(path));
|
|
81
101
|
return;
|
|
82
102
|
}
|
|
83
103
|
// the store types these two readonly for everyone else; goto() is what owns them
|
|
@@ -89,8 +109,11 @@ export class Instance {
|
|
|
89
109
|
// get route data
|
|
90
110
|
try {
|
|
91
111
|
let matchedRouteInfo;
|
|
112
|
+
// global data runs before any route renders, here as before SSR; beside routing, as there
|
|
113
|
+
let globalData = this.globalData;
|
|
114
|
+
const pipeline = this.pipeline;
|
|
92
115
|
try {
|
|
93
|
-
matchedRouteInfo = await routing(path, this.getRoutes());
|
|
116
|
+
[matchedRouteInfo, globalData] = await Promise.all([pipeline === undefined ? routing(path, this.getRoutes(), this.context, this.networkedData) : routing(path, this.getRoutes(), pipeline.routingContext, pipeline.routingNetworkedData), pipeline === undefined ? globalDataFunc.value?.(null, this.context, this.networkedData) ?? globalData : pipeline.allRoutesData?.() ?? globalData]);
|
|
94
117
|
} catch (error) {
|
|
95
118
|
errorOut(`Tungsten client navigation to '${path}' failed while loading route data:`, error);
|
|
96
119
|
const errorRoute = this.routes.error;
|
|
@@ -111,7 +134,8 @@ export class Instance {
|
|
|
111
134
|
// data here is the result of the route data function
|
|
112
135
|
if (matchedRouteInfo.data instanceof RoutingRedirect) {
|
|
113
136
|
const redirect = matchedRouteInfo.data;
|
|
114
|
-
|
|
137
|
+
// awaited, so goto() settles when the navigation it started has
|
|
138
|
+
await this.goto(redirect.to);
|
|
115
139
|
return;
|
|
116
140
|
} else if (matchedRouteInfo.data instanceof WebRedirect) {
|
|
117
141
|
// A WebRedirect names a URL rather than a route, so it leaves the
|
|
@@ -129,21 +153,29 @@ export class Instance {
|
|
|
129
153
|
// ) {
|
|
130
154
|
if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)) {
|
|
131
155
|
if (matchedRouteInfo.content[$type] === RouteRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof RouteRedirectComponent) {
|
|
132
|
-
this.goto(matchedRouteInfo.content[$props].to);
|
|
156
|
+
await this.goto(matchedRouteInfo.content[$props].to);
|
|
133
157
|
return;
|
|
134
158
|
} else if (matchedRouteInfo.content[$type] === WebRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof WebRedirectComponent) {
|
|
135
|
-
console.log('Content is a WebRedirectComponent - perform a hard redirect')
|
|
159
|
+
//console.log('Content is a WebRedirectComponent - perform a hard redirect')
|
|
136
160
|
this.redirect(matchedRouteInfo.content[$props].to);
|
|
137
161
|
return;
|
|
138
162
|
}
|
|
139
163
|
}
|
|
164
|
+
// after routing, before the render: the components' context for the new route
|
|
165
|
+
const afterRouting = pipeline?.afterRouting;
|
|
166
|
+
if (afterRouting !== undefined) {
|
|
167
|
+
const context = await afterRouting(clientRoute(matchedRouteInfo, path), globalData);
|
|
168
|
+
if (i !== navigationIndex.get()) return;
|
|
169
|
+
this.context = context;
|
|
170
|
+
}
|
|
140
171
|
//console.log('updating route info to', matchedRouteInfo)
|
|
141
172
|
//console.log('instance goto')
|
|
142
173
|
//console.log('siteBasePath', this.config.siteBasePath)
|
|
143
174
|
//console.log('location', location)
|
|
144
175
|
//console.log('final dest', this.config.siteBasePath + location)
|
|
176
|
+
this.globalData = globalData;
|
|
145
177
|
this.matchedRouteInfo = matchedRouteInfo;
|
|
146
|
-
if (isClient &&
|
|
178
|
+
if (isClient && cause === 'navigate') {
|
|
147
179
|
const runtimeWindow = this.runtimeContext?.window ?? window;
|
|
148
180
|
runtimeWindow.history.pushState(null, '', this.routeKeyToUrl(path));
|
|
149
181
|
}
|
|
@@ -186,6 +218,13 @@ export class Instance {
|
|
|
186
218
|
const runtimeWindow = this.runtimeContext?.window ?? window;
|
|
187
219
|
runtimeWindow.location.assign(url);
|
|
188
220
|
});
|
|
221
|
+
_defineProperty(this, "httpReload", () => {
|
|
222
|
+
if (!isClient) {
|
|
223
|
+
throwError('httpReload', 'Cannot modify window location on the server');
|
|
224
|
+
}
|
|
225
|
+
const runtimeWindow = this.runtimeContext?.window ?? window;
|
|
226
|
+
runtimeWindow.location.reload();
|
|
227
|
+
});
|
|
189
228
|
_defineProperty(this, "setDefaultTitle", defaultTitle => {
|
|
190
229
|
this.defaultTitle = defaultTitle;
|
|
191
230
|
});
|
|
@@ -244,7 +283,7 @@ export class Instance {
|
|
|
244
283
|
this.storeSubscriptions = storeSubscriptions;
|
|
245
284
|
this.appRoutes = appRoutes;
|
|
246
285
|
this.routes = routes;
|
|
247
|
-
this.globalData =
|
|
286
|
+
this.globalData = _globalData;
|
|
248
287
|
this.matchedRouteInfo = _matchedRouteInfo;
|
|
249
288
|
this.config = instanceConfig; // createInstanceConfig(appConfig)
|
|
250
289
|
this.persistentHeadChildren = [];
|
|
@@ -256,9 +295,8 @@ export class Instance {
|
|
|
256
295
|
runtimeWindow.addEventListener('popstate', event => {
|
|
257
296
|
//console.log('popstate', window.location.pathname)
|
|
258
297
|
//this.updateLocation(window.location.pathname)
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
pushHistory: false
|
|
298
|
+
void this.goto(this.urlToLocation(runtimeWindow.location), {
|
|
299
|
+
cause: 'history'
|
|
262
300
|
});
|
|
263
301
|
});
|
|
264
302
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SiteBasePath } from '
|
|
1
|
+
import type { SiteBasePath } from '../render/HeadData.js';
|
|
2
2
|
export type InstanceConfig = {
|
|
3
3
|
prod: boolean;
|
|
4
4
|
useRootComponent: boolean;
|
|
@@ -7,5 +7,6 @@ export type InstanceConfig = {
|
|
|
7
7
|
staticSite: boolean;
|
|
8
8
|
csr: boolean;
|
|
9
9
|
sourceDir?: string;
|
|
10
|
+
registration?: 'pipeline';
|
|
10
11
|
};
|
|
11
12
|
//# sourceMappingURL=InstanceConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceConfig.d.ts","sourceRoot":"","sources":["../../src/Instance/InstanceConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"InstanceConfig.d.ts","sourceRoot":"","sources":["../../src/Instance/InstanceConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIzD,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,YAAY,CAAA;IAC1B,UAAU,EAAE,OAAO,CAAA;IACnB,GAAG,EAAE,OAAO,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,YAAY,CAAC,EAAE,UAAU,CAAA;CAC5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderedContentNode.d.ts","sourceRoot":"","sources":["../src/RenderedContentNode.ts"],"names":[],"mappings":"AACA,OAAO,KAA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AyB,GAAG,IAAI,IAAI,uBAAuB,CAEhH;AAED,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,mBAAmB,GAAG,GAAG,IAAI,4BAA4B,CAE5G;AACD,wBAAgB,oCAAoC,CAChD,IAAI,EAAE,yBAAyB,GAChC,IAAI,IAAI,4BAA4B,CAEtC;AACD,wBAAgB,kCAAkC,CAC9C,IAAI,EAAE,uBAAuB,GAC9B,IAAI,IAAI,4BAA4B,CAEtC;AAGD,wBAAgB,kCAAkC,IAAI,8BAA8B,CAEnF;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,0BAA0B,CAchH;AAED,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,WAAW,EACpB,gBAAgB,EAAE,mBAAmB,GAAG,YAAY,GACrD,uBAAuB,CAMzB;AAGD,wBAAgB,qCAAqC,CACjD,WAAW,EAAE,yBAAyB,EACtC,OAAO,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EACxC,cAAc,EAAE,OAAO,EACvB,cAAc,EAAE,OAAO,GACxB,iCAAiC,CAOnC;AAED,wBAAgB,wCAAwC,CACpD,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,EAClC,cAAc,EAAE,OAAO,EACvB,cAAc,EAAE,OAAO,GACxB,oCAAoC,CAOtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderingNode.d.ts","sourceRoot":"","sources":["../src/RenderingNode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AACxF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"RenderingNode.d.ts","sourceRoot":"","sources":["../src/RenderingNode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAA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EAC3C,iBAAiB,EAAE,aAAa,EAChC,WAAW,CAAC,EAAE,OAAO,GACtB,8BAA8B,CAUhC;AAED,wBAAgB,oDAAoD,CAChE,WAAW,EAAE,yBAAyB,EACtC,OAAO,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,2BAA2B,GAAG,IAAI,EAC7E,iBAAiB,EAAE,aAAa,GACjC,wBAAwB,CAS1B;AAGD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,IAAI,oBAAoB,CAExF;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,IAAI,iBAAiB,CAElF;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,IAAI,iBAAiB,CAEhG;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,oBAAoB,GACpE,IAAI,IAAI,2BAA2B,GAAG,8BAA8B,CAGzE;AAMD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,IAAI,oBAAoB,CAExF;AAGD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,IAAI,wBAAwB,CAEhG;AACD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,IAAI,qBAAqB,CAE1F"}
|
|
@@ -5,7 +5,8 @@ import type { CompilationInfo } from '../build/CompilationInfo.js';
|
|
|
5
5
|
import type { ApiRoutes } from '../api/ApiRoutes.js';
|
|
6
6
|
import type { Framework } from '../Framework.js';
|
|
7
7
|
import type { ReqRes } from '../ReqRes.js';
|
|
8
|
-
import {
|
|
8
|
+
import type { BrandedContext, BrandedGlobalData, BrandedNetworkedData } from '../Brands.js';
|
|
9
|
+
import { type BrandedGlobalDataFunction } from '../routing/registerGlobalData.js';
|
|
9
10
|
import { TungstenServer } from './TungstenServer.jsx';
|
|
10
11
|
export declare class DevServer extends TungstenServer {
|
|
11
12
|
framework: Framework;
|
|
@@ -35,10 +36,11 @@ export declare class DevServer extends TungstenServer {
|
|
|
35
36
|
private static readonly reloadDebounceMs;
|
|
36
37
|
private broadcastReloadEvent;
|
|
37
38
|
private sourceFileToUrlPath;
|
|
39
|
+
private pipelineHandler;
|
|
38
40
|
private handleRequestApi;
|
|
39
41
|
private handleRequest;
|
|
40
42
|
private tryRenderErrorRoute;
|
|
41
|
-
getGlobalData: (func:
|
|
43
|
+
getGlobalData: (func: BrandedGlobalDataFunction, reqRes: ReqRes, context: BrandedContext, networkedData: BrandedNetworkedData) => Promise<BrandedGlobalData>;
|
|
42
44
|
errorLog: (error: unknown) => void;
|
|
43
45
|
errorPage: (error: unknown, errorTrack: string[]) => string;
|
|
44
46
|
start: () => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevServer.d.ts","sourceRoot":"","sources":["../../src/Servers/DevServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"DevServer.d.ts","sourceRoot":"","sources":["../../src/Servers/DevServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAEN,MAAM,SAAS,CAAA;AAOhB,OAAO,KAAK,EAAE,uBAAuB,EAAwB,MAAM,uBAAuB,CAAA;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAM1C,OAAO,KAAK,EACkC,cAAc,EAAE,iBAAiB,EAC3E,oBAAoB,EACvB,MAAM,cAAc,CAAA;AAsBrB,OAAO,EAAkB,KAAK,yBAAyB,EAAE,MAA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AgB,CAcvB;IAED,OAAO,CAAC,aAAa,CAuPpB;IAaD,OAAO,CAAC,mBAAmB,CA2C1B;IAID,aAAa,GACT,MAAM,yBAAyB,EAAE,QAAQ,MAAM,EAAE,SAAS,cAAc,EAAE,eAAe,oBAAoB,KAC9G,OAAO,CAAC,iBAAiB,CAAC,CAQ5B;IACD,QAAQ,GAAI,OAAO,OAAO,UAIzB;IACD,SAAS,GAAI,OAAO,OAAO,EAAE,YAAY,MAAM,EAAE,YAehD;IAGD,KAAK;;;;OA+BJ;IACD,IAAI,aAMH;CAGJ"}
|
|
@@ -26,17 +26,23 @@ import { serveStatic } from './serveStatic.js';
|
|
|
26
26
|
// old loading method
|
|
27
27
|
import { routing } from "./routing.js";
|
|
28
28
|
import { globalDataFunc } from '../routing/registerGlobalData.js';
|
|
29
|
+
import { createNetworkedData } from '../routing/routingRegistry.js';
|
|
29
30
|
import { TungstenServer } from "./TungstenServer.js";
|
|
30
31
|
import { portError } from './portError.js';
|
|
31
32
|
import { loadEnvsDev } from './loadEnvsDev.js';
|
|
32
33
|
import { initStores } from './initStores.js';
|
|
34
|
+
import { createContext } from '../context/registerContext.js';
|
|
33
35
|
import { makeTungstenErrorInfo } from '../routing/TungstenErrorInfo.js';
|
|
34
36
|
import { MatchedRoute } from '../routing/MatchedRoute.js';
|
|
37
|
+
import { toRoutes } from '../routing/routesArray.js';
|
|
38
|
+
import { resetRegistrations } from './resetRegistrations.js';
|
|
39
|
+
import { PipelineRequestHandler } from '../pipeline/PipelineRequestHandler.js';
|
|
40
|
+
import { importRoutesModule } from '../pipeline/importRoutesModule.js';
|
|
35
41
|
import { iterationQueryString } from '../iterationQueryString.js';
|
|
36
42
|
import { onReloadEvent } from '../hmr/liveReloadHub.js';
|
|
37
43
|
import { importDevModuleWithRetry } from '../importDevModuleWithRetry.js';
|
|
38
|
-
import { devErrorPageAutoRetryScript } from './devErrorPageAutoRetry.js';
|
|
39
44
|
import { listenVerified, registerBootProbe } from './listenVerified.js';
|
|
45
|
+
import { JSONstringify } from '../json.js';
|
|
40
46
|
//import cookieParser from 'cookie-parser'
|
|
41
47
|
function debug(...texts) {
|
|
42
48
|
// console.log(...texts)
|
|
@@ -142,7 +148,7 @@ export class DevServer extends TungstenServer {
|
|
|
142
148
|
res.setHeader('Cache-Control', 'no-cache');
|
|
143
149
|
res.setHeader('Connection', 'keep-alive');
|
|
144
150
|
res.flushHeaders();
|
|
145
|
-
res.write(`event: boot\ndata: ${
|
|
151
|
+
res.write(`event: boot\ndata: ${JSONstringify({
|
|
146
152
|
bootId: this.bootId
|
|
147
153
|
})}\n\n`);
|
|
148
154
|
this.liveReloadClients.add(res);
|
|
@@ -172,7 +178,7 @@ export class DevServer extends TungstenServer {
|
|
|
172
178
|
// css events, or if a js event arrived with no known source file - the client falls
|
|
173
179
|
// back to a full reload in both cases.
|
|
174
180
|
const files = finalKind === 'js' ? [...this.pendingReloadFiles].map(this.sourceFileToUrlPath) : [];
|
|
175
|
-
const payload =
|
|
181
|
+
const payload = JSONstringify({
|
|
176
182
|
files
|
|
177
183
|
});
|
|
178
184
|
for (const client of this.liveReloadClients) client.write(`event: ${finalKind}\ndata: ${payload}\n\n`);
|
|
@@ -187,6 +193,35 @@ export class DevServer extends TungstenServer {
|
|
|
187
193
|
const rel = fixExtension(slash(relative(this.compilationInfo.codeLocation, file)));
|
|
188
194
|
return `/${this.compilationInfo.codeSubPath}/${rel}`;
|
|
189
195
|
});
|
|
196
|
+
// pages under config.registration 'pipeline': the app is re-imported per request, as below
|
|
197
|
+
_defineProperty(this, "pipelineHandler", () => new PipelineRequestHandler({
|
|
198
|
+
dev: true,
|
|
199
|
+
config: this.config,
|
|
200
|
+
instanceConfig: () => makeInstanceConfigFromFrameworkConfig(this.config, true),
|
|
201
|
+
fileVersions: undefined,
|
|
202
|
+
loadApp: async () => {
|
|
203
|
+
this.firstRender = false;
|
|
204
|
+
const iteration = this.iterationCount++;
|
|
205
|
+
resetRegistrations();
|
|
206
|
+
await loadEnvsDev(this.config, iteration, this.initialProcessEnv, false);
|
|
207
|
+
const [app, Root] = await Promise.all([importRoutesModule(this.compilationInfo, this.config, iteration), this.config.useRootComponent ? getComponentDev(join(this.compilationInfo.buildCodeLocation, this.config.rootComponent), this.config.rootComponent, iteration) : null]);
|
|
208
|
+
return {
|
|
209
|
+
Root,
|
|
210
|
+
app
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
render: async (Root, instance) => {
|
|
214
|
+
if (this.framework.clientImportAliases === undefined) {
|
|
215
|
+
throwError('DevServer', 'framework.clientImportAliases is undefined');
|
|
216
|
+
}
|
|
217
|
+
return renderRootToHtmlDev(this.compilationInfo, this.framework.clientImportAliases, Root, instance, this.config, global.tungstenPublicEnv, '' // siteBasePathOverride
|
|
218
|
+
);
|
|
219
|
+
},
|
|
220
|
+
errorPage: error => {
|
|
221
|
+
this.errorLog(error);
|
|
222
|
+
return this.errorPage(error, []);
|
|
223
|
+
}
|
|
224
|
+
}));
|
|
190
225
|
_defineProperty(this, "handleRequestApi", async (req, res, next) => {
|
|
191
226
|
req.params.foo;
|
|
192
227
|
this.apiRoutes = await getApiRoutes(this.config, this.compilationInfo, 'dev');
|
|
@@ -233,8 +268,11 @@ export class DevServer extends TungstenServer {
|
|
|
233
268
|
// Defaults to {} to match the "no global data function registered" branch below,
|
|
234
269
|
// which resolves synchronously to {} and is never itself a failure case.
|
|
235
270
|
let capturedGlobalData = {};
|
|
271
|
+
// this request's context: made once the app code, which registers it, has loaded
|
|
272
|
+
let capturedContext = {};
|
|
273
|
+
let capturedNetworkedData = {};
|
|
236
274
|
try {
|
|
237
|
-
const _firstRender = this.firstRender
|
|
275
|
+
//const _firstRender = this.firstRender
|
|
238
276
|
this.firstRender = false;
|
|
239
277
|
const iteration = this.iterationCount++;
|
|
240
278
|
//console.log('received a frontend req', req.originalUrl, res.locals.reqId)
|
|
@@ -253,7 +291,7 @@ export class DevServer extends TungstenServer {
|
|
|
253
291
|
if (this.framework.clientImportAliases === undefined) {
|
|
254
292
|
throwError('DevServer.handleRequest()', 'framework.frameworkModules is undefined');
|
|
255
293
|
}
|
|
256
|
-
|
|
294
|
+
resetRegistrations();
|
|
257
295
|
//const load = await createLoad(import.meta.url, sxyLoaderConfig)
|
|
258
296
|
await loadEnvsDev(this.config, iteration, this.initialProcessEnv, false);
|
|
259
297
|
// we are delaying instance creation until after we load the app code, to lets things initialise?
|
|
@@ -267,13 +305,15 @@ export class DevServer extends TungstenServer {
|
|
|
267
305
|
};
|
|
268
306
|
//const routingPromise = getRoutesDev(this.compilationInfo, this.config, load).then(
|
|
269
307
|
const routingPromise = getRoutesDev(this.compilationInfo, this.config, iteration).then(async appRoutes => {
|
|
270
|
-
|
|
308
|
+
capturedContext = createContext('server', reqRes);
|
|
309
|
+
capturedNetworkedData = createNetworkedData(reqRes, capturedContext);
|
|
310
|
+
const routes = toRoutes(typeof appRoutes === 'function' ? appRoutes(reqRes, capturedContext, capturedNetworkedData) : appRoutes, true);
|
|
271
311
|
capturedRoutes = routes;
|
|
272
312
|
// load data, and do routing
|
|
273
313
|
return promiseAllObj({
|
|
274
314
|
appRoutes,
|
|
275
315
|
routes,
|
|
276
|
-
globalData: globalDataFunc.value !== undefined ? this.getGlobalData(globalDataFunc.value, reqRes).then(globalData => {
|
|
316
|
+
globalData: globalDataFunc.value !== undefined ? this.getGlobalData(globalDataFunc.value, reqRes, capturedContext, capturedNetworkedData).then(globalData => {
|
|
277
317
|
capturedGlobalData = globalData;
|
|
278
318
|
return globalData;
|
|
279
319
|
}).catch(e => {
|
|
@@ -282,7 +322,7 @@ export class DevServer extends TungstenServer {
|
|
|
282
322
|
errorTrack.push(msg);
|
|
283
323
|
throw e;
|
|
284
324
|
}) : {},
|
|
285
|
-
matchedRouteInfo: routing(location, routes, serverDataLoading).catch(e => {
|
|
325
|
+
matchedRouteInfo: routing(location, routes, capturedContext, capturedNetworkedData, serverDataLoading).catch(e => {
|
|
286
326
|
const msg = 'Error performing routing';
|
|
287
327
|
cliError(msg);
|
|
288
328
|
errorTrack.push(msg);
|
|
@@ -333,7 +373,7 @@ export class DevServer extends TungstenServer {
|
|
|
333
373
|
// })
|
|
334
374
|
);
|
|
335
375
|
} else {
|
|
336
|
-
console.log('do routing')
|
|
376
|
+
//console.log('do routing')
|
|
337
377
|
({
|
|
338
378
|
appRoutes,
|
|
339
379
|
routes,
|
|
@@ -356,9 +396,11 @@ export class DevServer extends TungstenServer {
|
|
|
356
396
|
internalStore,
|
|
357
397
|
stores,
|
|
358
398
|
storeSubscriptions
|
|
359
|
-
} = initStores(location, reqRes, globalData, matchedRouteInfo, serverDataLoading);
|
|
399
|
+
} = initStores(location, reqRes, globalData, matchedRouteInfo, serverDataLoading, capturedContext, capturedNetworkedData);
|
|
360
400
|
// create the instance
|
|
361
401
|
const instance = new Instance(location, instanceConfig, reqRes, appRoutes, routes, internalStore, stores, storeSubscriptions, globalData, matchedRouteInfo);
|
|
402
|
+
instance.context = capturedContext;
|
|
403
|
+
instance.networkedData = capturedNetworkedData;
|
|
362
404
|
let html;
|
|
363
405
|
if (RootComponentClass) {
|
|
364
406
|
html = await renderRootToHtmlDev(this.compilationInfo, this.framework.clientImportAliases, RootComponentClass, instance, this.config, global.tungstenPublicEnv, '' // siteBasePathOverride
|
|
@@ -391,7 +433,7 @@ export class DevServer extends TungstenServer {
|
|
|
391
433
|
cliLog('');
|
|
392
434
|
// too late for an error page once a redirect has gone out
|
|
393
435
|
if (res.headersSent) return;
|
|
394
|
-
const errorRouteHtml = await this.tryRenderErrorRoute(req, res, capturedRoutes, capturedRootComponentClass, capturedGlobalData, e);
|
|
436
|
+
const errorRouteHtml = await this.tryRenderErrorRoute(req, res, capturedRoutes, capturedRootComponentClass, capturedGlobalData, capturedContext, capturedNetworkedData, e);
|
|
395
437
|
res.setHeader('Content-Type', 'text/html');
|
|
396
438
|
res.status(500);
|
|
397
439
|
res.send(errorRouteHtml ?? this.errorPage(e, errorTrack));
|
|
@@ -409,7 +451,7 @@ export class DevServer extends TungstenServer {
|
|
|
409
451
|
// falls back to null (the caller's default error page) on any failure, since we're
|
|
410
452
|
// already handling one error and can't risk a second, unhandled one taking the dev
|
|
411
453
|
// server down.
|
|
412
|
-
_defineProperty(this, "tryRenderErrorRoute", async (req, res, routes, RootComponentClass, globalData, error) => {
|
|
454
|
+
_defineProperty(this, "tryRenderErrorRoute", async (req, res, routes, RootComponentClass, globalData, context, networkedData, error) => {
|
|
413
455
|
try {
|
|
414
456
|
if (routes === undefined) return null;
|
|
415
457
|
const errorRouteDef = routes.error;
|
|
@@ -435,8 +477,10 @@ export class DevServer extends TungstenServer {
|
|
|
435
477
|
internalStore,
|
|
436
478
|
stores,
|
|
437
479
|
storeSubscriptions
|
|
438
|
-
} = initStores(req.url, reqRes, globalData, matchedRouteInfo, serverDataLoading);
|
|
480
|
+
} = initStores(req.url, reqRes, globalData, matchedRouteInfo, serverDataLoading, context, networkedData);
|
|
439
481
|
const instance = new Instance(req.url, instanceConfig, reqRes, routes, routes, internalStore, stores, storeSubscriptions, globalData, matchedRouteInfo);
|
|
482
|
+
instance.context = context;
|
|
483
|
+
instance.networkedData = networkedData;
|
|
440
484
|
return await renderRootToHtmlDev(this.compilationInfo, this.framework.clientImportAliases, RootComponentClass ?? MatchedRoute, instance, this.config, global.tungstenPublicEnv, '' // siteBasePathOverride
|
|
441
485
|
);
|
|
442
486
|
} catch (renderError) {
|
|
@@ -448,9 +492,9 @@ export class DevServer extends TungstenServer {
|
|
|
448
492
|
// private async handlePost(req: express.Request, res: express.Response): Promise<void> {
|
|
449
493
|
// throw new TungstenError(`Err - Dev server received a post request. Not supported yet.`)
|
|
450
494
|
// }
|
|
451
|
-
_defineProperty(this, "getGlobalData", async (func, reqRes) => {
|
|
495
|
+
_defineProperty(this, "getGlobalData", async (func, reqRes, context, networkedData) => {
|
|
452
496
|
try {
|
|
453
|
-
return await func(reqRes);
|
|
497
|
+
return await func(reqRes, context, networkedData);
|
|
454
498
|
} catch (e) {
|
|
455
499
|
cliError('Error fetching global data');
|
|
456
500
|
//cliError(e)
|
|
@@ -463,13 +507,11 @@ export class DevServer extends TungstenServer {
|
|
|
463
507
|
log('end error log');
|
|
464
508
|
});
|
|
465
509
|
_defineProperty(this, "errorPage", (error, errorTrack) => {
|
|
466
|
-
const autoRetryScript = devErrorPageAutoRetryScript(error);
|
|
467
510
|
return `<!DOCTYPE html>
|
|
468
511
|
<html>
|
|
469
512
|
<head>
|
|
470
513
|
<title>Error</title>
|
|
471
514
|
<style>html { font-family: arial }</style>
|
|
472
|
-
${autoRetryScript ? `<script>${autoRetryScript}</script>` : ''}
|
|
473
515
|
</head>
|
|
474
516
|
<body>
|
|
475
517
|
<h1>Application Error</h1>
|
|
@@ -499,7 +541,7 @@ export class DevServer extends TungstenServer {
|
|
|
499
541
|
const publicOrigin = this.makeOrigin(FRONTEND_PROTO ?? 'http', FRONTEND_HOSTNAME ?? 'localhost', FRONTEND_PORT || port);
|
|
500
542
|
this.publicOrigin = publicOrigin;
|
|
501
543
|
if (localOrigin !== publicOrigin) {
|
|
502
|
-
cliNews(`
|
|
544
|
+
cliNews(`Public URL: ${publicOrigin}`);
|
|
503
545
|
}
|
|
504
546
|
// Tungsten only serves over http, so the seen origin will always
|
|
505
547
|
// be http even if the FRONTEND_PROTO is https. The hostname+port
|
|
@@ -574,7 +616,7 @@ export class DevServer extends TungstenServer {
|
|
|
574
616
|
cliWarn(`Received a request from the frontend, but it did not arrive at the` + ` address the frontend was loaded from. This may indicate a` + ` misconfiguration, and may prevent the passing of cookies to the` + ` tungsten server.`);
|
|
575
617
|
cliWarn(`request: ${target}`);
|
|
576
618
|
cliWarn(`loaded from: ${origin}`);
|
|
577
|
-
cliWarn(`arrived at: ${host}`);
|
|
619
|
+
cliWarn(`arrived at: ${this.arrivedAt(host, req.protocol)}`);
|
|
578
620
|
}
|
|
579
621
|
}
|
|
580
622
|
next();
|
|
@@ -612,7 +654,7 @@ export class DevServer extends TungstenServer {
|
|
|
612
654
|
this.app.use(apiPath, express.json());
|
|
613
655
|
this.app.use(apiPath, this.handleRequestApi);
|
|
614
656
|
}
|
|
615
|
-
this.app.use(this.handleRequest);
|
|
657
|
+
this.app.use(config.registration === 'pipeline' ? this.pipelineHandler().handle : this.handleRequest);
|
|
616
658
|
// !!! obsolete?
|
|
617
659
|
// start hooking into require to rewrite react requires to tungsten
|
|
618
660
|
//addRequireResolveHooks() // we need this for server side
|
|
@@ -7,12 +7,13 @@ import type { Framework } from '../Framework.js';
|
|
|
7
7
|
import type { AnyComponentType } from '../AnyComponentType.js';
|
|
8
8
|
import type { AppRoutes } from '../routing/AppRoutes.js';
|
|
9
9
|
import type { ServerMiddleware } from './ServerMiddleware.js';
|
|
10
|
+
import type { PipelineApp } from '../pipeline/pipelineDefinition.js';
|
|
10
11
|
import { TungstenServer } from './TungstenServer.jsx';
|
|
11
12
|
export declare class ProdServer extends TungstenServer {
|
|
12
13
|
framework: Framework;
|
|
13
14
|
config: FrameworkConfigComplete;
|
|
14
15
|
compilationInfo: CompilationInfo;
|
|
15
|
-
appRoutes: AppRoutes
|
|
16
|
+
appRoutes: AppRoutes<any>;
|
|
16
17
|
RootComponentOrNull: AnyComponentType | null;
|
|
17
18
|
publicOrigin: string | null;
|
|
18
19
|
expectedHost: string | null;
|
|
@@ -21,7 +22,8 @@ export declare class ProdServer extends TungstenServer {
|
|
|
21
22
|
apiRoutes?: ApiRoutes;
|
|
22
23
|
server?: Server;
|
|
23
24
|
private bootId;
|
|
24
|
-
constructor(framework: Framework, config: FrameworkConfigComplete, compilationInfo: CompilationInfo, appRoutes: AppRoutes
|
|
25
|
+
constructor(framework: Framework, config: FrameworkConfigComplete, compilationInfo: CompilationInfo, appRoutes: AppRoutes<any>, RootComponentOrNull: AnyComponentType | null, serverMiddleware: ServerMiddleware | null, pipelineApp?: PipelineApp | null);
|
|
26
|
+
readonly requestHandler: (req: express.Request, res: express.Response) => Promise<void>;
|
|
25
27
|
private handleRequestApi;
|
|
26
28
|
handleRequest: (req: express.Request, res: express.Response) => Promise<void>;
|
|
27
29
|
private tryRenderErrorRoute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProdServer.d.ts","sourceRoot":"","sources":["../../src/Servers/ProdServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"ProdServer.d.ts","sourceRoot":"","sources":["../../src/Servers/ProdServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAA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