tungsten 0.3.2 → 0.3.4
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 -0
- package/dist/Components.d.ts +6 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +103 -40
- package/dist/DomPointer.d.ts +11 -0
- package/dist/DomPointer.d.ts.map +1 -1
- package/dist/DomPointer.js +15 -0
- package/dist/DomRegion.d.ts +2 -0
- package/dist/DomRegion.d.ts.map +1 -1
- package/dist/DomRegion.js +23 -3
- package/dist/Framework.d.ts +2 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +94 -61
- package/dist/FrameworkConfig.d.ts +4 -0
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/Instance/Instance.d.ts +1 -1
- package/dist/Instance/Instance.d.ts.map +1 -1
- package/dist/Instance/Instance.js +18 -1
- package/dist/Instance/InstanceConfig.d.ts +1 -0
- package/dist/Instance/InstanceConfig.d.ts.map +1 -1
- package/dist/PopMessage.type.d.ts +6 -0
- package/dist/PopMessage.type.d.ts.map +1 -0
- package/dist/PopMessage.type.js +1 -0
- package/dist/Servers/DevServer.d.ts +2 -0
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +87 -11
- package/dist/Servers/MatchedRouteInfo.d.ts +1 -1
- package/dist/Servers/MatchedRouteInfo.d.ts.map +1 -1
- package/dist/Servers/ProdServer.d.ts +2 -1
- package/dist/Servers/ProdServer.d.ts.map +1 -1
- package/dist/Servers/ProdServer.js +92 -8
- package/dist/Servers/hono/DevServerHono.js +25 -29
- package/dist/Servers/hono/ProdServerHono.js +49 -142
- package/dist/Servers/hono/TungstenServerHono.d.ts +1 -1
- package/dist/Servers/hono/TungstenServerHono.d.ts.map +1 -1
- package/dist/Servers/hono/TungstenServerHono.js +12 -29
- package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
- package/dist/Servers/loadEnvsDev.js +16 -5
- package/dist/Servers/routing.d.ts.map +1 -1
- package/dist/Servers/routing.js +10 -6
- package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts +0 -3
- package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts.map +1 -1
- package/dist/Servers/tungstenCorePrivateEnvSchema.js +3 -3
- package/dist/Servers/tungstenCorePublicEnvSchema.d.ts +8 -0
- package/dist/Servers/tungstenCorePublicEnvSchema.d.ts.map +1 -0
- package/dist/Servers/tungstenCorePublicEnvSchema.js +14 -0
- package/dist/Store/InternalStoreSchema.d.ts +2 -0
- package/dist/Store/InternalStoreSchema.d.ts.map +1 -1
- package/dist/Store/InternalStoreSchema.js +1 -0
- package/dist/api/Request.d.ts +1 -1
- package/dist/api/Request.d.ts.map +1 -1
- package/dist/api/Response.d.ts +1 -1
- package/dist/api/Response.d.ts.map +1 -1
- package/dist/babelPlugins/BabelExtractComponentStylesheet.d.ts +13 -0
- package/dist/babelPlugins/BabelExtractComponentStylesheet.d.ts.map +1 -0
- package/dist/babelPlugins/BabelExtractComponentStylesheet.js +24 -0
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.js +21 -5
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts +1 -0
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +21 -9
- package/dist/babelPlugins/BabelTypes.d.ts +2 -2
- package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTypes.js +0 -1
- package/dist/bin/commands/build.d.ts.map +1 -1
- package/dist/bin/commands/build.js +12 -2
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +7 -2
- package/dist/bin/commands/dev.d.ts.map +1 -1
- package/dist/bin/commands/dev.js +15 -4
- package/dist/bin/commands/devmon.d.ts +2 -0
- package/dist/bin/commands/devmon.d.ts.map +1 -0
- package/dist/bin/commands/devmon.js +66 -0
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +6 -0
- package/dist/booleanAttributeValue.d.ts +21 -0
- package/dist/booleanAttributeValue.d.ts.map +1 -0
- package/dist/booleanAttributeValue.js +23 -0
- package/dist/build/CompilationInfo.d.ts +1 -0
- package/dist/build/CompilationInfo.d.ts.map +1 -1
- package/dist/build/combineComponentCss.d.ts +1 -1
- package/dist/build/combineComponentCss.d.ts.map +1 -1
- package/dist/build/combineComponentCss.js +3 -3
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +3 -3
- package/dist/build/compileUserApp.d.ts +2 -1
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/compileUserApp.js +18 -8
- package/dist/build/createInstanceConfigFile.js +1 -1
- package/dist/build/frameworkStylesheets.d.ts +5 -0
- package/dist/build/frameworkStylesheets.d.ts.map +1 -0
- package/dist/build/frameworkStylesheets.js +49 -0
- package/dist/build/getPackageDirForFile.d.ts +2 -0
- package/dist/build/getPackageDirForFile.d.ts.map +1 -0
- package/dist/build/getPackageDirForFile.js +11 -0
- package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
- package/dist/build/getSxyClientPackageAliases.js +3 -1
- package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +3 -2
- package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.js +4 -2
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +4 -1
- package/dist/build/rollupExtractComponentStylesheets.d.ts +12 -0
- package/dist/build/rollupExtractComponentStylesheets.d.ts.map +1 -0
- package/dist/build/rollupExtractComponentStylesheets.js +35 -0
- package/dist/compat/context.d.ts +1 -1
- package/dist/compat/context.d.ts.map +1 -1
- package/dist/compat/types.d.ts +1 -1
- package/dist/compat/types.d.ts.map +1 -1
- package/dist/componentCss/i/T-components-library-RichTextEditor-RichTextEditor.css +115 -0
- package/dist/componentCss/i/T-components-library-__StatefulMessage-StatefulMessage.css +25 -0
- package/dist/componentCss/tungsten.css +2 -0
- package/dist/componentProxyHandlers.d.ts +2 -1
- package/dist/componentProxyHandlers.d.ts.map +1 -1
- package/dist/componentProxyHandlers.js +45 -9
- package/dist/components/GoToComponent.d.ts +1 -1
- package/dist/components/GoToComponent.d.ts.map +1 -1
- package/dist/components/PopMessages.d.ts +12 -0
- package/dist/components/PopMessages.d.ts.map +1 -0
- package/dist/components/PopMessages.js +45 -0
- package/dist/components/_GoToComponent.d.ts +10 -0
- package/dist/components/_GoToComponent.d.ts.map +1 -0
- package/dist/components/_GoToComponent.js +13 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts +50 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.js +458 -0
- package/dist/components/library/RichTextEditor/StoredContentNode.d.ts +5 -0
- package/dist/components/library/RichTextEditor/StoredContentNode.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/StoredContentNode.js +1 -0
- package/dist/components/library/RichTextEditor/activeFormats.d.ts +20 -0
- package/dist/components/library/RichTextEditor/activeFormats.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/activeFormats.js +48 -0
- package/dist/components/library/RichTextEditor/contentTree.d.ts +30 -0
- package/dist/components/library/RichTextEditor/contentTree.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/contentTree.js +81 -0
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.d.ts +30 -0
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +97 -0
- package/dist/components/library/__StatefulMessage/MessageData.d.ts +7 -0
- package/dist/components/library/__StatefulMessage/MessageData.d.ts.map +1 -0
- package/dist/components/library/__StatefulMessage/MessageData.js +1 -0
- package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts +22 -0
- package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts.map +1 -0
- package/dist/components/library/__StatefulMessage/StatefulMessage.js +88 -0
- package/dist/components/library/index.d.ts +5 -0
- package/dist/components/library/index.d.ts.map +1 -0
- package/dist/components/library/index.js +7 -0
- package/dist/defaultConfig.d.ts +2 -0
- package/dist/defaultConfig.d.ts.map +1 -1
- package/dist/defaultConfig.js +3 -1
- package/dist/env/Interfaces.d.ts +2 -1
- package/dist/env/Interfaces.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.d.ts +1 -1
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/injectEnv.d.ts +1 -1
- package/dist/env/injectEnv.d.ts.map +1 -1
- package/dist/env/injectEnv.js +16 -6
- package/dist/env/publicEnv.d.ts.map +1 -1
- package/dist/env/publicEnv.js +4 -1
- package/dist/findUserConfig.d.ts +1 -1
- package/dist/frameworkConfigSchema.d.ts +4 -0
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +2 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useInstance.d.ts +3 -0
- package/dist/hooks/useInstance.d.ts.map +1 -0
- package/dist/hooks/useInstance.js +4 -0
- package/dist/hydrate/hydrate.d.ts +6 -4
- package/dist/hydrate/hydrate.d.ts.map +1 -1
- package/dist/hydrate/hydrate.js +51 -13
- package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
- package/dist/hydrate/reconcileHydratedAttributes.js +4 -3
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts +7 -0
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -0
- package/dist/hydrate/renderHydrationMismatchBanner.js +69 -0
- package/dist/indexInner.d.ts +13 -5
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +9 -2
- package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -1
- package/dist/pop.d.ts +10 -0
- package/dist/pop.d.ts.map +1 -0
- package/dist/pop.js +49 -0
- package/dist/postcssPlugins/TransformCssNames.d.ts.map +1 -1
- package/dist/postcssPlugins/TransformCssNames.js +10 -2
- package/dist/propsAreEqual.d.ts +8 -0
- package/dist/propsAreEqual.d.ts.map +1 -0
- package/dist/propsAreEqual.js +97 -0
- package/dist/rawHtml/filterContentNode.d.ts +20 -0
- package/dist/rawHtml/filterContentNode.d.ts.map +1 -0
- package/dist/rawHtml/filterContentNode.js +96 -0
- package/dist/rawHtml/parseHtml.d.ts +14 -0
- package/dist/rawHtml/parseHtml.d.ts.map +1 -1
- package/dist/rawHtml/parseHtml.js +4 -4
- package/dist/rawHtml/sanitizeHtml.d.ts +17 -0
- package/dist/rawHtml/sanitizeHtml.d.ts.map +1 -0
- package/dist/rawHtml/sanitizeHtml.js +19 -0
- package/dist/render/HeadData.d.ts +2 -0
- package/dist/render/HeadData.d.ts.map +1 -1
- package/dist/render/contentNodeToHtml.d.ts +18 -0
- package/dist/render/contentNodeToHtml.d.ts.map +1 -0
- package/dist/render/contentNodeToHtml.js +66 -0
- package/dist/render/contentToHtml.d.ts.map +1 -1
- package/dist/render/contentToHtml.js +3 -1
- package/dist/render/instantiateClassComponent.d.ts.map +1 -1
- package/dist/render/instantiateClassComponent.js +4 -0
- package/dist/render/processHead.d.ts.map +1 -1
- package/dist/render/processHead.js +22 -3
- package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
- package/dist/render/renderingTreeToHtml.js +8 -1
- package/dist/routing/ErrorRouteType.d.ts +6 -0
- package/dist/routing/ErrorRouteType.d.ts.map +1 -0
- package/dist/routing/ErrorRouteType.js +1 -0
- package/dist/routing/RouteTypes.d.ts +2 -1
- package/dist/routing/RouteTypes.d.ts.map +1 -1
- package/dist/routing/Routes.d.ts +5 -0
- package/dist/routing/Routes.d.ts.map +1 -1
- package/dist/routing/TungstenErrorInfo.d.ts +6 -0
- package/dist/routing/TungstenErrorInfo.d.ts.map +1 -0
- package/dist/routing/TungstenErrorInfo.js +6 -0
- package/dist/settings.d.ts +2 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +3 -0
- package/dist/stateTracking.d.ts +47 -0
- package/dist/stateTracking.d.ts.map +1 -0
- package/dist/stateTracking.js +83 -0
- package/dist/staticGen/staticGen.d.ts.map +1 -1
- package/dist/staticGen/staticGen.js +117 -107
- package/dist/style/styleContentSxy.js +21 -0
- package/dist/testing/hydrateTestApp.d.ts +38 -0
- package/dist/testing/hydrateTestApp.d.ts.map +1 -0
- package/dist/testing/hydrateTestApp.js +242 -0
- package/dist/testing/index.d.ts +4 -3
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +16 -2
- package/dist/testing/installTestStyleProcessors.d.ts +2 -0
- package/dist/testing/installTestStyleProcessors.d.ts.map +1 -0
- package/dist/testing/installTestStyleProcessors.js +21 -0
- package/dist/testing/temp/componentPackageMock.d.ts +18 -0
- package/dist/testing/temp/componentPackageMock.d.ts.map +1 -0
- package/dist/testing/temp/componentPackageMock.js +37 -0
- package/dist/testing/temp/contentHtmlElements.d.ts +3 -0
- package/dist/testing/temp/contentHtmlElements.d.ts.map +1 -0
- package/dist/testing/temp/contentHtmlElements.js +12 -0
- package/dist/timeProfiler.d.ts +6 -0
- package/dist/timeProfiler.d.ts.map +1 -0
- package/dist/timeProfiler.js +31 -0
- package/dist/update/integrateUpdateVdom.d.ts +11 -0
- package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
- package/dist/update/integrateUpdateVdom.js +169 -54
- package/dist/update/pendingMounts.d.ts +25 -0
- package/dist/update/pendingMounts.d.ts.map +1 -0
- package/dist/update/pendingMounts.js +55 -0
- package/dist/warnOnFrameworkChange.d.ts.map +1 -1
- package/dist/warnOnFrameworkChange.js +8 -8
- package/package.json +21 -17
- package/dist/FunctionComponentStandIn.sxyt.d.ts +0 -2
- package/dist/FunctionComponentStandIn.sxyt.d.ts.map +0 -1
- package/dist/FunctionComponentStandIn.sxyt.js +0 -52
- package/dist/Instance/gotoRedirect.sxyt.d.ts +0 -2
- package/dist/Instance/gotoRedirect.sxyt.d.ts.map +0 -1
- package/dist/Instance/gotoRedirect.sxyt.js +0 -148
- package/dist/Instance/runTrackedWork.sxyt.d.ts +0 -2
- package/dist/Instance/runTrackedWork.sxyt.d.ts.map +0 -1
- package/dist/Instance/runTrackedWork.sxyt.js +0 -35
- package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts +0 -2
- package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts.map +0 -1
- package/dist/Servers/devErrorPageAutoRetry.sxyt.js +0 -117
- package/dist/_client/cjsHelpers.sxyt.d.ts +0 -2
- package/dist/_client/cjsHelpers.sxyt.d.ts.map +0 -1
- package/dist/_client/cjsHelpers.sxyt.js +0 -45
- package/dist/auth/passwordHashing.sxyt.d.ts +0 -2
- package/dist/auth/passwordHashing.sxyt.d.ts.map +0 -1
- package/dist/auth/passwordHashing.sxyt.js +0 -46
- package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts +0 -2
- package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts.map +0 -1
- package/dist/auth/ref/checkPasswordResetToken.sxyt.js +0 -40
- package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts +0 -2
- package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts.map +0 -1
- package/dist/auth/ref/createPasswordResetToken.sxyt.js +0 -10
- package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts +0 -2
- package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.js +0 -138
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts +0 -2
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.js +0 -108
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts +0 -2
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.js +0 -104
- package/dist/bin/commands/compile.sxyt.d.ts +0 -2
- package/dist/bin/commands/compile.sxyt.d.ts.map +0 -1
- package/dist/bin/commands/compile.sxyt.js +0 -255
- package/dist/build/modifySassImports.sxyt.d.ts +0 -2
- package/dist/build/modifySassImports.sxyt.d.ts.map +0 -1
- package/dist/build/modifySassImports.sxyt.js +0 -55
- package/dist/build/sassImportParser.sxyt.d.ts +0 -2
- package/dist/build/sassImportParser.sxyt.d.ts.map +0 -1
- package/dist/build/sassImportParser.sxyt.js +0 -110
- package/dist/build/scssImportParserChatgpt.sxyt.d.ts +0 -2
- package/dist/build/scssImportParserChatgpt.sxyt.d.ts.map +0 -1
- package/dist/build/scssImportParserChatgpt.sxyt.js +0 -120
- package/dist/clone.sxyt.d.ts +0 -2
- package/dist/clone.sxyt.d.ts.map +0 -1
- package/dist/clone.sxyt.js +0 -24
- package/dist/componentProxyHandlers.sxyt.d.ts +0 -2
- package/dist/componentProxyHandlers.sxyt.d.ts.map +0 -1
- package/dist/componentProxyHandlers.sxyt.js +0 -130
- package/dist/components/RawHtml.sxyt.d.ts +0 -2
- package/dist/components/RawHtml.sxyt.d.ts.map +0 -1
- package/dist/components/RawHtml.sxyt.js +0 -104
- package/dist/components/bindable/BindableSelect.sxyt.d.ts +0 -2
- package/dist/components/bindable/BindableSelect.sxyt.d.ts.map +0 -1
- package/dist/components/bindable/BindableSelect.sxyt.js +0 -186
- package/dist/env/injectEnv.sxyt.d.ts +0 -2
- package/dist/env/injectEnv.sxyt.d.ts.map +0 -1
- package/dist/env/injectEnv.sxyt.js +0 -20
- package/dist/env/parseEnv.d.ts +0 -2
- package/dist/env/parseEnv.d.ts.map +0 -1
- package/dist/env/parseEnv.js +0 -14
- package/dist/env/parseEnv.sxyt.d.ts +0 -2
- package/dist/env/parseEnv.sxyt.d.ts.map +0 -1
- package/dist/env/parseEnv.sxyt.js +0 -11
- package/dist/findProjectDir.sxyt.d.ts +0 -2
- package/dist/findProjectDir.sxyt.d.ts.map +0 -1
- package/dist/findProjectDir.sxyt.js +0 -82
- package/dist/hmr/applyHmrModule.sxyt.d.ts +0 -2
- package/dist/hmr/applyHmrModule.sxyt.d.ts.map +0 -1
- package/dist/hmr/applyHmrModule.sxyt.js +0 -182
- package/dist/hmr/instanceRegistry.sxyt.d.ts +0 -2
- package/dist/hmr/instanceRegistry.sxyt.d.ts.map +0 -1
- package/dist/hmr/instanceRegistry.sxyt.js +0 -24
- package/dist/hmr/refreshStylesheets.sxyt.d.ts +0 -2
- package/dist/hmr/refreshStylesheets.sxyt.d.ts.map +0 -1
- package/dist/hmr/refreshStylesheets.sxyt.js +0 -46
- package/dist/hydrate/hydrate.sxyt.d.ts +0 -2
- package/dist/hydrate/hydrate.sxyt.d.ts.map +0 -1
- package/dist/hydrate/hydrate.sxyt.js +0 -302
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts +0 -2
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts.map +0 -1
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.js +0 -190
- package/dist/importDevModuleWithRetry.sxyt.d.ts +0 -2
- package/dist/importDevModuleWithRetry.sxyt.d.ts.map +0 -1
- package/dist/importDevModuleWithRetry.sxyt.js +0 -104
- package/dist/innerHtmlFromProps.sxyt.d.ts +0 -2
- package/dist/innerHtmlFromProps.sxyt.d.ts.map +0 -1
- package/dist/innerHtmlFromProps.sxyt.js +0 -99
- package/dist/postcssPlugins/parseSelectors.sxyt.d.ts +0 -2
- package/dist/postcssPlugins/parseSelectors.sxyt.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectors.sxyt.js +0 -62
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts +0 -2
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.js +0 -155
- package/dist/rawHtml/parseHtml.sxyt.d.ts +0 -2
- package/dist/rawHtml/parseHtml.sxyt.d.ts.map +0 -1
- package/dist/rawHtml/parseHtml.sxyt.js +0 -239
- package/dist/render/getFunctionBodyAsString.sxyt.d.ts +0 -2
- package/dist/render/getFunctionBodyAsString.sxyt.d.ts.map +0 -1
- package/dist/render/getFunctionBodyAsString.sxyt.js +0 -37
- package/dist/render/processHead.sxyt.d.ts +0 -2
- package/dist/render/processHead.sxyt.d.ts.map +0 -1
- package/dist/render/processHead.sxyt.js +0 -93
- package/dist/render/processProps.sxyt.d.ts +0 -2
- package/dist/render/processProps.sxyt.d.ts.map +0 -1
- package/dist/render/processProps.sxyt.js +0 -90
- package/dist/routing/compareRequestToRegex.sxyt.d.ts +0 -2
- package/dist/routing/compareRequestToRegex.sxyt.d.ts.map +0 -1
- package/dist/routing/compareRequestToRegex.sxyt.js +0 -65
- package/dist/routing/getPathPriority.sxyt.d.ts +0 -2
- package/dist/routing/getPathPriority.sxyt.d.ts.map +0 -1
- package/dist/routing/getPathPriority.sxyt.js +0 -24
- package/dist/routing/matchPath.sxyt.d.ts +0 -2
- package/dist/routing/matchPath.sxyt.d.ts.map +0 -1
- package/dist/routing/matchPath.sxyt.js +0 -41
- package/dist/routing/patternToRegex.sxyt.d.ts +0 -2
- package/dist/routing/patternToRegex.sxyt.d.ts.map +0 -1
- package/dist/routing/patternToRegex.sxyt.js +0 -69
- package/dist/routing/splitRequest.sxyt.d.ts +0 -2
- package/dist/routing/splitRequest.sxyt.d.ts.map +0 -1
- package/dist/routing/splitRequest.sxyt.js +0 -47
- package/dist/style/jssToCss.sxyt.d.ts +0 -2
- package/dist/style/jssToCss.sxyt.d.ts.map +0 -1
- package/dist/style/jssToCss.sxyt.js +0 -17
- package/dist/testing/createTestApp.sxyt.d.ts +0 -2
- package/dist/testing/createTestApp.sxyt.d.ts.map +0 -1
- package/dist/testing/createTestApp.sxyt.js +0 -470
- package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts +0 -2
- package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts.map +0 -1
- package/dist/testing/ensureTestEnvLoaded.sxyt.js +0 -20
- package/dist/update/hotSwap.sxyt.d.ts +0 -2
- package/dist/update/hotSwap.sxyt.d.ts.map +0 -1
- package/dist/update/hotSwap.sxyt.js +0 -252
package/dist/bin/commands/dev.js
CHANGED
|
@@ -2,11 +2,16 @@ import open from 'open';
|
|
|
2
2
|
import { cliOut } from "../../cliOutput.js";
|
|
3
3
|
import { Framework } from "../../Framework.js";
|
|
4
4
|
import { warnOnFrameworkChange } from "../../warnOnFrameworkChange.js";
|
|
5
|
+
import { createTimeProfiler } from "../../timeProfiler.js";
|
|
5
6
|
//import dotenv from 'dotenv'
|
|
6
7
|
//dotenv.config({ path: '.private.env' })
|
|
8
|
+
const args = process.argv.slice(3);
|
|
9
|
+
const boot = !args.includes('--no-boot');
|
|
10
|
+
const profile = args.includes('--profile');
|
|
7
11
|
cliOut(`Starting dev mode`);
|
|
8
12
|
//// prep the app
|
|
9
13
|
const sxyFramework = new Framework();
|
|
14
|
+
sxyFramework.profiler = createTimeProfiler(profile);
|
|
10
15
|
await sxyFramework.init();
|
|
11
16
|
//console.log('framework ready')
|
|
12
17
|
// build for dev
|
|
@@ -17,9 +22,15 @@ await sxyFramework.build('dev');
|
|
|
17
22
|
// start a dev server
|
|
18
23
|
const devServer = await sxyFramework.createDevServer();
|
|
19
24
|
//cliOut('Dev server ready')
|
|
20
|
-
const devServerLocation = await devServer.start();
|
|
21
|
-
|
|
25
|
+
const devServerLocation = await sxyFramework.profiler.timeProfileAsync('start dev server', () => devServer.start());
|
|
26
|
+
// devmon already restarts this process itself on a framework rebuild, so the warning
|
|
27
|
+
// (which just tells you to restart manually) would be redundant noise under it - see devmon.ts.
|
|
28
|
+
if (sxyFramework.config?.warnOnFrameworkChange && process.env.__TUNGSTEN_DEVMON !== 'true') {
|
|
29
|
+
warnOnFrameworkChange();
|
|
30
|
+
}
|
|
22
31
|
// do a dummy request to trigger any error immediately during dev
|
|
23
32
|
//axios.get(sxyFramework.devServer.location)
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
if (boot) {
|
|
34
|
+
cliOut('Booting to the dev site in your browser');
|
|
35
|
+
open(devServerLocation);
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devmon.d.ts","sourceRoot":"","sources":["../../../src/bin/commands/devmon.ts"],"names":[],"mappings":"AAqEA,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Master process for `tungsten dev`: runs it as a child process and watches the same
|
|
2
|
+
// build-notification marker file as warnOnFrameworkChange.ts (dist/.build-complete in the
|
|
3
|
+
// framework package). When a framework rebuild touches it, kills and respawns the dev child
|
|
4
|
+
// instead of just warning that a restart is needed.
|
|
5
|
+
import { spawn } from 'node:child_process';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import chokidar from 'chokidar';
|
|
9
|
+
import { cliError } from "../../cliOutput.js";
|
|
10
|
+
import { getFrameworkDir } from "../../getFrameworkDir.js";
|
|
11
|
+
const binIndexPath = fileURLToPath(new URL('../index.js', import.meta.url));
|
|
12
|
+
const initialArgs = process.argv.slice(3);
|
|
13
|
+
// Restarts always force --no-boot (no reopening the browser tab each time), but otherwise
|
|
14
|
+
// keep whatever else devmon itself was passed - e.g. --profile.
|
|
15
|
+
const restartArgs = [...initialArgs.filter(arg => arg !== '--no-boot'), '--no-boot'];
|
|
16
|
+
const buildMarkerPath = join(getFrameworkDir(), 'dist', '.build-complete');
|
|
17
|
+
let child = null;
|
|
18
|
+
let restarting = false;
|
|
19
|
+
function startDev(args) {
|
|
20
|
+
// __TUNGSTEN_DEVMON tells dev.ts to skip warnOnFrameworkChange() - devmon is already
|
|
21
|
+
// restarting it, so that warning would just be confusing noise here.
|
|
22
|
+
child = spawn(process.execPath, [binIndexPath, 'dev', ...args], {
|
|
23
|
+
stdio: 'inherit',
|
|
24
|
+
env: {
|
|
25
|
+
...process.env,
|
|
26
|
+
__TUNGSTEN_DEVMON: 'true'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
child.on('exit', code => {
|
|
30
|
+
child = null;
|
|
31
|
+
// not one of our own restarts, so the dev process ended on its own (crash, or the
|
|
32
|
+
// user quit it directly) - nothing left for devmon to supervise
|
|
33
|
+
if (!restarting) process.exit(code ?? 0);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function restartDev() {
|
|
37
|
+
if (restarting) return;
|
|
38
|
+
restarting = true;
|
|
39
|
+
cliError('tungsten framework rebuilt - restarting tungsten dev');
|
|
40
|
+
if (child === null) {
|
|
41
|
+
restarting = false;
|
|
42
|
+
startDev(restartArgs);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
child.once('exit', () => {
|
|
46
|
+
restarting = false;
|
|
47
|
+
startDev(restartArgs);
|
|
48
|
+
});
|
|
49
|
+
child.kill();
|
|
50
|
+
}
|
|
51
|
+
startDev(initialArgs);
|
|
52
|
+
const watcher = chokidar.watch(buildMarkerPath, {
|
|
53
|
+
ignoreInitial: true,
|
|
54
|
+
awaitWriteFinish: {
|
|
55
|
+
stabilityThreshold: 200,
|
|
56
|
+
pollInterval: 20
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
watcher.on('all', restartDev);
|
|
60
|
+
function shutdown() {
|
|
61
|
+
void watcher.close();
|
|
62
|
+
if (child !== null) child.kill();
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
process.on('SIGINT', shutdown);
|
|
66
|
+
process.on('SIGTERM', shutdown);
|
package/dist/bin/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bin/index.ts"],"names":[],"mappings":"AAwDA,OAAO,EAAE,CAAA"}
|
package/dist/bin/index.js
CHANGED
|
@@ -10,6 +10,12 @@ switch (command) {
|
|
|
10
10
|
await import("./commands/dev.js");
|
|
11
11
|
break;
|
|
12
12
|
}
|
|
13
|
+
case 'devmon':
|
|
14
|
+
{
|
|
15
|
+
process.env.__TUNGSTEN_ENV = 'development';
|
|
16
|
+
await import("./commands/devmon.js");
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
13
19
|
case 'build':
|
|
14
20
|
{
|
|
15
21
|
process.env.__TUNGSTEN_ENV = 'production';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attribute string value for a boolean prop, or `null` when the attribute
|
|
3
|
+
* should be omitted entirely.
|
|
4
|
+
*
|
|
5
|
+
* The general rule is an ordinary HTML boolean attribute - `disabled`,
|
|
6
|
+
* `checked`, `hidden` and the rest: present (conventionally with an empty
|
|
7
|
+
* value) means true, absent means false. `contentEditable` looks like one of
|
|
8
|
+
* these in JSX but is not: `contenteditable` is a three-state enumerated
|
|
9
|
+
* attribute (true/false/inherit) where an absent attribute means *inherit*,
|
|
10
|
+
* not false. Representing `contentEditable={false}` by omitting the
|
|
11
|
+
* attribute therefore does nothing under an editable ancestor - the element
|
|
12
|
+
* silently stays editable. It gets explicit `"true"`/`"false"` strings
|
|
13
|
+
* instead; every other boolean prop keeps the ordinary rule.
|
|
14
|
+
*
|
|
15
|
+
* Shared by every place that turns a boolean prop into HTML - the server
|
|
16
|
+
* renderer, the client create/update paths, hydration's attribute
|
|
17
|
+
* reconciliation, and `contentNodeToHtml()` - so they cannot disagree with
|
|
18
|
+
* each other and produce a false hydration mismatch.
|
|
19
|
+
*/
|
|
20
|
+
export declare function booleanAttributeValue(name: string, value: boolean): string | null;
|
|
21
|
+
//# sourceMappingURL=booleanAttributeValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booleanAttributeValue.d.ts","sourceRoot":"","sources":["../src/booleanAttributeValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAGjF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attribute string value for a boolean prop, or `null` when the attribute
|
|
3
|
+
* should be omitted entirely.
|
|
4
|
+
*
|
|
5
|
+
* The general rule is an ordinary HTML boolean attribute - `disabled`,
|
|
6
|
+
* `checked`, `hidden` and the rest: present (conventionally with an empty
|
|
7
|
+
* value) means true, absent means false. `contentEditable` looks like one of
|
|
8
|
+
* these in JSX but is not: `contenteditable` is a three-state enumerated
|
|
9
|
+
* attribute (true/false/inherit) where an absent attribute means *inherit*,
|
|
10
|
+
* not false. Representing `contentEditable={false}` by omitting the
|
|
11
|
+
* attribute therefore does nothing under an editable ancestor - the element
|
|
12
|
+
* silently stays editable. It gets explicit `"true"`/`"false"` strings
|
|
13
|
+
* instead; every other boolean prop keeps the ordinary rule.
|
|
14
|
+
*
|
|
15
|
+
* Shared by every place that turns a boolean prop into HTML - the server
|
|
16
|
+
* renderer, the client create/update paths, hydration's attribute
|
|
17
|
+
* reconciliation, and `contentNodeToHtml()` - so they cannot disagree with
|
|
18
|
+
* each other and produce a false hydration mismatch.
|
|
19
|
+
*/
|
|
20
|
+
export function booleanAttributeValue(name, value) {
|
|
21
|
+
if (name.toLowerCase() === 'contenteditable') return value ? 'true' : 'false';
|
|
22
|
+
return value ? '' : null;
|
|
23
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompilationInfo.d.ts","sourceRoot":"","sources":["../../src/build/CompilationInfo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,aAAa,EAAE,aAAa,CAAA;CAC/B,CAAA"}
|
|
1
|
+
{"version":3,"file":"CompilationInfo.d.ts","sourceRoot":"","sources":["../../src/build/CompilationInfo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,aAAa,EAAE,aAAa,CAAA;CAC/B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function combineComponentCss(buildLocation: string): Promise<void>;
|
|
1
|
+
export declare function combineComponentCss(buildLocation: string, folder?: string, file?: string): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=combineComponentCss.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combineComponentCss.d.ts","sourceRoot":"","sources":["../../src/build/combineComponentCss.ts"],"names":[],"mappings":"AAuBA,wBAAsB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"combineComponentCss.d.ts","sourceRoot":"","sources":["../../src/build/combineComponentCss.ts"],"names":[],"mappings":"AAuBA,wBAAsB,mBAAmB,CACrC,aAAa,EAAE,MAAM,EAAE,MAAM,GAAE,MAA2B,EAAE,IAAI,GAAE,MAAyB,GAC5F,OAAO,CAAC,IAAI,CAAC,CAqCf"}
|
|
@@ -13,9 +13,9 @@ function validateCharset(css, file) {
|
|
|
13
13
|
}
|
|
14
14
|
return charsets.length > 0;
|
|
15
15
|
}
|
|
16
|
-
export async function combineComponentCss(buildLocation) {
|
|
17
|
-
const outputDirectory = join(buildLocation,
|
|
18
|
-
const outputFile = join(outputDirectory,
|
|
16
|
+
export async function combineComponentCss(buildLocation, folder = componentCssFolder, file = componentCssFile) {
|
|
17
|
+
const outputDirectory = join(buildLocation, folder);
|
|
18
|
+
const outputFile = join(outputDirectory, file);
|
|
19
19
|
const individualDirectory = resolve(outputDirectory, 'i');
|
|
20
20
|
const manifest = await fsPromises.readFile(outputFile, 'utf8');
|
|
21
21
|
const importPaths = [...manifest.matchAll(componentImportPattern)].map(match => match[1]).filter(importPath => importPath !== undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAO/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;AAetC,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;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAA;CAC9F,CAAA;AAKD,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,
|
|
1
|
+
{"version":3,"file":"compileJavascript.d.ts","sourceRoot":"","sources":["../../src/build/compileJavascript.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAO/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;AAetC,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;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAA;CAC9F,CAAA;AAKD,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,CA8YlC"}
|
|
@@ -40,9 +40,9 @@ export async function compileJavascript(projectDir, appConfig, codeLocation, sou
|
|
|
40
40
|
dependencyGraph = {};
|
|
41
41
|
importAliases = {};
|
|
42
42
|
promises = [];
|
|
43
|
-
config = makeBabelUserDevConfig(projectDir, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, dependencyGraphDir, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises);
|
|
43
|
+
config = makeBabelUserDevConfig(projectDir, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, dependencyGraphDir, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises, watch);
|
|
44
44
|
} else {
|
|
45
|
-
config = makeBabelUserProdConfig(projectDir, codeLocation, sourceLocation, styleImportBase);
|
|
45
|
+
config = makeBabelUserProdConfig(projectDir, codeLocation, sourceLocation, styleImportBase, watch);
|
|
46
46
|
}
|
|
47
47
|
config.root = getFrameworkDir();
|
|
48
48
|
// compile with the API
|
|
@@ -52,7 +52,7 @@ export async function compileJavascript(projectDir, appConfig, codeLocation, sou
|
|
|
52
52
|
const pendingExportWipes = new Map();
|
|
53
53
|
const exportWipeGraceMs = 5000;
|
|
54
54
|
async function transformFile(file) {
|
|
55
|
-
if (options.quiet !== true) console.log('transforming file', file)
|
|
55
|
+
//if (options.quiet !== true) console.log('transforming file', file)
|
|
56
56
|
try {
|
|
57
57
|
let rel = file.slice(codeLocationLength);
|
|
58
58
|
if (rel.endsWith('.jsx')) rel = rel.slice(0, -1);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CompilationInfo } from './CompilationInfo.js';
|
|
2
2
|
import type { FrameworkConfigComplete } from '../FrameworkConfig.js';
|
|
3
3
|
import type { Mode } from '../Mode.js';
|
|
4
|
-
|
|
4
|
+
import { type TimeProfiler } from '../timeProfiler.js';
|
|
5
|
+
export declare function compileUserApp(projectDir: string, appConfig: FrameworkConfigComplete, mode: Mode, profiler?: TimeProfiler): Promise<CompilationInfo>;
|
|
5
6
|
//# sourceMappingURL=compileUserApp.d.ts.map
|
|
@@ -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;AAWtC,wBAAsB,cAAc,CAChC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,
|
|
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;AAWtC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAI1E,wBAAsB,cAAc,CAChC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,EAClE,QAAQ,GAAE,YAAwC,GACnD,OAAO,CAAC,eAAe,CAAC,CAsE1B"}
|
|
@@ -3,11 +3,13 @@ import { compileJavascript } from "./compileJavascript.js";
|
|
|
3
3
|
import { compileStyles } from "./compileStyles.js";
|
|
4
4
|
import { copyAssets } from "./copyAssets.js";
|
|
5
5
|
import { copyPublicFiles } from "./copyPublicFiles.js";
|
|
6
|
-
import { buildCodeSubPath, bundleFolder, devBuildOuterFolder, prodBuildFolder } from "../settings.js";
|
|
6
|
+
import { buildCodeSubPath, bundleFolder, devBuildOuterFolder, frameworkCssFile, frameworkCssFolder, prodBuildFolder } from "../settings.js";
|
|
7
7
|
import { combineComponentCss } from "./combineComponentCss.js";
|
|
8
|
+
import { writeFrameworkCss } from "./frameworkStylesheets.js";
|
|
8
9
|
import { emitReloadEvent } from "../hmr/liveReloadHub.js";
|
|
10
|
+
import { createTimeProfiler } from "../timeProfiler.js";
|
|
9
11
|
//import { compileEnv } from './compileEnv.js'
|
|
10
|
-
export async function compileUserApp(projectDir, appConfig, mode) {
|
|
12
|
+
export async function compileUserApp(projectDir, appConfig, mode, profiler = createTimeProfiler(false)) {
|
|
11
13
|
const codeLocation = join(projectDir, appConfig.codeDir);
|
|
12
14
|
const relSourceDir = appConfig.sourceDir !== undefined && appConfig.sourceDir !== '' ? appConfig.sourceDir : appConfig.codeDir;
|
|
13
15
|
const sourceLocation = join(projectDir, relSourceDir);
|
|
@@ -15,15 +17,18 @@ export async function compileUserApp(projectDir, appConfig, mode) {
|
|
|
15
17
|
const buildLocation = mode === 'dev' ? join(projectDir, devBuildOuterFolder) : join(projectDir, prodBuildFolder);
|
|
16
18
|
const codeSubPath = buildCodeSubPath;
|
|
17
19
|
const buildCodeLocation = join(buildLocation, codeSubPath);
|
|
18
|
-
|
|
20
|
+
// a prod build is one-shot: watching would leave chokidar handles holding the event loop
|
|
21
|
+
// open, so the command could only ever end by hard-exiting
|
|
22
|
+
const watch = mode === 'dev';
|
|
23
|
+
const compileJavascriptPromise = profiler.timeProfileAsync('compile javascript', () => compileJavascript(projectDir, appConfig, codeLocation, sourceLocation, styleImportBase, buildLocation, buildCodeLocation, mode, watch, mode === 'dev' ? {
|
|
19
24
|
onCycleComplete: cycle => {
|
|
20
25
|
if (cycle.success) emitReloadEvent('js', cycle.file);
|
|
21
26
|
}
|
|
22
|
-
} : {});
|
|
27
|
+
} : {}));
|
|
23
28
|
//const compileEnvPromise = compileEnv(projectDir, appConfig, codeLocation, buildLocation, mode)
|
|
24
|
-
const compileStylesPromise = compileStyles(projectDir, appConfig, styleImportBase, buildLocation,
|
|
25
|
-
const copyAssetsPromise = copyAssets(projectDir, appConfig, buildLocation);
|
|
26
|
-
const copyPublicFilesPromise = copyPublicFiles(projectDir, appConfig, buildLocation);
|
|
29
|
+
const compileStylesPromise = profiler.timeProfileAsync('compile styles', () => compileStyles(projectDir, appConfig, styleImportBase, buildLocation, watch, mode === 'dev' ? () => emitReloadEvent('css') : undefined));
|
|
30
|
+
const copyAssetsPromise = profiler.timeProfileAsync('copy assets', () => copyAssets(projectDir, appConfig, buildLocation, watch));
|
|
31
|
+
const copyPublicFilesPromise = profiler.timeProfileAsync('copy public files', () => copyPublicFiles(projectDir, appConfig, buildLocation, watch));
|
|
27
32
|
const {
|
|
28
33
|
importAliases
|
|
29
34
|
} = await compileJavascriptPromise;
|
|
@@ -31,7 +36,11 @@ export async function compileUserApp(projectDir, appConfig, mode) {
|
|
|
31
36
|
await compileStylesPromise;
|
|
32
37
|
await copyAssetsPromise;
|
|
33
38
|
await copyPublicFilesPromise;
|
|
34
|
-
if (mode === 'prod') await combineComponentCss(buildLocation);
|
|
39
|
+
if (mode === 'prod') await profiler.timeProfileAsync('combine component css', () => combineComponentCss(buildLocation));
|
|
40
|
+
const frameworkCss = await profiler.timeProfileAsync('write framework css', () => writeFrameworkCss(buildLocation));
|
|
41
|
+
if (mode === 'prod' && frameworkCss !== undefined) {
|
|
42
|
+
await profiler.timeProfileAsync('combine framework css', () => combineComponentCss(buildLocation, frameworkCssFolder, frameworkCssFile));
|
|
43
|
+
}
|
|
35
44
|
const compilationInfo = {
|
|
36
45
|
type: 'success',
|
|
37
46
|
projectDir,
|
|
@@ -42,6 +51,7 @@ export async function compileUserApp(projectDir, appConfig, mode) {
|
|
|
42
51
|
location: buildLocation,
|
|
43
52
|
importAliases
|
|
44
53
|
};
|
|
54
|
+
if (frameworkCss !== undefined) compilationInfo.frameworkCss = frameworkCss;
|
|
45
55
|
if (mode === 'prod') compilationInfo.bundleLocation = join(projectDir, bundleFolder);
|
|
46
56
|
return compilationInfo;
|
|
47
57
|
}
|
|
@@ -20,7 +20,7 @@ export async function createInstanceConfigFile(config, mode, buildLocation) {
|
|
|
20
20
|
});
|
|
21
21
|
await fsPromises.writeFile(appConfigLocation,
|
|
22
22
|
// to
|
|
23
|
-
`export default { prod: ${(mode === 'prod').toString()}, useRootComponent: ${config.useRootComponent.toString()}, siteBasePath: "${siteBasePath}", clientSideNav: ${config.clientSideNav.toString()}, staticSite: ${config.staticSite.toString()} };` // eslint-disable-line max-len
|
|
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()} };` // eslint-disable-line max-len
|
|
24
24
|
);
|
|
25
25
|
} catch (e) {
|
|
26
26
|
throw new TungstenError(`createAppConfig() Error: error creating app config file`);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function recordFrameworkStylesheet(packageDir: string, rel: string): void;
|
|
2
|
+
export declare function clearFrameworkStylesheets(): void;
|
|
3
|
+
export declare function frameworkCssPath(buildLocation: string): string | undefined;
|
|
4
|
+
export declare function writeFrameworkCss(buildLocation: string): Promise<string | undefined>;
|
|
5
|
+
//# sourceMappingURL=frameworkStylesheets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameworkStylesheets.d.ts","sourceRoot":"","sources":["../../src/build/frameworkStylesheets.ts"],"names":[],"mappings":"AAqBA,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"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { existsSync, promises as fsPromises } from 'fs';
|
|
2
|
+
import { dirname, join } from 'path';
|
|
3
|
+
import slash from 'slash';
|
|
4
|
+
import { frameworkCssFile, frameworkCssFolder, frameworkDistFolder } from "../settings.js";
|
|
5
|
+
// Component stylesheets named by a `$stylesheet` static on a package component, collected while
|
|
6
|
+
// the package import tree is walked so only components the app actually imports contribute.
|
|
7
|
+
// Held on globalThis because moduleReloader busts the ES module cache in dev, so the collector
|
|
8
|
+
// and the writer can otherwise end up with separate module instances.
|
|
9
|
+
const $collected = Symbol.for('tungsten.frameworkStylesheets');
|
|
10
|
+
function getCollected() {
|
|
11
|
+
const existing = Reflect.get(globalThis, $collected);
|
|
12
|
+
if (existing instanceof Map) return existing;
|
|
13
|
+
const created = new Map();
|
|
14
|
+
Reflect.set(globalThis, $collected, created);
|
|
15
|
+
return created;
|
|
16
|
+
}
|
|
17
|
+
export function recordFrameworkStylesheet(packageDir, rel) {
|
|
18
|
+
getCollected().set(join(packageDir, frameworkDistFolder, 'componentCss', rel), rel);
|
|
19
|
+
}
|
|
20
|
+
export function clearFrameworkStylesheets() {
|
|
21
|
+
getCollected().clear();
|
|
22
|
+
}
|
|
23
|
+
// Web path of an already-written manifest, for a process serving a build it did not produce.
|
|
24
|
+
export function frameworkCssPath(buildLocation) {
|
|
25
|
+
return existsSync(join(buildLocation, frameworkCssFolder, frameworkCssFile)) ? `/${frameworkCssFolder}/${frameworkCssFile}` : undefined;
|
|
26
|
+
}
|
|
27
|
+
// Copies the collected stylesheets into the build and writes their manifest.
|
|
28
|
+
// Returns the manifest's web path, or undefined when nothing contributed.
|
|
29
|
+
export async function writeFrameworkCss(buildLocation) {
|
|
30
|
+
const collected = getCollected();
|
|
31
|
+
if (collected.size === 0) return undefined;
|
|
32
|
+
const target = join(buildLocation, frameworkCssFolder);
|
|
33
|
+
const imports = [];
|
|
34
|
+
for (const [source, rel] of collected) {
|
|
35
|
+
if (!existsSync(source)) continue;
|
|
36
|
+
const dest = join(target, rel);
|
|
37
|
+
await fsPromises.mkdir(dirname(dest), {
|
|
38
|
+
recursive: true
|
|
39
|
+
});
|
|
40
|
+
await fsPromises.copyFile(source, dest);
|
|
41
|
+
imports.push(`@import "${slash(rel)}";`);
|
|
42
|
+
}
|
|
43
|
+
if (imports.length === 0) return undefined;
|
|
44
|
+
await fsPromises.mkdir(target, {
|
|
45
|
+
recursive: true
|
|
46
|
+
});
|
|
47
|
+
await fsPromises.writeFile(join(target, frameworkCssFile), imports.join('\n') + '\n');
|
|
48
|
+
return `/${frameworkCssFolder}/${frameworkCssFile}`;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPackageDirForFile.d.ts","sourceRoot":"","sources":["../../src/build/getPackageDirForFile.ts"],"names":[],"mappings":"AAQA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIrE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { dirname } from 'path';
|
|
2
|
+
import { findProjectDir } from "../findProjectDir.js";
|
|
3
|
+
const cache = {};
|
|
4
|
+
// Package boundary for a file. Nameless package.json files are not boundaries — see findProjectDir.
|
|
5
|
+
export function getPackageDirForFile(file) {
|
|
6
|
+
const dir = dirname(file);
|
|
7
|
+
if (dir in cache) return cache[dir];
|
|
8
|
+
return cache[dir] = findProjectDir(dir, {
|
|
9
|
+
requireName: true
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSxyClientPackageAliases.d.ts","sourceRoot":"","sources":["../../src/build/getSxyClientPackageAliases.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAQvD,wBAAgB,+BAA+B,IAAI,aAAa,
|
|
1
|
+
{"version":3,"file":"getSxyClientPackageAliases.d.ts","sourceRoot":"","sources":["../../src/build/getSxyClientPackageAliases.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAQvD,wBAAgB,+BAA+B,IAAI,aAAa,CAgC/D"}
|
|
@@ -10,7 +10,9 @@ export function getTungstenClientPackageAliases() {
|
|
|
10
10
|
// I think these are only used in dev
|
|
11
11
|
const importAliases = {
|
|
12
12
|
'tungsten': `${frameworkDestLocation}/index.js`,
|
|
13
|
-
'tungsten/jsxRuntime.js': `${frameworkDestLocation}/jsxRuntime.js
|
|
13
|
+
'tungsten/jsxRuntime.js': `${frameworkDestLocation}/jsxRuntime.js`,
|
|
14
|
+
// The component library, mirroring the `./library` subpath in exports.
|
|
15
|
+
'tungsten/library': `${frameworkDestLocation}/components/library/index.js`
|
|
14
16
|
//'tungsten': `${frameworkDestLocation}/indexBundle.js`,
|
|
15
17
|
//'tungsten/jsxRuntime.js': `${frameworkDestLocation}/indexBundle.js`,
|
|
16
18
|
//'tungsten/TungstenError.js': `${frameworkDestLocation}/TungstenError.js`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TransformOptions } from '@babel/core';
|
|
2
2
|
import type { ImportAliases } from './ImportAliases.js';
|
|
3
3
|
import { DependencyGraph } from '../babelPlugins/BabelTransformPackageImports.js';
|
|
4
|
-
export declare function makeBabelUserDevConfig(projectDir: string, absCodeDir: string, absSourceDir: string, absStyleImportBase: string, buildLocation: string, buildCodeLocation: string, packagesCacheLocation: string, skipPackageCompilationFiles: ReadonlySet<string>, oldDependencyGraph: DependencyGraph, dependencyGraph: DependencyGraph, importAliases: ImportAliases, promises: Promise<any>[]): TransformOptions;
|
|
4
|
+
export declare function makeBabelUserDevConfig(projectDir: string, absCodeDir: string, absSourceDir: string, absStyleImportBase: string, buildLocation: string, buildCodeLocation: string, packagesCacheLocation: string, skipPackageCompilationFiles: ReadonlySet<string>, oldDependencyGraph: DependencyGraph, dependencyGraph: DependencyGraph, importAliases: ImportAliases, promises: Promise<any>[], watchStyles?: 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;AAKnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAoC,eAAe,EAAE,MAAM,iDAAiD,CAAA;AAOnH,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,EAC1B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,qBAAqB,EAAE,MAAM,EAC7B,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAAC,EAChD,kBAAkB,EAAE,eAAe,EACnC,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"makeBabelUserDevConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserDevConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAKnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAoC,eAAe,EAAE,MAAM,iDAAiD,CAAA;AAOnH,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,EAC1B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,qBAAqB,EAAE,MAAM,EAC7B,2BAA2B,EAAE,WAAW,CAAC,MAAM,CAAC,EAChD,kBAAkB,EAAE,eAAe,EACnC,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EACxB,WAAW,UAAO,GACnB,gBAAgB,CAgClB"}
|
|
@@ -7,7 +7,7 @@ import { componentCssFolder, componentCssFile } from "../settings.js";
|
|
|
7
7
|
import userCommonConfig from "./babel.user.common.config.js";
|
|
8
8
|
import { MakeBabelTransformCssImports } from "../babelPlugins/BabelTransformCssImports.js";
|
|
9
9
|
import { MakeBabelAddDevCacheBust } from "../babelPlugins/BabelAddDevCacheBust.js";
|
|
10
|
-
export function makeBabelUserDevConfig(projectDir, absCodeDir, absSourceDir, absStyleImportBase, buildLocation, buildCodeLocation, packagesCacheLocation, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises) {
|
|
10
|
+
export function makeBabelUserDevConfig(projectDir, absCodeDir, absSourceDir, absStyleImportBase, buildLocation, buildCodeLocation, packagesCacheLocation, skipPackageCompilationFiles, oldDependencyGraph, dependencyGraph, importAliases, promises, watchStyles = true) {
|
|
11
11
|
const userDevConfig = objectCopy(userCommonConfig);
|
|
12
12
|
userDevConfig.plugins.push(MakeBabelTransformPackageImports({
|
|
13
13
|
projectDir: projectDir,
|
|
@@ -29,7 +29,8 @@ export function makeBabelUserDevConfig(projectDir, absCodeDir, absSourceDir, abs
|
|
|
29
29
|
projectAbsSourceDir: absSourceDir,
|
|
30
30
|
projectAbsStyleImportDir: absStyleImportBase,
|
|
31
31
|
classNameFormat: '[folder]-[name]_[local]',
|
|
32
|
-
cssOutputFile: join(buildLocation, componentCssFolder, componentCssFile)
|
|
32
|
+
cssOutputFile: join(buildLocation, componentCssFolder, componentCssFile),
|
|
33
|
+
watch: watchStyles
|
|
33
34
|
}),
|
|
34
35
|
// Dev-only: keeps every relative import's browser-cached URL in sync with the
|
|
35
36
|
// imported file's own on-disk mtime - see BabelAddDevCacheBust.ts and
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TransformOptions } from '@babel/core';
|
|
2
|
-
export declare function makeBabelUserProdConfig(projectDir: string, absCodeDir: string, absSourceDir: string, absStyleImportBase: string): TransformOptions;
|
|
2
|
+
export declare function makeBabelUserProdConfig(projectDir: string, absCodeDir: string, absSourceDir: string, absStyleImportBase: string, watchStyles?: boolean): TransformOptions;
|
|
3
3
|
//# sourceMappingURL=makeBabelUserProdConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeBabelUserProdConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserProdConfig.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAMnD,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"makeBabelUserProdConfig.d.ts","sourceRoot":"","sources":["../../src/build/makeBabelUserProdConfig.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAMnD,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,EAC1B,WAAW,UAAO,GACnB,gBAAgB,CAgBlB"}
|
|
@@ -5,7 +5,7 @@ import { MakeBabelTransformComponentStyles } from "../babelPlugins/BabelTransfor
|
|
|
5
5
|
import { prodBuildFolder, componentCssFolder, componentCssFile } from "../settings.js";
|
|
6
6
|
import userCommonConfig from "./babel.user.common.config.js";
|
|
7
7
|
import { MakeBabelTransformCssImports } from "../babelPlugins/BabelTransformCssImports.js";
|
|
8
|
-
export function makeBabelUserProdConfig(projectDir, absCodeDir, absSourceDir, absStyleImportBase) {
|
|
8
|
+
export function makeBabelUserProdConfig(projectDir, absCodeDir, absSourceDir, absStyleImportBase, watchStyles = true) {
|
|
9
9
|
const userProdConfig = objectCopy(userCommonConfig);
|
|
10
10
|
userProdConfig.plugins.push(
|
|
11
11
|
// eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
@@ -18,7 +18,9 @@ export function makeBabelUserProdConfig(projectDir, absCodeDir, absSourceDir, ab
|
|
|
18
18
|
projectAbsSourceDir: absSourceDir,
|
|
19
19
|
projectAbsStyleImportDir: absStyleImportBase,
|
|
20
20
|
classNameFormat: '[folder]-[name]_[local]',
|
|
21
|
-
cssOutputFile: join(projectDir, prodBuildFolder, componentCssFolder, componentCssFile)
|
|
21
|
+
cssOutputFile: join(projectDir, prodBuildFolder, componentCssFolder, componentCssFile),
|
|
22
|
+
// should only need to pass one
|
|
23
|
+
watch: watchStyles
|
|
22
24
|
}));
|
|
23
25
|
return userProdConfig;
|
|
24
26
|
}
|
|
@@ -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":"AAcA,KAAK,YAAY,GAAG;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAA;AAeD,QAAA,MAAM,YAAY,EAAE,YAoBnB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -6,6 +6,7 @@ import terser from "@rollup/plugin-terser";
|
|
|
6
6
|
import jsonModule from "@rollup/plugin-json";
|
|
7
7
|
import { MakeBabelTransformRemoveServerBlocks } from "../babelPlugins/BabelTransformRemoveServerBlocks.js";
|
|
8
8
|
import { MakeBabelTransformRemoveDevBlocks } from "../babelPlugins/BabelTransformRemoveDevBlocks.js";
|
|
9
|
+
import { rollupExtractComponentStylesheets } from "./rollupExtractComponentStylesheets.js";
|
|
9
10
|
const json = typeof jsonModule === "function" ? jsonModule : jsonModule.default;
|
|
10
11
|
function replaceProductionNodeEnv() {
|
|
11
12
|
return {
|
|
@@ -22,7 +23,9 @@ function replaceProductionNodeEnv() {
|
|
|
22
23
|
const rollupConfig = {
|
|
23
24
|
plugins: [json(), nodeResolve(), commonjs(),
|
|
24
25
|
// must be before babel
|
|
25
|
-
replaceProductionNodeEnv(),
|
|
26
|
+
replaceProductionNodeEnv(),
|
|
27
|
+
// before babel, which excludes node_modules and so never sees framework components
|
|
28
|
+
rollupExtractComponentStylesheets(), babel({
|
|
26
29
|
babelHelpers: 'bundled',
|
|
27
30
|
exclude: '**/node_modules/**',
|
|
28
31
|
plugins: [MakeBabelTransformRemoveServerBlocks(), MakeBabelTransformRemoveDevBlocks()]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function rollupExtractComponentStylesheets(): {
|
|
2
|
+
name: string;
|
|
3
|
+
transform(code: string, id: string): {
|
|
4
|
+
code: string;
|
|
5
|
+
map: null;
|
|
6
|
+
} | null;
|
|
7
|
+
writeBundle(outputOptions: {
|
|
8
|
+
file?: string;
|
|
9
|
+
dir?: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=rollupExtractComponentStylesheets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollupExtractComponentStylesheets.d.ts","sourceRoot":"","sources":["../../src/build/rollupExtractComponentStylesheets.ts"],"names":[],"mappings":"AAYA,wBAAgB,iCAAiC;;oBAIzB,MAAM,MAAM,MAAM;;;;+BAgBD;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE;EAOvE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { dirname } from 'path';
|
|
2
|
+
import { recordFrameworkStylesheet, writeFrameworkCss } from "./frameworkStylesheets.js";
|
|
3
|
+
import { getPackageDirForFile } from "./getPackageDirForFile.js";
|
|
4
|
+
// `static $stylesheet = "i/….css"` as emitted by BabelTransformComponentStyles.
|
|
5
|
+
const markerPattern = /static\s+\$stylesheet\s*=\s*(["'])([^"']+)\1\s*;?/g;
|
|
6
|
+
// Prod bundles rather than walking packages, so the package-walk extraction never runs. This is
|
|
7
|
+
// its bundler-side counterpart: same read-and-erase, driven by rollup's module ids so a
|
|
8
|
+
// component's owning package is still known once everything is in one file.
|
|
9
|
+
export function rollupExtractComponentStylesheets() {
|
|
10
|
+
return {
|
|
11
|
+
name: 'tungsten-extract-component-stylesheets',
|
|
12
|
+
transform(code, id) {
|
|
13
|
+
if (!code.includes('$stylesheet')) return null;
|
|
14
|
+
let found = false;
|
|
15
|
+
const stripped = code.replace(markerPattern, (_match, _quote, rel) => {
|
|
16
|
+
const packageDir = getPackageDirForFile(id);
|
|
17
|
+
if (packageDir === undefined) return '';
|
|
18
|
+
recordFrameworkStylesheet(packageDir, rel);
|
|
19
|
+
found = true;
|
|
20
|
+
return '';
|
|
21
|
+
});
|
|
22
|
+
return found ? {
|
|
23
|
+
code: stripped,
|
|
24
|
+
map: null
|
|
25
|
+
} : null;
|
|
26
|
+
},
|
|
27
|
+
// The bundle is written to <build>/.bundle/<file>, so the build root is two up.
|
|
28
|
+
async writeBundle(outputOptions) {
|
|
29
|
+
const target = outputOptions.file ?? outputOptions.dir;
|
|
30
|
+
if (target === undefined) return;
|
|
31
|
+
const buildLocation = dirname(dirname(target));
|
|
32
|
+
await writeFrameworkCss(buildLocation);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
package/dist/compat/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from './types.js';
|
|
2
|
-
import { ConstructPackage, TungstenSimpleComponent } from '../Components.
|
|
2
|
+
import { ConstructPackage, TungstenSimpleComponent } from '../Components.jsx';
|
|
3
3
|
interface Context<T> {
|
|
4
4
|
Provider: typeof Provider<T>;
|
|
5
5
|
Consumer: typeof Consumer<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/compat/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,SAAS,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAA6B,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/compat/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,SAAS,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAA6B,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAwCxG,UAAU,OAAO,CAAC,CAAC;IACf,QAAQ,EAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7B,QAAQ,EAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,wBAAgB,aAAa,CAAC,CAAC,EAG3B,YAAY,EAAE,CAAC,GAChB,OAAO,CAAC,CAAC,CAAC,CAKZ;AAED,KAAK,aAAa,CAAC,CAAC,IAAI;IACpB,KAAK,EAAE,CAAC,CAAA;IACR,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACpC,CAAA;AAID,cAAM,QAAQ,CAAC,CAAC,CAAE,SAAQ,uBAAuB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAI/D,OAAO,kBAA4B;CACtC;AAGD,KAAK,aAAa,CAAC,CAAC,IAAI;IACpB,QAAQ,EAAE,CAAC,YAAY,EAAE,CAAC,KAAK,SAAS,CAAC;CAC5C,CAAA;AAID,cAAM,QAAQ,CAAC,CAAC,CAAE,SAAQ,uBAAuB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC/D,YAAY,EAAE,CAAC,CAAA;gBACH,GAAG,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;IAI9D,OAAO,kBAA+C;CACzD"}
|
package/dist/compat/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TungstenStatefulComponent } from 'tungsten/Components.jsx';
|
|
2
2
|
import { ContentNode, ContentNodeElement } from '../ContentNode.js';
|
|
3
|
-
export { ContentNode as ReactNode, ContentNodeElement as ReactElement };
|
|
3
|
+
export type { ContentNode as ReactNode, ContentNodeElement as ReactElement };
|
|
4
4
|
export type PropsWithChildren<P> = P & {
|
|
5
5
|
children?: ContentNode | undefined;
|
|
6
6
|
};
|