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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tungsten",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./dist/index.js",
|
|
12
12
|
"./compat": "./dist/compat/index.js",
|
|
13
|
+
"./library": "./dist/components/library/index.js",
|
|
13
14
|
"./react-zone": "./dist/zones/react.js",
|
|
14
15
|
"./testing": "./dist/testing/index.js",
|
|
15
16
|
"./*": "./dist/*",
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
20
|
"dist",
|
|
21
|
+
"!dist/**/*.sxyt.*",
|
|
20
22
|
"types",
|
|
21
23
|
"sxy-loader.config.js",
|
|
22
24
|
"readme.md"
|
|
@@ -28,7 +30,7 @@
|
|
|
28
30
|
"@babel/cli": "^7.28.6",
|
|
29
31
|
"@babel/core": "^7.29.0",
|
|
30
32
|
"@babel/parser": "^7.29.2",
|
|
31
|
-
"@babel/plugin-syntax-import-assertions": "^7.
|
|
33
|
+
"@babel/plugin-syntax-import-assertions": "^7.29.7",
|
|
32
34
|
"@babel/plugin-transform-class-properties": "^7.28.6",
|
|
33
35
|
"@babel/preset-react": "^7.28.5",
|
|
34
36
|
"@hono/node-server": "^1.19.11",
|
|
@@ -37,11 +39,11 @@
|
|
|
37
39
|
"@rollup/plugin-json": "^6.1.0",
|
|
38
40
|
"@rollup/plugin-node-resolve": "^14.1.0",
|
|
39
41
|
"@rollup/plugin-terser": "^1.0.0",
|
|
40
|
-
"arktype": "^2.2.
|
|
42
|
+
"arktype": "^2.2.3",
|
|
41
43
|
"babel-plugin-css-to-js": "^0.0.4",
|
|
42
44
|
"babel-plugin-sxy-module-resolver": "^4.1.9",
|
|
43
45
|
"babel-plugin-sxy-transform-cjs-to-esm": "^0.2.6",
|
|
44
|
-
"bcryptjs": "^
|
|
46
|
+
"bcryptjs": "^3.0.3",
|
|
45
47
|
"chalk": "^5.6.2",
|
|
46
48
|
"chalk-extensions": "^2.0.24",
|
|
47
49
|
"chokidar": "^3.6.0",
|
|
@@ -56,29 +58,29 @@
|
|
|
56
58
|
"find-package-json": "^1.2.0",
|
|
57
59
|
"fs-extra": "^10.1.0",
|
|
58
60
|
"globby": "^13.2.2",
|
|
59
|
-
"hono": "^4.12.
|
|
60
|
-
"import-meta-resolve": "^
|
|
61
|
+
"hono": "^4.12.32",
|
|
62
|
+
"import-meta-resolve": "^4.2.0",
|
|
61
63
|
"ini": "^4.1.3",
|
|
62
64
|
"lodash.clonedeep": "^4.5.0",
|
|
63
65
|
"npm-run-all": "^4.1.5",
|
|
64
66
|
"open": "^8.4.2",
|
|
65
|
-
"path-to-regexp": "^
|
|
66
|
-
"postcss": "^8.5.
|
|
67
|
+
"path-to-regexp": "^8.4.2",
|
|
68
|
+
"postcss": "^8.5.24",
|
|
67
69
|
"precinct": "^12.2.0",
|
|
68
70
|
"react-router": "^6.30.3",
|
|
69
71
|
"require-resolve-hook": "^1.1.0",
|
|
70
72
|
"rollup": "^2.80.0",
|
|
71
73
|
"rollup-plugin-gzip": "^3.1.2",
|
|
72
|
-
"sass": "^1.
|
|
74
|
+
"sass": "^1.102.0",
|
|
73
75
|
"serialize-javascript": "^6.0.2",
|
|
74
76
|
"slash": "^4.0.0",
|
|
75
77
|
"sxy-dependency-tree": "^8.1.11",
|
|
76
78
|
"sxy-filing-cabinet": "^3.4.2",
|
|
77
|
-
"sxy-lib": "^3.0.
|
|
79
|
+
"sxy-lib": "^3.0.5",
|
|
78
80
|
"sxy-lib-object-copy": "^2.0.5",
|
|
79
81
|
"sxy-loader": "^3.1.0",
|
|
80
82
|
"sxy-package-investigator": "^1.0.0",
|
|
81
|
-
"zod": "^4.3
|
|
83
|
+
"zod": "^4.4.3"
|
|
82
84
|
},
|
|
83
85
|
"devDependencies": {
|
|
84
86
|
"@babel/generator": "^7.29.1",
|
|
@@ -86,7 +88,6 @@
|
|
|
86
88
|
"@types/babel-types": "^7.0.16",
|
|
87
89
|
"@types/babel__core": "^7.20.5",
|
|
88
90
|
"@types/babel__generator": "^7.27.0",
|
|
89
|
-
"@types/bcryptjs": "^2.4.6",
|
|
90
91
|
"@types/chai": "^4.3.20",
|
|
91
92
|
"@types/cookie-parser": "^1.4.10",
|
|
92
93
|
"@types/express": "^4.17.25",
|
|
@@ -110,11 +111,11 @@
|
|
|
110
111
|
"eslint-import-resolver-typescript": "^2.7.1",
|
|
111
112
|
"eslint-plugin-import": "^2.32.0",
|
|
112
113
|
"eslint-plugin-no-type-assertion": "^1.3.0",
|
|
113
|
-
"happy-dom": "^20.
|
|
114
|
+
"happy-dom": "^20.11.1",
|
|
114
115
|
"prop-types": "^15.8.1",
|
|
115
116
|
"rimraf": "^5.0.10",
|
|
116
117
|
"rollup-plugin-visualizer": "^5.14.0",
|
|
117
|
-
"sxy-test-runner": "^2.
|
|
118
|
+
"sxy-test-runner": "^2.3.12",
|
|
118
119
|
"sxy-types": "^1.0.23",
|
|
119
120
|
"typescript": "^6.0.3"
|
|
120
121
|
},
|
|
@@ -135,14 +136,17 @@
|
|
|
135
136
|
"__build": "pnpm clean && pnpm build-prep && pnpm build-watch",
|
|
136
137
|
"build": "run-s -c clean build-prep build-watch",
|
|
137
138
|
"clean": "rimraf intermed dist",
|
|
138
|
-
"build-once": "rimraf intermed dist && pnpm build-ts-once && pnpm build-babel-once",
|
|
139
|
+
"build-once": "rimraf intermed dist && pnpm build-ts-once && pnpm build-babel-once && pnpm build-component-styles",
|
|
140
|
+
"build-component-styles": "node scripts/buildComponentStyles.mjs",
|
|
141
|
+
"build-once-nd": "rimraf intermed dist.building && pnpm build-ts-once && pnpm build-babel-staged && node scripts/syncDist.mjs && node scripts/writeBuildMarker.mjs",
|
|
139
142
|
"build-quick": "pnpm build-watch",
|
|
140
143
|
"build-prep": "pnpm build-ts-once",
|
|
141
144
|
"build-watch": "run-p build-ts build-babel",
|
|
142
145
|
"build-ts": "tsc --watch",
|
|
143
146
|
"build-ts-once": "tsc",
|
|
144
|
-
"build-babel": "
|
|
145
|
-
"build-babel-once": "babel intermed --out-dir dist --ignore \"**/*.cjs\" --copy-files --config-file ./babel.framework.config.js",
|
|
147
|
+
"build-babel": "node scripts/watchBabelAndMark.mjs",
|
|
148
|
+
"build-babel-once": "babel intermed --out-dir dist --ignore \"**/*.cjs\" --copy-files --config-file ./babel.framework.config.js && node scripts/writeBuildMarker.mjs",
|
|
149
|
+
"build-babel-staged": "babel intermed --out-dir dist.building --ignore \"**/*.cjs\" --copy-files --config-file ./babel.framework.config.js",
|
|
146
150
|
"test": "sxy-test-runner",
|
|
147
151
|
"test-once": "sxy-test-runner once"
|
|
148
152
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionComponentStandIn.sxyt.d.ts","sourceRoot":"","sources":["../src/FunctionComponentStandIn.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import { describe } from 'sxy-test-runner';
|
|
3
|
-
import { Instance } from "./Instance/Instance.js";
|
|
4
|
-
import { initStores } from "./Servers/initStores.js";
|
|
5
|
-
import { FunctionElement } from "./FunctionComponentStandIn.js";
|
|
6
|
-
describe('FunctionElement - client-side registration', ({
|
|
7
|
-
it
|
|
8
|
-
}) => {
|
|
9
|
-
it('registers itself on instance.registeredComponents when instance.isClient is true, even with no runtimeContext', () => {
|
|
10
|
-
// The real hydrate() entry point (hydrate.tsx) constructs its Instance with NO
|
|
11
|
-
// runtimeContext argument at all - only the test harness (testing/index.ts) passes one.
|
|
12
|
-
// isClient still ends up true there via Instance's own processIsClient fallback (see
|
|
13
|
-
// isClient.ts), so the registration gate has to key off instance.isClient, not
|
|
14
|
-
// "runtimeContext !== undefined" - the latter was always false in real hydration and
|
|
15
|
-
// meant nothing ever got registered outside of tests. See tungsten/docs/hmr.md.
|
|
16
|
-
//
|
|
17
|
-
// isClient.ts's own `typeof window !== 'undefined'` snapshot is itself notoriously
|
|
18
|
-
// order-dependent across a shared test process (see hydrate.sxyt.tsx's notes), so rather
|
|
19
|
-
// than depend on that snapshot landing correctly here, isClient is forced directly - this
|
|
20
|
-
// test is specifically about the registration gate's own logic, not about isClient
|
|
21
|
-
// detection (which is a separate, pre-existing concern).
|
|
22
|
-
const location = '/';
|
|
23
|
-
const globalData = {};
|
|
24
|
-
const matchedRouteInfo = {
|
|
25
|
-
key: null,
|
|
26
|
-
params: {},
|
|
27
|
-
content: null
|
|
28
|
-
};
|
|
29
|
-
const {
|
|
30
|
-
internalStore,
|
|
31
|
-
stores,
|
|
32
|
-
storeSubscriptions
|
|
33
|
-
} = initStores(location, null, globalData, matchedRouteInfo);
|
|
34
|
-
const instanceConfig = {
|
|
35
|
-
prod: false,
|
|
36
|
-
useRootComponent: true,
|
|
37
|
-
clientSideNav: false,
|
|
38
|
-
siteBasePath: '/',
|
|
39
|
-
staticSite: false
|
|
40
|
-
};
|
|
41
|
-
const emptyRoutes = {}; // eslint-disable-line no-type-assertion/no-type-assertion -- not exercised by this test
|
|
42
|
-
// deliberately no runtimeContext argument, matching hydrate()'s real call
|
|
43
|
-
const instance = new Instance(location, instanceConfig, null, emptyRoutes, emptyRoutes,
|
|
44
|
-
// eslint-disable-line no-type-assertion/no-type-assertion
|
|
45
|
-
internalStore, stores, storeSubscriptions, globalData, matchedRouteInfo);
|
|
46
|
-
const mutableInstance = instance; // eslint-disable-line no-type-assertion/no-type-assertion -- forcing isClient for this test, see comment above
|
|
47
|
-
mutableInstance.isClient = true;
|
|
48
|
-
const Greeting = () => null;
|
|
49
|
-
const element = new FunctionElement(Greeting, {}, undefined, undefined, instance, null);
|
|
50
|
-
expect(instance.registeredComponents).to.contain(element);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gotoRedirect.sxyt.d.ts","sourceRoot":"","sources":["../../src/Instance/gotoRedirect.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { expect } from 'chai';
|
|
3
|
-
// aliased: an unaliased `Window` would shadow the DOM Window type the
|
|
4
|
-
// runtime context is declared with
|
|
5
|
-
import { Window as HappyWindow } from 'happy-dom';
|
|
6
|
-
import { Instance } from "./Instance.js";
|
|
7
|
-
import { WebRedirect } from "../routing/WebRedirect.js";
|
|
8
|
-
import { RoutingRedirect } from "../routing/RoutingRedirect.js";
|
|
9
|
-
import { initStores } from "../Servers/initStores.js";
|
|
10
|
-
import { UpdateScheduler } from "../update/UpdateScheduler.js";
|
|
11
|
-
// A client-side Instance whose hard redirects are recorded rather than
|
|
12
|
-
// performed. Only the routing and redirect paths are exercised, so the rest of
|
|
13
|
-
// the runtime is left at its defaults.
|
|
14
|
-
const makeInstance = routes => {
|
|
15
|
-
const replaced = [];
|
|
16
|
-
const pushed = [];
|
|
17
|
-
const happyWindow = new HappyWindow();
|
|
18
|
-
// Only the two things goto() reaches for: a hard redirect leaves through
|
|
19
|
-
// location.replace, and an in-app navigation records history.
|
|
20
|
-
const fakeWindow = {
|
|
21
|
-
location: {
|
|
22
|
-
replace: url => {
|
|
23
|
-
replaced.push(url);
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
history: {
|
|
27
|
-
pushState: (_state, _title, url) => {
|
|
28
|
-
pushed.push(url);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const runtimeContext = {
|
|
33
|
-
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
34
|
-
document: happyWindow.document,
|
|
35
|
-
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
36
|
-
window: fakeWindow,
|
|
37
|
-
scheduler: new UpdateScheduler(),
|
|
38
|
-
navigation: false
|
|
39
|
-
};
|
|
40
|
-
const matchedRouteInfo = {
|
|
41
|
-
key: null,
|
|
42
|
-
params: {},
|
|
43
|
-
content: null
|
|
44
|
-
};
|
|
45
|
-
const globalData = {}; // eslint-disable-line no-type-assertion/no-type-assertion
|
|
46
|
-
const {
|
|
47
|
-
internalStore,
|
|
48
|
-
stores,
|
|
49
|
-
storeSubscriptions
|
|
50
|
-
} = initStores('/', null, globalData, matchedRouteInfo);
|
|
51
|
-
const config = {
|
|
52
|
-
prod: false,
|
|
53
|
-
useRootComponent: true,
|
|
54
|
-
clientSideNav: false,
|
|
55
|
-
siteBasePath: '/',
|
|
56
|
-
staticSite: false
|
|
57
|
-
};
|
|
58
|
-
const instance = new Instance('/', config, null,
|
|
59
|
-
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
60
|
-
routes, routes,
|
|
61
|
-
// eslint-disable-line no-type-assertion/no-type-assertion
|
|
62
|
-
internalStore, stores, storeSubscriptions, globalData, matchedRouteInfo, runtimeContext);
|
|
63
|
-
return {
|
|
64
|
-
instance,
|
|
65
|
-
replaced,
|
|
66
|
-
pushed
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
const legacyUrl = 'http://legacy.test/';
|
|
70
|
-
describe('Instance.goto() redirects', ({
|
|
71
|
-
it
|
|
72
|
-
}) => {
|
|
73
|
-
// A WebRedirect names a URL, not a route, so it has to leave the
|
|
74
|
-
// application. Client-side navigation used to throw here, which meant a
|
|
75
|
-
// session that expired between page load and a Link click hit an error
|
|
76
|
-
// instead of the log in page.
|
|
77
|
-
it('leaves the application for a WebRedirect returned by route data', async () => {
|
|
78
|
-
const {
|
|
79
|
-
instance,
|
|
80
|
-
replaced
|
|
81
|
-
} = makeInstance({
|
|
82
|
-
'/gone': {
|
|
83
|
-
content: null,
|
|
84
|
-
data: async () => new WebRedirect(legacyUrl)
|
|
85
|
-
},
|
|
86
|
-
'404': {
|
|
87
|
-
content: null
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
await instance.goto('/gone');
|
|
91
|
-
expect(replaced).to.deep.equal([legacyUrl]);
|
|
92
|
-
});
|
|
93
|
-
it('does not adopt the redirect as the current route', async () => {
|
|
94
|
-
const {
|
|
95
|
-
instance
|
|
96
|
-
} = makeInstance({
|
|
97
|
-
'/gone': {
|
|
98
|
-
content: null,
|
|
99
|
-
data: async () => new WebRedirect(legacyUrl)
|
|
100
|
-
},
|
|
101
|
-
'404': {
|
|
102
|
-
content: null
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
await instance.goto('/gone');
|
|
106
|
-
// it left the app; the route it was heading for never became current
|
|
107
|
-
expect(instance.matchedRouteInfo.key).to.not.equal('/gone');
|
|
108
|
-
});
|
|
109
|
-
it('still routes within the application for a RoutingRedirect', async () => {
|
|
110
|
-
const {
|
|
111
|
-
instance,
|
|
112
|
-
replaced
|
|
113
|
-
} = makeInstance({
|
|
114
|
-
'/old': {
|
|
115
|
-
content: null,
|
|
116
|
-
data: async () => new RoutingRedirect('/new')
|
|
117
|
-
},
|
|
118
|
-
'/new': {
|
|
119
|
-
content: null
|
|
120
|
-
},
|
|
121
|
-
'404': {
|
|
122
|
-
content: null
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
await instance.goto('/old');
|
|
126
|
-
expect(replaced).to.deep.equal([]);
|
|
127
|
-
expect(instance.matchedRouteInfo.key).to.equal('/new');
|
|
128
|
-
});
|
|
129
|
-
it('does not redirect for an ordinary data result', async () => {
|
|
130
|
-
const {
|
|
131
|
-
instance,
|
|
132
|
-
replaced
|
|
133
|
-
} = makeInstance({
|
|
134
|
-
'/ok': {
|
|
135
|
-
content: null,
|
|
136
|
-
data: async () => ({
|
|
137
|
-
value: 1
|
|
138
|
-
})
|
|
139
|
-
},
|
|
140
|
-
'404': {
|
|
141
|
-
content: null
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
await instance.goto('/ok');
|
|
145
|
-
expect(replaced).to.deep.equal([]);
|
|
146
|
-
expect(instance.matchedRouteInfo.key).to.equal('/ok');
|
|
147
|
-
});
|
|
148
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runTrackedWork.sxyt.d.ts","sourceRoot":"","sources":["../../src/Instance/runTrackedWork.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import { describe } from 'sxy-test-runner';
|
|
3
|
-
import { runTrackedWork } from "./Instance.js";
|
|
4
|
-
describe('runTrackedWork() (no-scheduler tracked work fallback)', ({
|
|
5
|
-
it
|
|
6
|
-
}) => {
|
|
7
|
-
it('reports a synchronous throw with its description', () => {
|
|
8
|
-
const reports = [];
|
|
9
|
-
runTrackedWork(() => {
|
|
10
|
-
throw new Error('sync fail');
|
|
11
|
-
}, 'Comp componentDidUpdate lifecycle', (error, description) => reports.push([error, description]));
|
|
12
|
-
expect(reports).to.have.length(1);
|
|
13
|
-
expect((reports[0]?.[0]).message).to.equal('sync fail');
|
|
14
|
-
expect(reports[0]?.[1]).to.equal('Comp componentDidUpdate lifecycle');
|
|
15
|
-
});
|
|
16
|
-
it('reports an async rejection instead of leaving it unhandled', async () => {
|
|
17
|
-
const reports = [];
|
|
18
|
-
runTrackedWork(async () => {
|
|
19
|
-
await Promise.resolve();
|
|
20
|
-
throw new Error('async fail');
|
|
21
|
-
}, 'Comp componentDidUpdate lifecycle', (error, description) => reports.push([error, description]));
|
|
22
|
-
await new Promise(resolve => setTimeout(resolve, 0));
|
|
23
|
-
expect(reports).to.have.length(1);
|
|
24
|
-
expect((reports[0]?.[0]).message).to.equal('async fail');
|
|
25
|
-
expect(reports[0]?.[1]).to.equal('Comp componentDidUpdate lifecycle');
|
|
26
|
-
});
|
|
27
|
-
it('reports nothing for successful sync and async work', async () => {
|
|
28
|
-
const reports = [];
|
|
29
|
-
const report = error => reports.push(error);
|
|
30
|
-
runTrackedWork(() => 'ok', 'sync work', report);
|
|
31
|
-
runTrackedWork(async () => 'ok', 'async work', report);
|
|
32
|
-
await new Promise(resolve => setTimeout(resolve, 0));
|
|
33
|
-
expect(reports).to.have.length(0);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"devErrorPageAutoRetry.sxyt.d.ts","sourceRoot":"","sources":["../../src/Servers/devErrorPageAutoRetry.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import { describe } from 'sxy-test-runner';
|
|
3
|
-
import { devErrorPageAutoRetryScript, devErrorPageClearRetryScript, maxAutoRetryAttempts } from "./devErrorPageAutoRetry.js";
|
|
4
|
-
describe('devErrorPageAutoRetryScript()', ({
|
|
5
|
-
it
|
|
6
|
-
}) => {
|
|
7
|
-
it('returns a script that reloads the page for a transient module-shape error', () => {
|
|
8
|
-
const error = new SyntaxError(`The requested module './Button.js' does not provide an export named 'Button'`);
|
|
9
|
-
const script = devErrorPageAutoRetryScript(error);
|
|
10
|
-
expect(script).to.contain('sessionStorage');
|
|
11
|
-
expect(script).to.contain('location.reload()');
|
|
12
|
-
expect(script).to.contain(String(maxAutoRetryAttempts));
|
|
13
|
-
});
|
|
14
|
-
it('returns nothing for a genuine, unrelated error - so a real bug does not silently auto-reload forever', () => {
|
|
15
|
-
const error = new Error('something else broke entirely');
|
|
16
|
-
expect(devErrorPageAutoRetryScript(error)).to.equal('');
|
|
17
|
-
});
|
|
18
|
-
it('returns nothing for a non-Error thrown value', () => {
|
|
19
|
-
expect(devErrorPageAutoRetryScript('a plain string was thrown')).to.equal('');
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
describe('devErrorPageClearRetryScript', ({
|
|
23
|
-
it
|
|
24
|
-
}) => {
|
|
25
|
-
it('clears the same sessionStorage key the retry script writes to', () => {
|
|
26
|
-
const error = new SyntaxError(`does not provide an export named 'X'`);
|
|
27
|
-
const retryScript = devErrorPageAutoRetryScript(error);
|
|
28
|
-
const keyMatch = retryScript.match(/var key='([^']+)'/);
|
|
29
|
-
expect(keyMatch).to.not.equal(null);
|
|
30
|
-
expect(devErrorPageClearRetryScript).to.contain(keyMatch[1]);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
describe('devErrorPageAutoRetryScript() - executed in a sandbox', ({
|
|
34
|
-
it
|
|
35
|
-
}) => {
|
|
36
|
-
function run(script, sessionStorage) {
|
|
37
|
-
let reloaded = false;
|
|
38
|
-
let threw = null;
|
|
39
|
-
const location = {
|
|
40
|
-
reload: () => {
|
|
41
|
-
reloaded = true;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const fakeSetTimeout = fn => fn(); // run "immediately" for the test
|
|
45
|
-
try {
|
|
46
|
-
// eslint-disable-next-line no-new-func -- executing the generated dev-page script is exactly what's under test
|
|
47
|
-
const fn = new Function('sessionStorage', 'location', 'setTimeout', 'console', script);
|
|
48
|
-
fn(sessionStorage, location, fakeSetTimeout, console);
|
|
49
|
-
} catch (e) {
|
|
50
|
-
threw = e;
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
reloaded,
|
|
54
|
-
threw
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
it('reloads once when sessionStorage works normally', () => {
|
|
58
|
-
const store = new Map();
|
|
59
|
-
const sessionStorage = {
|
|
60
|
-
getItem: k => store.get(k) ?? null,
|
|
61
|
-
setItem: (k, v) => {
|
|
62
|
-
store.set(k, v);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const script = devErrorPageAutoRetryScript(new SyntaxError(`does not provide an export named 'X'`));
|
|
66
|
-
const {
|
|
67
|
-
reloaded,
|
|
68
|
-
threw
|
|
69
|
-
} = run(script, sessionStorage);
|
|
70
|
-
expect(threw).to.equal(null);
|
|
71
|
-
expect(reloaded).to.equal(true);
|
|
72
|
-
});
|
|
73
|
-
it('does not reload (and does not throw) once the attempt cap is reached', () => {
|
|
74
|
-
const store = new Map([['tungstenDevErrorRetryCount', String(maxAutoRetryAttempts)]]);
|
|
75
|
-
const sessionStorage = {
|
|
76
|
-
getItem: k => store.get(k) ?? null,
|
|
77
|
-
setItem: (k, v) => {
|
|
78
|
-
store.set(k, v);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const script = devErrorPageAutoRetryScript(new SyntaxError(`does not provide an export named 'X'`));
|
|
82
|
-
const {
|
|
83
|
-
reloaded,
|
|
84
|
-
threw
|
|
85
|
-
} = run(script, sessionStorage);
|
|
86
|
-
expect(threw).to.equal(null);
|
|
87
|
-
expect(reloaded).to.equal(false);
|
|
88
|
-
});
|
|
89
|
-
it('degrades safely (no throw, no reload) when sessionStorage itself is blocked - e.g. some private-browsing modes', () => {
|
|
90
|
-
const sessionStorage = {
|
|
91
|
-
getItem: () => {
|
|
92
|
-
throw new Error('SecurityError: sessionStorage is not available');
|
|
93
|
-
},
|
|
94
|
-
setItem: () => {
|
|
95
|
-
throw new Error('SecurityError: sessionStorage is not available');
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const script = devErrorPageAutoRetryScript(new SyntaxError(`does not provide an export named 'X'`));
|
|
99
|
-
const {
|
|
100
|
-
reloaded,
|
|
101
|
-
threw
|
|
102
|
-
} = run(script, sessionStorage);
|
|
103
|
-
expect(threw).to.equal(null);
|
|
104
|
-
expect(reloaded).to.equal(false);
|
|
105
|
-
});
|
|
106
|
-
it('devErrorPageClearRetryScript also degrades safely when sessionStorage is blocked', () => {
|
|
107
|
-
const sessionStorage = {
|
|
108
|
-
removeItem: () => {
|
|
109
|
-
throw new Error('SecurityError: sessionStorage is not available');
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const {
|
|
113
|
-
threw
|
|
114
|
-
} = run(devErrorPageClearRetryScript, sessionStorage);
|
|
115
|
-
expect(threw).to.equal(null);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cjsHelpers.sxyt.d.ts","sourceRoot":"","sources":["../../src/_client/cjsHelpers.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import { describe } from 'sxy-test-runner';
|
|
3
|
-
import { mkdtemp, rm, writeFile } from 'fs/promises';
|
|
4
|
-
import { tmpdir } from 'os';
|
|
5
|
-
import { join } from 'path';
|
|
6
|
-
import { pathToFileURL } from 'url';
|
|
7
|
-
// cjsHelpers is browser code - it installs a `process` shim and a window global as soon as
|
|
8
|
-
// it is imported. Stub the window it expects and put node's own process back afterwards.
|
|
9
|
-
const nodeProcess = Reflect.get(globalThis, 'process');
|
|
10
|
-
Reflect.set(globalThis, 'window', {});
|
|
11
|
-
const {
|
|
12
|
-
loadDeps
|
|
13
|
-
} = await import("./cjsHelpers.js");
|
|
14
|
-
Reflect.set(globalThis, 'process', nodeProcess);
|
|
15
|
-
// a converted CJS module exports its factory as the default and its dependencies as `deps`
|
|
16
|
-
function moduleSource(deps) {
|
|
17
|
-
return `export const deps = ${JSON.stringify(deps)}\n` + 'export default function (module) { module.exports = {} }\n';
|
|
18
|
-
}
|
|
19
|
-
describe('_client/cjsHelpers loadDeps()', ({
|
|
20
|
-
it
|
|
21
|
-
}) => {
|
|
22
|
-
it(`loads a dependency cycle instead of hanging`, async () => {
|
|
23
|
-
const dir = await mkdtemp(join(tmpdir(), 'tungsten-load-deps-'));
|
|
24
|
-
try {
|
|
25
|
-
// .mjs so that node does not have to guess the module type of a file in a
|
|
26
|
-
// temp dir with no package.json
|
|
27
|
-
const a = pathToFileURL(join(dir, 'a.mjs')).href;
|
|
28
|
-
const b = pathToFileURL(join(dir, 'b.mjs')).href;
|
|
29
|
-
const c = pathToFileURL(join(dir, 'c.mjs')).href;
|
|
30
|
-
// a <-> b is circular, and both reach c
|
|
31
|
-
await writeFile(join(dir, 'a.mjs'), moduleSource([b, c]));
|
|
32
|
-
await writeFile(join(dir, 'b.mjs'), moduleSource([a, c]));
|
|
33
|
-
await writeFile(join(dir, 'c.mjs'), moduleSource([]));
|
|
34
|
-
const timeout = new Promise(resolve => setTimeout(() => resolve('timed out'), 5000).unref());
|
|
35
|
-
const loaded = await Promise.race([loadDeps([a]), timeout]);
|
|
36
|
-
expect(loaded).not.to.equal('timed out');
|
|
37
|
-
expect(Object.keys(loaded).sort()).to.deep.equal([a, b, c].sort());
|
|
38
|
-
} finally {
|
|
39
|
-
await rm(dir, {
|
|
40
|
-
recursive: true,
|
|
41
|
-
force: true
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"passwordHashing.sxyt.d.ts","sourceRoot":"","sources":["../../src/auth/passwordHashing.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { expect } from 'chai';
|
|
3
|
-
import { hashPassword, hashPasswordBytes } from "./hashPassword.js";
|
|
4
|
-
import { checkPassword, checkPasswordBytes } from "./checkPassword.js";
|
|
5
|
-
describe('hashPassword()', ({
|
|
6
|
-
it
|
|
7
|
-
}) => {
|
|
8
|
-
it('hashes a password and returns a string', async () => {
|
|
9
|
-
const hashed = await hashPassword('abcd');
|
|
10
|
-
//console.log('hashed: ' + hashed)
|
|
11
|
-
expect(hashed).to.be.a('string');
|
|
12
|
-
expect(hashed.length).to.be.at.least(10);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
describe('hashPasswordBytes()', ({
|
|
16
|
-
it
|
|
17
|
-
}) => {
|
|
18
|
-
it('hashes a password and returns an array of bytes', async () => {
|
|
19
|
-
const hashedBytes = await hashPasswordBytes('abcd');
|
|
20
|
-
expect(hashedBytes).to.be.an.instanceOf(Buffer);
|
|
21
|
-
const hashedString = hashedBytes.toString();
|
|
22
|
-
//console.log('hashedString: ' + hashedString)
|
|
23
|
-
expect(hashedString).to.be.a('string');
|
|
24
|
-
expect(hashedString.length).to.be.at.least(10);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
describe('checkPassword()', ({
|
|
28
|
-
it
|
|
29
|
-
}) => {
|
|
30
|
-
it('It states whether a password matches the input', async () => {
|
|
31
|
-
const password = 'xyz';
|
|
32
|
-
const hashed = await hashPassword(password);
|
|
33
|
-
expect(await checkPassword(password, hashed)).to.equal(true);
|
|
34
|
-
expect(await checkPassword(password + 'NotOurPassword', hashed)).to.equal(false);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
describe('checkPasswordBytes()', ({
|
|
38
|
-
it
|
|
39
|
-
}) => {
|
|
40
|
-
it('It states whether a password matches the input', async () => {
|
|
41
|
-
const password = 'xyz';
|
|
42
|
-
const hashed = await hashPasswordBytes(password);
|
|
43
|
-
expect(await checkPasswordBytes(password, hashed)).to.equal(true);
|
|
44
|
-
expect(await checkPasswordBytes(password + 'NotOurPassword', hashed)).to.equal(false);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkPasswordResetToken.sxyt.d.ts","sourceRoot":"","sources":["../../../src/auth/ref/checkPasswordResetToken.sxyt.js"],"names":[],"mappings":""}
|