tungsten 0.6.3 → 0.7.1
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 +9 -1
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FrameworkConfig.types.test.d.ts +2 -0
- package/dist/FrameworkConfig.types.test.d.ts.map +1 -0
- package/dist/FrameworkConfig.types.test.js +6 -0
- 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 +21 -9
- package/dist/Instance/Instance.d.ts.map +1 -1
- package/dist/Instance/Instance.js +42 -38
- package/dist/Instance/InstanceConfig.d.ts +3 -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 +72 -21
- package/dist/Servers/ProdServer.d.ts +5 -2
- package/dist/Servers/ProdServer.d.ts.map +1 -1
- package/dist/Servers/ProdServer.js +95 -19
- 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 +12 -7
- package/dist/Servers/stubInstance.d.ts +8 -0
- package/dist/Servers/stubInstance.d.ts.map +1 -0
- package/dist/Servers/stubInstance.js +40 -0
- 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 +19 -0
- package/dist/componentHelpers.d.ts.map +1 -0
- package/dist/componentHelpers.js +31 -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 +16 -2
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +15 -3
- 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/getUserConfig.d.ts.map +1 -1
- 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 +86 -52
- 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/hydrate/stubRouting.d.ts +8 -0
- package/dist/hydrate/stubRouting.d.ts.map +1 -0
- package/dist/hydrate/stubRouting.js +25 -0
- 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/makeFinalConfig.d.ts.map +1 -1
- package/dist/makeFinalConfig.js +2 -0
- package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -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 +104 -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 +83 -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 +107 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/pipeline.js +113 -0
- package/dist/pipeline/pipeline.types.test.d.ts +760 -0
- package/dist/pipeline/pipeline.types.test.d.ts.map +1 -0
- package/dist/pipeline/pipeline.types.test.js +344 -0
- package/dist/pipeline/pipelineDefinition.d.ts +78 -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 +2445 -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 +29 -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 +52 -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 +6 -2
- 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 +13 -0
- package/dist/routing/MatchedRouteInfo.d.ts.map +1 -0
- package/dist/routing/MatchedRouteInfo.js +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/RouteTypes.d.ts +6 -4
- package/dist/routing/RouteTypes.d.ts.map +1 -1
- package/dist/routing/Routes.d.ts +20 -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 +100 -0
- package/dist/routing/builder.d.ts.map +1 -0
- package/dist/routing/builder.js +219 -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/redirectOf.d.ts +11 -0
- package/dist/routing/redirectOf.d.ts.map +1 -0
- package/dist/routing/redirectOf.js +32 -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/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 +32 -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/contentToString.d.ts +13 -0
- package/dist/testing/contentToString.d.ts.map +1 -0
- package/dist/testing/contentToString.js +105 -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/display.d.ts +2 -0
- package/dist/testing/display.d.ts.map +1 -0
- package/dist/testing/display.js +37 -0
- package/dist/testing/ensure.d.ts +119 -0
- package/dist/testing/ensure.d.ts.map +1 -0
- package/dist/testing/ensure.js +664 -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/ensure.types.test.d.ts +2 -0
- package/dist/testing/ensure.types.test.d.ts.map +1 -0
- package/dist/testing/ensure.types.test.js +34 -0
- package/dist/testing/helpers/contentHtmlElements.d.ts.map +1 -1
- package/dist/testing/host.d.ts +86 -15
- package/dist/testing/host.d.ts.map +1 -1
- package/dist/testing/host.js +82 -23
- package/dist/testing/host.types.test.d.ts +2 -0
- package/dist/testing/host.types.test.d.ts.map +1 -0
- package/dist/testing/host.types.test.js +81 -0
- package/dist/testing/hydrateTestApp.d.ts +17 -0
- package/dist/testing/hydrateTestApp.d.ts.map +1 -1
- package/dist/testing/hydrateTestApp.js +27 -6
- package/dist/testing/index.d.ts +5 -3
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -1
- package/dist/testing/pipeline/createTestPacketApp.d.ts +30 -0
- package/dist/testing/pipeline/createTestPacketApp.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPacketApp.js +45 -0
- package/dist/testing/pipeline/createTestPacketApp.types.test.d.ts +3 -0
- package/dist/testing/pipeline/createTestPacketApp.types.test.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPacketApp.types.test.js +101 -0
- package/dist/testing/pipeline/createTestPipelineApp.d.ts +70 -0
- package/dist/testing/pipeline/createTestPipelineApp.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPipelineApp.js +90 -0
- package/dist/testing/pipeline/createTestPipelineApp.types.test.d.ts +6 -0
- package/dist/testing/pipeline/createTestPipelineApp.types.test.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPipelineApp.types.test.js +146 -0
- package/dist/testing/pipeline/hostPipeline.d.ts +25 -0
- package/dist/testing/pipeline/hostPipeline.d.ts.map +1 -0
- package/dist/testing/pipeline/hostPipeline.js +18 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.d.ts +30 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.d.ts.map +1 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.js +193 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.d.ts +2 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.d.ts.map +1 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.js +27 -0
- package/dist/testing/pipeline/index.d.ts +5 -0
- package/dist/testing/pipeline/index.d.ts.map +1 -0
- package/dist/testing/pipeline/index.js +4 -0
- package/dist/testing/pipeline/pipelineTestApp.d.ts +34 -0
- package/dist/testing/pipeline/pipelineTestApp.d.ts.map +1 -0
- package/dist/testing/pipeline/pipelineTestApp.js +100 -0
- package/dist/testing/pipeline/testPipelineRoute.d.ts +2 -0
- package/dist/testing/pipeline/testPipelineRoute.d.ts.map +1 -0
- package/dist/testing/pipeline/testPipelineRoute.js +1 -0
- package/dist/testing/resolveContent.d.ts +18 -0
- package/dist/testing/resolveContent.d.ts.map +1 -0
- package/dist/testing/resolveContent.js +73 -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 +23 -19
- 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/css-select.js +3383 -0
- package/vendor/dotenv.js +2 -2
- package/vendor/express.js +61 -10
- package/vendor/manifest.json +4 -3
- 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/MatchedRouteInfo.js → routing/RoutePaths.js} +0 -0
package/dist/build/bundle.js
CHANGED
|
@@ -5,6 +5,7 @@ import { findProjectDir } from '../findProjectDir.js';
|
|
|
5
5
|
import { prodBuildFolder, bundleFolder, frameworkDistFolder, clientFolder } from '../settings.js';
|
|
6
6
|
import { cliLog, cliOut } from '../cliOutput.js';
|
|
7
7
|
import { TungstenError } from '../TungstenError.js';
|
|
8
|
+
import { JSONstringify } from '../json.js';
|
|
8
9
|
// rollup's cli entry from tungsten's own dependency, rather than whatever `npx rollup` would find
|
|
9
10
|
const rollupBin = createRequire(import.meta.url).resolve('rollup/dist/bin/rollup');
|
|
10
11
|
const quoteArg = arg => arg.includes(' ') ? `"${arg}"` : arg;
|
|
@@ -18,7 +19,7 @@ export function bundle(projectDir, quiet = false, targets) {
|
|
|
18
19
|
const args = [rollupBin, '--input', entryFile, '--file', outFile, '--config', configFile, '--inlineDynamicImports', '--format', 'iife'];
|
|
19
20
|
// the rollup config reads this back; a browserslist query can hold commas, which rollup's own
|
|
20
21
|
// --environment flag would split on
|
|
21
|
-
const targetsJson = targets === undefined ? undefined :
|
|
22
|
+
const targetsJson = targets === undefined ? undefined : JSONstringify(targets);
|
|
22
23
|
const env = targetsJson === undefined ? process.env : {
|
|
23
24
|
...process.env,
|
|
24
25
|
TUNGSTEN_TARGETS: targetsJson
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleBabelOptions.d.ts","sourceRoot":"","sources":["../../src/build/bundleBabelOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"bundleBabelOptions.d.ts","sourceRoot":"","sources":["../../src/build/bundleBabelOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAgB7C,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,MAAM,GAAG,MAAM,EAA0B;;;EAMpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientRoutesFile.d.ts","sourceRoot":"","sources":["../../src/build/clientRoutesFile.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,UAUzF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// the generated client/routes.js. Importing the app's routes module is what runs its
|
|
2
|
+
// registerRouting() call, so the registry is filled before this module's body reads it
|
|
3
|
+
export function clientRoutesFile(routesModulePath, routeExport) {
|
|
4
|
+
const lines = [`import { registeredRouting } from 'tungsten'`];
|
|
5
|
+
if (routeExport === undefined) {
|
|
6
|
+
lines.push(`import '${routesModulePath}'`);
|
|
7
|
+
lines.push(`export const routes = registeredRouting.value`);
|
|
8
|
+
} else {
|
|
9
|
+
lines.push(`import * as routesModule from '${routesModulePath}'`);
|
|
10
|
+
lines.push(`export const routes = registeredRouting.value ?? routesModule.${routeExport}`);
|
|
11
|
+
}
|
|
12
|
+
return lines.join('\n') + '\n';
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAK/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAK/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AA6BtC,KAAK,uBAAuB,GAAG;IAC3B,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;IAClC,WAAW,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAA;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,cAAc,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAA;IAE3F,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAuBD,wBAAsB,iBAAiB,CACnC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EACtD,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EACrE,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,UAAO,EAC1E,OAAO,GAAE,wBAA6B,GACvC,OAAO,CAAC,uBAAuB,CAAC,CA+gBlC"}
|
|
@@ -18,6 +18,7 @@ import { tallyBabel } from './tallyBabel.js';
|
|
|
18
18
|
import { TungstenError } from '../TungstenError.js';
|
|
19
19
|
import { getFrameworkDir } from '../getFrameworkDir.js';
|
|
20
20
|
import { PromiseSettledResultIsPromiseRejectedResult } from './PromiseSettledResultIsPromiseRejectedResult.js';
|
|
21
|
+
import { JSONstringify } from '../json.js';
|
|
21
22
|
// The graph writeDependencyGraph() left behind on the previous run, naming a compiled copy of every
|
|
22
23
|
// package file in the packages cache. Missing or unreadable just means everything is compiled from
|
|
23
24
|
// source, which is what happened on every run before this was read back.
|
|
@@ -26,7 +27,7 @@ import { PromiseSettledResultIsPromiseRejectedResult } from './PromiseSettledRes
|
|
|
26
27
|
async function loadDependencyGraph(location) {
|
|
27
28
|
if (!fs.existsSync(location)) return {};
|
|
28
29
|
try {
|
|
29
|
-
const graphModule = await import(pathToFileURL(location).href);
|
|
30
|
+
const graphModule = await import(pathToFileURL(location).href); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- written by writeDependencyGraph()
|
|
30
31
|
if (graphModule.version !== frameworkVersion) return {};
|
|
31
32
|
return graphModule.graph ?? {};
|
|
32
33
|
} catch (error) {
|
|
@@ -153,7 +154,7 @@ export async function compileJavascript(projectDir, appConfig, codeLocation, sou
|
|
|
153
154
|
throw new TungstenError(`Err: code from babel transform on file ${file} was null or undefined: ${typeof code}`);
|
|
154
155
|
}
|
|
155
156
|
// attached here, not by babel's 'inline', so the export-wipe guard below sees bare code
|
|
156
|
-
const output = map === null || map === undefined ? code : `${code}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${Buffer.from(
|
|
157
|
+
const output = map === null || map === undefined ? code : `${code}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${Buffer.from(JSONstringify(map)).toString('base64')}\n`;
|
|
157
158
|
// tsc's incremental watch can, for one transient pass right after a save, emit
|
|
158
159
|
// `export {};` for a file that previously had real exports - its own convention
|
|
159
160
|
// for "this module has nothing to export", produced here as a self-correcting
|
|
@@ -310,7 +311,7 @@ export async function compileJavascript(projectDir, appConfig, codeLocation, sou
|
|
|
310
311
|
//console.log('ignored', ignored)
|
|
311
312
|
//cliWarn(watchGlob)
|
|
312
313
|
//cliWarn('IGNORE')
|
|
313
|
-
//cliWarn(
|
|
314
|
+
//cliWarn(JSONstringify(ignored))
|
|
314
315
|
/// need to do an initial build before watching
|
|
315
316
|
// not sure what glob matcher chokidar uses
|
|
316
317
|
// phases record into the profiler module's shared timeline, so this instance need not be the
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import chokidar from 'chokidar';
|
|
1
2
|
import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
|
|
2
|
-
export declare function compileStyles(projectDir: string, config: FrameworkConfigComplete, styleImportBase: string, buildLocation: string, watch?: boolean, onChange?: () => void, quiet?: boolean): Promise<
|
|
3
|
+
export declare function compileStyles(projectDir: string, config: FrameworkConfigComplete, styleImportBase: string, buildLocation: string, watch?: boolean, onChange?: () => void, quiet?: boolean): Promise<chokidar.FSWatcher | null>;
|
|
3
4
|
//# sourceMappingURL=compileStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileStyles.d.ts","sourceRoot":"","sources":["../../src/build/compileStyles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compileStyles.d.ts","sourceRoot":"","sources":["../../src/build/compileStyles.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAM/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AA2KpE,wBAAsB,aAAa,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,EACZ,QAAQ,CAAC,EAAE,MAAM,IAAI,EACrB,KAAK,UAAQ,sCA2GhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chokidar from 'chokidar';
|
|
2
|
-
import { join, dirname
|
|
3
|
-
import { pathToFileURL } from 'url';
|
|
4
|
-
import { promises as fsPromises
|
|
2
|
+
import { join, dirname } from 'path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
4
|
+
import { promises as fsPromises } from 'fs';
|
|
5
5
|
import * as sass from 'sass';
|
|
6
6
|
import slash from '../slash.js';
|
|
7
7
|
import { glob } from '../glob.js';
|
|
@@ -18,80 +18,43 @@ function arrayToObjectTrue(array) {
|
|
|
18
18
|
return obj;
|
|
19
19
|
}, {});
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
// dependencies are what sass actually loaded, transitively, as for component styles
|
|
22
|
+
function sxssToCss(data, file, importBase, syntax) {
|
|
23
|
+
const resolveImport = syntax === 'indented' ? resolveSassImport : resolveScssImport;
|
|
24
|
+
const toDependencies = urls => urls.map(url => slash(fileURLToPath(url))).filter(dependency => dependency !== file);
|
|
22
25
|
try {
|
|
23
|
-
|
|
24
|
-
syntax
|
|
26
|
+
const result = sass.compileString(data, {
|
|
27
|
+
syntax,
|
|
25
28
|
url: pathToFileURL(file),
|
|
26
29
|
importers: [{
|
|
27
|
-
findFileUrl: url => pathToFileURL(
|
|
30
|
+
findFileUrl: url => pathToFileURL(resolveImport(url, file, importBase))
|
|
28
31
|
}]
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
// throw not return because this is unexpected
|
|
35
|
-
const ex = new Error(`Error returned from sass compilation was not an instance of Error.` + ` Type: ${typeof error}, value: ${String(error)}`);
|
|
36
|
-
ex.cause = error;
|
|
37
|
-
throw ex;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function scssToCss(data, file, importBase) {
|
|
42
|
-
try {
|
|
43
|
-
return sass.compileString(data, {
|
|
44
|
-
syntax: 'scss',
|
|
45
|
-
url: pathToFileURL(file),
|
|
46
|
-
importers: [{
|
|
47
|
-
findFileUrl: url => pathToFileURL(resolveScssImport(url, file, importBase))
|
|
48
|
-
}]
|
|
49
|
-
}).css;
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
css: result.css,
|
|
35
|
+
dependencies: toDependencies(result.loadedUrls)
|
|
36
|
+
};
|
|
50
37
|
} catch (error) {
|
|
51
|
-
if (error instanceof
|
|
52
|
-
|
|
38
|
+
if (error instanceof sass.Exception) {
|
|
39
|
+
// a failed compile has no loadedUrls; the failing file is the one to watch for a fix
|
|
40
|
+
const url = error.span.url;
|
|
41
|
+
return {
|
|
42
|
+
error,
|
|
43
|
+
dependencies: url?.protocol === 'file:' ? toDependencies([url]) : []
|
|
44
|
+
};
|
|
45
|
+
} else if (error instanceof Error) {
|
|
46
|
+
return {
|
|
47
|
+
error,
|
|
48
|
+
dependencies: []
|
|
49
|
+
};
|
|
53
50
|
} else {
|
|
54
51
|
// throw not return because this is unexpected
|
|
55
|
-
const ex = new Error(`Error returned from
|
|
52
|
+
const ex = new Error(`Error returned from ${syntax} compilation was not an instance of Error.` + ` Type: ${typeof error}, value: ${String(error)}`);
|
|
56
53
|
ex.cause = error;
|
|
57
54
|
throw ex;
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
|
-
function findSxssDependencies(data, file, regex, extension) {
|
|
62
|
-
// matchAll seems to return an iterator or something
|
|
63
|
-
// [...xxx] converts it to a plain array
|
|
64
|
-
let results = [...data.matchAll(regex)]
|
|
65
|
-
// the matches group is on position 1, so we map to get just the match group
|
|
66
|
-
.map(x => x[1]); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
67
|
-
if (extension === '.sass') {
|
|
68
|
-
results = results.map(dep => {
|
|
69
|
-
if ((dep.startsWith(`'`) || dep.startsWith(`"`)) && dep.endsWith(dep[0])) {
|
|
70
|
-
return dep.slice(1, -1);
|
|
71
|
-
} else {
|
|
72
|
-
return dep;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
results = results.map(x => x.slice(-5) === extension ? x : x + extension);
|
|
77
|
-
const dir = dirname(file);
|
|
78
|
-
//results = results.map( dep => resolve(dep, { paths: resolvePaths }) )
|
|
79
|
-
results = results.map(dep => {
|
|
80
|
-
//console.log('resolve', join(dir, dep))
|
|
81
|
-
return slash(resolve(join(dir, dep)));
|
|
82
|
-
});
|
|
83
|
-
return results;
|
|
84
|
-
}
|
|
85
|
-
function findSassDependencies(data, file) {
|
|
86
|
-
const regex = /@import\s+([^\n\r]+)/g;
|
|
87
|
-
const extension = '.sass';
|
|
88
|
-
return findSxssDependencies(data, file, regex, extension);
|
|
89
|
-
}
|
|
90
|
-
function findScssDependencies(data, file) {
|
|
91
|
-
const regex = /@import\s+['"]([^'"\s]+)['"]\s*;/g;
|
|
92
|
-
const extension = '.scss';
|
|
93
|
-
return findSxssDependencies(data, file, regex, extension);
|
|
94
|
-
}
|
|
95
58
|
function fileName(p) {
|
|
96
59
|
return p.substring(p.lastIndexOf('/') + 1);
|
|
97
60
|
}
|
|
@@ -115,13 +78,6 @@ function getDependers(dependersChart, file, originalFile) {
|
|
|
115
78
|
debug('-');
|
|
116
79
|
return result;
|
|
117
80
|
}
|
|
118
|
-
function bumpDependers(dependersChart, file) {
|
|
119
|
-
const dependers = getDependers(dependersChart, file, file);
|
|
120
|
-
const time = new Date();
|
|
121
|
-
for (const depender in dependers) {
|
|
122
|
-
utimesSync(depender, time, time);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
81
|
async function processAndCopyFile(sourceLocation, targetLocation, filePathFull, styleImportBase, cssFiles, cssDependencies, cssDependers) {
|
|
126
82
|
const relFile = filePathFull.slice(sourceLocation.length + 1);
|
|
127
83
|
const targetRelFile = relFile.slice(0, relFile.lastIndexOf('.')) + '.css';
|
|
@@ -142,11 +98,13 @@ async function processAndCopyFile(sourceLocation, targetLocation, filePathFull,
|
|
|
142
98
|
if (relFile.endsWith('.scss') || relFile.endsWith('.sass')) {
|
|
143
99
|
// get the sxss file content
|
|
144
100
|
const content = await fsPromises.readFile(filePathFull, 'utf8');
|
|
101
|
+
// compile the sxss
|
|
102
|
+
const result = sxssToCss(content, filePathFull, styleImportBase, relFile.endsWith('.scss') ? 'scss' : 'indented');
|
|
145
103
|
// save the dependencies that existed in last compile, if present
|
|
146
104
|
const oldDependencies = filePathFull in cssDependencies ? cssDependencies[filePathFull] : null;
|
|
147
105
|
const expiredDepencies = oldDependencies;
|
|
148
|
-
//
|
|
149
|
-
const dependencies =
|
|
106
|
+
// a failed compile keeps the last good dependencies, so fixing any of them recompiles this
|
|
107
|
+
const dependencies = 'error' in result ? [...new Set([...Object.keys(oldDependencies ?? {}), ...result.dependencies])] : result.dependencies;
|
|
150
108
|
// save the dependencies of this file in { [key: string]: true } format
|
|
151
109
|
cssDependencies[filePathFull] = arrayToObjectTrue(dependencies);
|
|
152
110
|
// should we check for dep loop here?
|
|
@@ -168,19 +126,13 @@ async function processAndCopyFile(sourceLocation, targetLocation, filePathFull,
|
|
|
168
126
|
delete cssDependers[exDep][filePathFull];
|
|
169
127
|
}
|
|
170
128
|
debug('cssDependers', cssDependers);
|
|
171
|
-
bumpDependers(cssDependers, filePathFull);
|
|
172
|
-
//console.log('cssDependencies', cssDependencies)
|
|
173
|
-
//console.log('cssdependers', cssdependers)
|
|
174
|
-
// compile the sxss
|
|
175
|
-
const cssOrError = relFile.endsWith('.scss') ? scssToCss(content, filePathFull, styleImportBase) : sassToCss(content, filePathFull, styleImportBase);
|
|
176
129
|
// write to the build folder
|
|
177
|
-
if (
|
|
178
|
-
await fsPromises.writeFile(target,
|
|
130
|
+
if ('css' in result) {
|
|
131
|
+
await fsPromises.writeFile(target, result.css);
|
|
179
132
|
debug('wrote sxss file', filePathFull, target);
|
|
180
|
-
//bumpdependers()
|
|
181
133
|
} else {
|
|
182
134
|
await fsPromises.writeFile(target, '');
|
|
183
|
-
cliError(`Error compiling stylesheet ${filePathFull}: ${String(
|
|
135
|
+
cliError(`Error compiling stylesheet ${filePathFull}: ${String(result.error)}`);
|
|
184
136
|
}
|
|
185
137
|
} else {
|
|
186
138
|
// write to the build folder
|
|
@@ -243,6 +195,9 @@ export async function compileStyles(projectDir, config, styleImportBase, buildLo
|
|
|
243
195
|
}
|
|
244
196
|
if (event === 'change') {
|
|
245
197
|
await processAndCopyFile(sourceLocation, staticLocation, filename, styleImportBase, cssFiles, cssDependencies, cssdependers);
|
|
198
|
+
for (const depender in getDependers(cssdependers, filename, filename)) {
|
|
199
|
+
await processAndCopyFile(sourceLocation, staticLocation, depender, styleImportBase, cssFiles, cssDependencies, cssdependers);
|
|
200
|
+
}
|
|
246
201
|
onChange?.();
|
|
247
202
|
}
|
|
248
203
|
// delete
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileUserApp.d.ts","sourceRoot":"","sources":["../../src/build/compileUserApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"compileUserApp.d.ts","sourceRoot":"","sources":["../../src/build/compileUserApp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAYtC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAM1E,wBAAsB,cAAc,CAChC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,EAClE,QAAQ,GAAE,YAAwC,EAClD,KAAK,UAAQ,EAAE,KAAK,UAAQ,EAAE,KAAK,UAAQ,GAC5C,OAAO,CAAC,eAAe,CAAC,CAkF1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentStylesCache.d.ts","sourceRoot":"","sources":["../../src/build/componentStylesCache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentStylesCache.d.ts","sourceRoot":"","sources":["../../src/build/componentStylesCache.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IAEX,YAAY,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAoBD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,UAAQ;uBAKzD,MAAM,YAAY,MAAM,aAAa,MAAM,GAAG,cAAc,GAAG,SAAS;sBAezE,MAAM,YAAY,MAAM,aAAa,MAAM,YAAY,cAAc;EAY9F;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
@@ -2,6 +2,7 @@ import { createHash } from 'crypto';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { frameworkVersion } from './frameworkDestLocation.js';
|
|
5
|
+
import { JSONstringify } from '../json.js';
|
|
5
6
|
const sha1 = data => createHash('sha1').update(data).digest('hex');
|
|
6
7
|
const blockHash = (language, rawStyles) => sha1(`${language}\0${rawStyles}`);
|
|
7
8
|
const fileHash = file => {
|
|
@@ -20,7 +21,7 @@ export function makeComponentStylesCache(cacheDir, fresh = false) {
|
|
|
20
21
|
if (cacheDir === undefined || fresh) return undefined;
|
|
21
22
|
let record;
|
|
22
23
|
try {
|
|
23
|
-
record = JSON.parse(fs.readFileSync(recordFile(cacheDir, moduleName), 'utf8'));
|
|
24
|
+
record = JSON.parse(fs.readFileSync(recordFile(cacheDir, moduleName), 'utf8')); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- fields checked below
|
|
24
25
|
} catch {
|
|
25
26
|
return undefined;
|
|
26
27
|
}
|
|
@@ -48,7 +49,7 @@ export function makeComponentStylesCache(cacheDir, fresh = false) {
|
|
|
48
49
|
fs.mkdirSync(cacheDir, {
|
|
49
50
|
recursive: true
|
|
50
51
|
});
|
|
51
|
-
fs.writeFileSync(recordFile(cacheDir, moduleName),
|
|
52
|
+
fs.writeFileSync(recordFile(cacheDir, moduleName), JSONstringify(record));
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyAssets.d.ts","sourceRoot":"","sources":["../../src/build/copyAssets.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"copyAssets.d.ts","sourceRoot":"","sources":["../../src/build/copyAssets.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAoBpE,wBAAsB,UAAU,CAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,EACZ,KAAK,UAAQ,oBA2DhB"}
|
package/dist/build/copyAssets.js
CHANGED
|
@@ -4,6 +4,7 @@ import { promises as fsPromises } from 'fs';
|
|
|
4
4
|
import slash from '../slash.js';
|
|
5
5
|
import { glob } from '../glob.js';
|
|
6
6
|
import { cliOut } from '../cliOutput.js';
|
|
7
|
+
import { assetsFolder } from '../settings.js';
|
|
7
8
|
async function copyFile(assetsLocation, targetLocation, filePathFull, event) {
|
|
8
9
|
const relFile = filePathFull.slice(assetsLocation.length + 1);
|
|
9
10
|
const target = join(targetLocation, relFile);
|
|
@@ -18,7 +19,7 @@ export async function copyAssets(projectDir, config, buildLocation, watch = true
|
|
|
18
19
|
if (config.assetsDir !== undefined) {
|
|
19
20
|
if (!quiet) cliOut(`Copying assets`);
|
|
20
21
|
const assetsLocation = join(projectDir, config.assetsDir);
|
|
21
|
-
const targetLocation = join(buildLocation,
|
|
22
|
+
const targetLocation = join(buildLocation, assetsFolder);
|
|
22
23
|
//console.log('copy assets from', assetsLocation, 'to', targetLocation)
|
|
23
24
|
const watchGlob = assetsLocation + '/**/*';
|
|
24
25
|
//const ignoreGlob = buildLocation + '/**/*'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyPackageModulesToPackagesFolder.d.ts","sourceRoot":"","sources":["../../src/build/copyPackageModulesToPackagesFolder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copyPackageModulesToPackagesFolder.d.ts","sourceRoot":"","sources":["../../src/build/copyPackageModulesToPackagesFolder.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAc1C,wBAAsB,kCAAkC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,kBAkBrF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, promises as fsPromises } from 'fs';
|
|
2
2
|
import { dirname, join } from 'path';
|
|
3
3
|
import { transformSync as babelTransformSync } from '@babel/core';
|
|
4
|
-
import { cliWarn } from '
|
|
4
|
+
import { cliWarn } from '../cliOutput.js';
|
|
5
5
|
import { findProjectDir } from '../findProjectDir.js';
|
|
6
6
|
import { devBuildOuterFolder, prodBuildFolder, packagesFolder } from '../settings.js';
|
|
7
7
|
import { MakeBabelTransformDependencyImports } from '../babelPlugins/BabelTransformDependencyImportsOld.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyPublicFiles.d.ts","sourceRoot":"","sources":["../../src/build/copyPublicFiles.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"copyPublicFiles.d.ts","sourceRoot":"","sources":["../../src/build/copyPublicFiles.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAqBpE,wBAAsB,eAAe,CACjC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,MAAM,EACrB,KAAK,UAAO,EACZ,KAAK,UAAQ,oBA4DhB"}
|
|
@@ -4,6 +4,7 @@ import { promises as fsPromises } from 'fs';
|
|
|
4
4
|
import slash from '../slash.js';
|
|
5
5
|
import { glob } from '../glob.js';
|
|
6
6
|
import { cliOut } from '../cliOutput.js';
|
|
7
|
+
import { publicFolder } from '../settings.js';
|
|
7
8
|
async function copyFile(assetsLocation, targetLocation, filePathFull, event) {
|
|
8
9
|
const relFile = filePathFull.slice(assetsLocation.length + 1);
|
|
9
10
|
const target = join(targetLocation, relFile);
|
|
@@ -19,7 +20,7 @@ export async function copyPublicFiles(projectDir, config, buildLocation, watch =
|
|
|
19
20
|
if (!quiet) cliOut(`Copying public files`);
|
|
20
21
|
const publicLocation = config.publicDir !== undefined ? join(projectDir, config.publicDir) : join(projectDir, 'public');
|
|
21
22
|
//const targetLocation = buildLocation // to segregate or not to segregate?
|
|
22
|
-
const targetLocation = join(buildLocation,
|
|
23
|
+
const targetLocation = join(buildLocation, publicFolder);
|
|
23
24
|
//console.log('copy assets from', publicLocation, 'to', targetLocation)
|
|
24
25
|
const watchGlob = publicLocation + '/**/*';
|
|
25
26
|
//const ignoreGlob = buildLocation + '/**/*'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createClientFiles.d.ts","sourceRoot":"","sources":["../../src/build/createClientFiles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"createClientFiles.d.ts","sourceRoot":"","sources":["../../src/build/createClientFiles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAWpE,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,uBAAuB,EAC/B,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,MAAM,iBA6EzB"}
|
|
@@ -3,14 +3,17 @@ import { join } from 'path';
|
|
|
3
3
|
import { buildCodeSubPath, devBuildOuterFolder, prodBuildFolder, clientFolder, frameworkDistFolder, frameworkClientFolder } from '../settings.js';
|
|
4
4
|
import { fixExtension } from '../fixExtension.js';
|
|
5
5
|
import { findProjectDir } from '../findProjectDir.js';
|
|
6
|
+
import { routesLocationParts } from '../routesLocationParts.js';
|
|
7
|
+
import { clientRoutesFile } from './clientRoutesFile.js';
|
|
6
8
|
export async function createClientFiles(config, mode, buildLocation) {
|
|
7
9
|
//console.log('creating entry file')
|
|
8
10
|
const specificBuildFolder = buildLocation ?? join(process.cwd(), mode === 'dev' ? devBuildOuterFolder : prodBuildFolder);
|
|
9
11
|
const codeSubPath = `${buildCodeSubPath}/`;
|
|
10
12
|
const frameworkDir = findProjectDir(import.meta.url);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
const {
|
|
14
|
+
routesFile: routeFilePath,
|
|
15
|
+
routeExport: routesExportName
|
|
16
|
+
} = routesLocationParts(config.routesLocation);
|
|
14
17
|
// ensure the folder exists -- must complete before anything below writes into it,
|
|
15
18
|
// so it can't just be another entry in the promises array (they all start eagerly)
|
|
16
19
|
await fsPromises.mkdir(join(specificBuildFolder, `${clientFolder}`), {
|
|
@@ -21,8 +24,9 @@ export async function createClientFiles(config, mode, buildLocation) {
|
|
|
21
24
|
const promises = [...frameworkClientFiles.map(file => fsPromises.copyFile(join(frameworkDir, frameworkDistFolder, frameworkClientFolder, file),
|
|
22
25
|
// from
|
|
23
26
|
join(specificBuildFolder, clientFolder, file))),
|
|
24
|
-
// app routes stuff
|
|
25
|
-
|
|
27
|
+
// app routes stuff. Imports the module either way - that is what runs registerRouting(),
|
|
28
|
+
// which takes priority over the named export when both are present
|
|
29
|
+
fsPromises.writeFile(join(specificBuildFolder, clientFolder, 'routes.js'), clientRoutesFile(`../${codeSubPath}${fixExtension(routeFilePath)}`, routesExportName))];
|
|
26
30
|
const clientRootComponentFileLocation = join(specificBuildFolder, clientFolder, 'RootComponent.js');
|
|
27
31
|
if (config.useRootComponent) {
|
|
28
32
|
const rootComponentRelFilePath = config.rootComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Mode } from '../Mode.js';
|
|
2
2
|
import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
|
|
3
|
-
export declare function createInstanceConfigFile(config: FrameworkConfigComplete, mode: Mode, buildLocation?: string): Promise<void>;
|
|
3
|
+
export declare function createInstanceConfigFile(config: FrameworkConfigComplete, mode: Mode, buildLocation?: string, fileVersions?: Record<string, string>): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=createInstanceConfigFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createInstanceConfigFile.d.ts","sourceRoot":"","sources":["../../src/build/createInstanceConfigFile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"createInstanceConfigFile.d.ts","sourceRoot":"","sources":["../../src/build/createInstanceConfigFile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAMpE,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,uBAAuB,EAC/B,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,MAAM,EACtB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iBAqCxC"}
|
|
@@ -2,7 +2,8 @@ import { promises as fsPromises } from 'fs';
|
|
|
2
2
|
import { join, dirname } from 'path';
|
|
3
3
|
import { devBuildOuterFolder, prodBuildFolder } from '../settings.js';
|
|
4
4
|
import { TungstenError } from '../TungstenError.js';
|
|
5
|
-
|
|
5
|
+
import { JSONstringify } from '../json.js';
|
|
6
|
+
export async function createInstanceConfigFile(config, mode, buildLocation, fileVersions) {
|
|
6
7
|
//console.log('creating app config')
|
|
7
8
|
const specificBuildFolder = buildLocation ?? join(process.cwd(), mode === 'dev' ? devBuildOuterFolder : prodBuildFolder);
|
|
8
9
|
const appConfigLocation = join(specificBuildFolder, '.tungsten.config.js');
|
|
@@ -20,8 +21,13 @@ export async function createInstanceConfigFile(config, mode, buildLocation) {
|
|
|
20
21
|
});
|
|
21
22
|
await fsPromises.writeFile(appConfigLocation,
|
|
22
23
|
// to
|
|
23
|
-
`export default { prod: ${(mode === 'prod').toString()}, useRootComponent: ${config.useRootComponent.toString()}, siteBasePath: "${siteBasePath}", clientSideNav: ${config.clientSideNav.toString()}, staticSite: ${config.staticSite.toString()}, csr: ${config.csr.toString()}
|
|
24
|
-
|
|
24
|
+
`export default { prod: ${(mode === 'prod').toString()}, useRootComponent: ${config.useRootComponent.toString()}, siteBasePath: "${siteBasePath}", clientSideNav: ${config.clientSideNav.toString()}, staticSite: ${config.staticSite.toString()}, csr: ${config.csr.toString()}` // eslint-disable-line @stylistic/max-len
|
|
25
|
+
// client.ts hydrates by it
|
|
26
|
+
+ (config.registration === 'pipeline' ? ', registration: "pipeline"' : '') + (config.serverSideRouting === false ? ', serverSideRouting: false' : '') + ' };\n'
|
|
27
|
+
// not config: the instance holds it. Always exported, as client.ts imports it by name
|
|
28
|
+
+ `export const fileVersions = ${JSONstringify(fileVersions) ?? 'undefined'};\n`
|
|
29
|
+
// a constant rollup folds, so the prod bundle holds one of client.ts's hydrate paths
|
|
30
|
+
+ `export const pipelineRegistration = ${String(config.registration === 'pipeline')};\n`);
|
|
25
31
|
} catch (e) {
|
|
26
32
|
throw new TungstenError(`createAppConfig() Error: error creating app config file`);
|
|
27
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameworkDestLocation.d.ts","sourceRoot":"","sources":["../../src/build/frameworkDestLocation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"frameworkDestLocation.d.ts","sourceRoot":"","sources":["../../src/build/frameworkDestLocation.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB,EAAE,MAA4B,CAAA;AAG3D,eAAO,MAAM,qBAAqB,QACwE,CAAA"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
2
3
|
import { TungstenError } from '../TungstenError.js';
|
|
3
4
|
import { getFrameworkDir } from '../getFrameworkDir.js';
|
|
4
5
|
import { frameworkDistFolder, packagesFolder } from '../settings.js';
|
|
5
6
|
import { makePackageIdentifier } from './packageIdentifier.js';
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
throw new TungstenError(`getSxyClientPackageAliases() error: framework package.json not found`);
|
|
10
|
-
}
|
|
7
|
+
const packageJson = JSON.parse(
|
|
8
|
+
// eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
9
|
+
readFileSync(join(getFrameworkDir(), 'package.json'), 'utf8'));
|
|
11
10
|
if (packageJson.version === undefined) {
|
|
12
11
|
throw new TungstenError(`frameworkDestLocation error: framework package.json has no version`);
|
|
13
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frameworkStylesheets.d.ts","sourceRoot":"","sources":["../../src/build/frameworkStylesheets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"frameworkStylesheets.d.ts","sourceRoot":"","sources":["../../src/build/frameworkStylesheets.ts"],"names":[],"mappings":"AAsBA,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAE/E;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAGD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI1E;AAID,wBAAsB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAqB1F"}
|
|
@@ -8,7 +8,7 @@ import { frameworkCssFile, frameworkCssFolder, frameworkDistFolder } from '../se
|
|
|
8
8
|
// and the writer can otherwise end up with separate module instances.
|
|
9
9
|
const $collected = Symbol.for('tungsten.frameworkStylesheets');
|
|
10
10
|
function getCollected() {
|
|
11
|
-
const existing = Reflect.get(globalThis, $collected);
|
|
11
|
+
const existing = Reflect.get(globalThis, $collected); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- only set below
|
|
12
12
|
if (existing instanceof Map) return existing;
|
|
13
13
|
const created = new Map();
|
|
14
14
|
Reflect.set(globalThis, $collected, created);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeBabelRawConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelRawConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"makeBabelRawConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelRawConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAYnD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,gBAAgB,CAKxE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TransformOptions } from '@babel/core';
|
|
2
2
|
import type { ImportAliases } from './ImportAliases.js';
|
|
3
|
-
import { type DependencyGraph } from '../babelPlugins/BabelTransformPackageImports.js';
|
|
4
|
-
export declare function makeBabelUserDevConfig(projectDir: string, absCodeDir: string, absSourceDir: string, typescript: boolean, absStyleImportBase: string, buildLocation: string, buildCodeLocation: string, packagesCacheLocation: string, stylesCacheLocation: string | undefined, fresh: boolean, skipPackageCompilationFiles: ReadonlySet<string>, oldDependencyGraph: DependencyGraph, dependencyGraph: DependencyGraph, importAliases: ImportAliases, promises: Promise<
|
|
3
|
+
import { type DependencyGraph, type PackageInfo } from '../babelPlugins/BabelTransformPackageImports.js';
|
|
4
|
+
export declare function makeBabelUserDevConfig(projectDir: string, absCodeDir: string, absSourceDir: string, typescript: boolean, absStyleImportBase: string, buildLocation: string, buildCodeLocation: string, packagesCacheLocation: string, stylesCacheLocation: string | undefined, fresh: boolean, skipPackageCompilationFiles: ReadonlySet<string>, oldDependencyGraph: DependencyGraph, dependencyGraph: DependencyGraph, importAliases: ImportAliases, promises: Promise<PackageInfo | undefined>[], watchStyles?: boolean, hmr?: boolean, packages?: boolean): TransformOptions;
|
|
5
5
|
//# sourceMappingURL=makeBabelUserDevConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeBabelUserDevConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserDevConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAInD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,
|
|
1
|
+
{"version":3,"file":"makeBabelUserDevConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserDevConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAInD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EACH,KAAK,eAAe,EAAE,KAAK,WAAW,EAEzC,MAAM,iDAAiD,CAAA;AAQxD,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,EACnB,kBAAkB,EAAE,MAAM,EAC1B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,qBAAqB,EAAE,MAAM,EAC7B,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,KAAK,EAAE,OAAO,EACd,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAAC,EAChD,kBAAkB,EAAE,eAAe,EACnC,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,EAAE,EAC5C,WAAW,UAAO,EAClB,GAAG,UAAQ,EACX,QAAQ,UAAO,GAChB,gBAAgB,CAiDlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeBabelUserProdConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserProdConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"makeBabelUserProdConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserProdConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAcnD,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,EACnB,kBAAkB,EAAE,MAAM,EAC1B,WAAW,UAAO,GACnB,gBAAgB,CAyBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.user.prod.config.d.ts","sourceRoot":"","sources":["../../src/build/rollup.user.prod.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rollup.user.prod.config.d.ts","sourceRoot":"","sources":["../../src/build/rollup.user.prod.config.ts"],"names":[],"mappings":"AAgBA,KAAK,YAAY,GAAG;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAA;AAmBD,QAAA,MAAM,YAAY,EAAE,YAoBnB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -6,6 +6,8 @@ import terser from '@rollup/plugin-terser';
|
|
|
6
6
|
import jsonModule from '@rollup/plugin-json';
|
|
7
7
|
import { bundleBabelOptions } from './bundleBabelOptions.js';
|
|
8
8
|
import { rollupExtractComponentStylesheets } from './rollupExtractComponentStylesheets.js';
|
|
9
|
+
import { rollupProdConstants } from './rollupProdConstants.js';
|
|
10
|
+
import { JSONstringify } from '../json.js';
|
|
9
11
|
const json = typeof jsonModule === 'function' ? jsonModule : jsonModule.default;
|
|
10
12
|
function replaceProductionNodeEnv() {
|
|
11
13
|
return {
|
|
@@ -13,7 +15,7 @@ function replaceProductionNodeEnv() {
|
|
|
13
15
|
transform(code) {
|
|
14
16
|
if (!code.includes('process.env.NODE_ENV')) return null;
|
|
15
17
|
return {
|
|
16
|
-
code: code.replaceAll('process.env.NODE_ENV',
|
|
18
|
+
code: code.replaceAll('process.env.NODE_ENV', JSONstringify('production')),
|
|
17
19
|
map: null
|
|
18
20
|
};
|
|
19
21
|
}
|
|
@@ -21,11 +23,11 @@ function replaceProductionNodeEnv() {
|
|
|
21
23
|
}
|
|
22
24
|
// the app config's `targets`, handed over by bundle.ts; unset means the framework default
|
|
23
25
|
const targetsEnv = process.env.TUNGSTEN_TARGETS;
|
|
24
|
-
const targets = targetsEnv === undefined ? undefined : JSON.parse(targetsEnv);
|
|
26
|
+
const targets = targetsEnv === undefined ? undefined : JSON.parse(targetsEnv); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- written by bundle.ts
|
|
25
27
|
const rollupConfig = {
|
|
26
28
|
plugins: [json(), nodeResolve(), commonjs(),
|
|
27
29
|
// must be before babel
|
|
28
|
-
replaceProductionNodeEnv(),
|
|
30
|
+
replaceProductionNodeEnv(), rollupProdConstants(),
|
|
29
31
|
// before babel, so it sees component stylesheets as written
|
|
30
32
|
rollupExtractComponentStylesheets(),
|
|
31
33
|
// no node_modules exclude: the floor applies to the framework and packages in the bundle too
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollupProdConstants.d.ts","sourceRoot":"","sources":["../../src/build/rollupProdConstants.ts"],"names":[],"mappings":"AAmBA,wBAAgB,mBAAmB;;aAGlB,MAAM;EAItB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
// the framework's own environment flags, as a browser prod bundle knows them.
|
|
4
|
+
// isBrowser re-exports isClient
|
|
5
|
+
const distDir = fileURLToPath(new URL('../', import.meta.url));
|
|
6
|
+
const constants = new Map(Object.entries({
|
|
7
|
+
isDev: false,
|
|
8
|
+
isProd: true,
|
|
9
|
+
isClient: true,
|
|
10
|
+
isServer: false
|
|
11
|
+
}).map(([name, value]) => [join(distDir, `${name}.js`), `export const ${name} = ${String(value)}\n`]));
|
|
12
|
+
// the flags detect the environment at runtime, as the same modules run on the server and in tests;
|
|
13
|
+
// in the prod bundle they are constants, so rollup and terser drop the branches never taken
|
|
14
|
+
export function rollupProdConstants() {
|
|
15
|
+
return {
|
|
16
|
+
name: 'tungsten-prod-constants',
|
|
17
|
+
load(id) {
|
|
18
|
+
return constants.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|