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
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
-
import { describe } from 'sxy-test-runner';
|
|
5
|
-
import { expect } from 'chai';
|
|
6
|
-
import { proxyObjectContent, getStateProxyHandler, $original, $ownerName } from "./componentProxyHandlers.js";
|
|
7
|
-
class FakeComponent {
|
|
8
|
-
constructor() {
|
|
9
|
-
_defineProperty(this, "__initialized", true);
|
|
10
|
-
_defineProperty(this, "updates", 0);
|
|
11
|
-
}
|
|
12
|
-
__stateUpdated() {
|
|
13
|
-
this.updates++;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
class ParentComp extends FakeComponent {}
|
|
17
|
-
class ChildComp extends FakeComponent {}
|
|
18
|
-
// proxyObjectContent proxies a state object's contents in place, the same entry point
|
|
19
|
-
// Components.__init uses, so state.<key> afterwards is a state-object proxy
|
|
20
|
-
function makeState(element, state) {
|
|
21
|
-
proxyObjectContent(element, state);
|
|
22
|
-
return state;
|
|
23
|
-
}
|
|
24
|
-
describe('componentProxyHandlers state adoption', ({
|
|
25
|
-
it
|
|
26
|
-
}) => {
|
|
27
|
-
it('exposes $original and $ownerName on state object proxies', () => {
|
|
28
|
-
const parent = new ParentComp();
|
|
29
|
-
const state = makeState(parent, {
|
|
30
|
-
data: {
|
|
31
|
-
x: 1
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
expect(state.data[$ownerName]).to.equal('ParentComp');
|
|
35
|
-
expect(state.data[$original]).to.deep.equal({
|
|
36
|
-
x: 1
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
it('adopts an object owned by another component as a copy instead of throwing', () => {
|
|
40
|
-
const parent = new ParentComp();
|
|
41
|
-
const parentState = makeState(parent, {
|
|
42
|
-
data: {
|
|
43
|
-
x: 1,
|
|
44
|
-
nested: {
|
|
45
|
-
y: 2
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
const child = new ChildComp();
|
|
50
|
-
const childState = makeState(child, {
|
|
51
|
-
data: parentState.data
|
|
52
|
-
});
|
|
53
|
-
expect(childState.data).to.not.equal(parentState.data);
|
|
54
|
-
expect(childState.data.x).to.equal(1);
|
|
55
|
-
expect(childState.data.nested.y).to.equal(2);
|
|
56
|
-
// the two components must not alias, at any depth
|
|
57
|
-
childState.data.x = 99;
|
|
58
|
-
childState.data.nested.y = 55;
|
|
59
|
-
expect(parentState.data.x).to.equal(1);
|
|
60
|
-
expect(parentState.data.nested.y).to.equal(2);
|
|
61
|
-
expect(parent.updates).to.equal(0);
|
|
62
|
-
expect(child.updates).to.be.greaterThan(0);
|
|
63
|
-
});
|
|
64
|
-
it('adopts via the top-level state set trap too', () => {
|
|
65
|
-
const parent = new ParentComp();
|
|
66
|
-
const parentState = makeState(parent, {
|
|
67
|
-
list: [1, {
|
|
68
|
-
deep: true
|
|
69
|
-
}]
|
|
70
|
-
});
|
|
71
|
-
const child = new ChildComp();
|
|
72
|
-
const childStateTarget = {
|
|
73
|
-
list: undefined
|
|
74
|
-
};
|
|
75
|
-
const childState = new Proxy(childStateTarget, getStateProxyHandler(child));
|
|
76
|
-
childState.list = parentState.list;
|
|
77
|
-
expect(childState.list).to.not.equal(parentState.list);
|
|
78
|
-
childState.list.push(2);
|
|
79
|
-
expect(childState.list.length).to.equal(3);
|
|
80
|
-
expect(parentState.list.length).to.equal(2);
|
|
81
|
-
});
|
|
82
|
-
it('preserves shared references within one state tree', () => {
|
|
83
|
-
const el = new ParentComp();
|
|
84
|
-
const shared = {
|
|
85
|
-
v: 1
|
|
86
|
-
};
|
|
87
|
-
const state = makeState(el, {
|
|
88
|
-
a: shared,
|
|
89
|
-
b: shared
|
|
90
|
-
});
|
|
91
|
-
expect(state.a).to.equal(state.b);
|
|
92
|
-
state.a.v = 2;
|
|
93
|
-
expect(state.b.v).to.equal(2);
|
|
94
|
-
});
|
|
95
|
-
it('terminates on self-referencing objects', () => {
|
|
96
|
-
const el = new ParentComp();
|
|
97
|
-
const cyc = {
|
|
98
|
-
n: 1
|
|
99
|
-
};
|
|
100
|
-
cyc.self = cyc;
|
|
101
|
-
const state = makeState(el, {
|
|
102
|
-
cyc
|
|
103
|
-
});
|
|
104
|
-
expect(state.cyc.self).to.equal(state.cyc);
|
|
105
|
-
expect(state.cyc.self.self.n).to.equal(1);
|
|
106
|
-
});
|
|
107
|
-
it('adopts Maps and Sets as copies', () => {
|
|
108
|
-
const parent = new ParentComp();
|
|
109
|
-
const parentState = makeState(parent, {
|
|
110
|
-
m: new Map([['k', 1]]),
|
|
111
|
-
s: new Set([1, 2])
|
|
112
|
-
});
|
|
113
|
-
const child = new ChildComp();
|
|
114
|
-
const childState = makeState(child, {
|
|
115
|
-
m: parentState.m,
|
|
116
|
-
s: parentState.s
|
|
117
|
-
});
|
|
118
|
-
childState.m.set('k', 2);
|
|
119
|
-
childState.s.add(3);
|
|
120
|
-
expect(parentState.m.get('k')).to.equal(1);
|
|
121
|
-
expect(parentState.s.has(3)).to.equal(false);
|
|
122
|
-
});
|
|
123
|
-
it('assigns a Map set into top-level state (missing assignment fix)', () => {
|
|
124
|
-
const el = new ParentComp();
|
|
125
|
-
const state = new Proxy({}, getStateProxyHandler(el));
|
|
126
|
-
state.m = new Map([['k', 1]]);
|
|
127
|
-
expect(state.m).to.not.equal(undefined);
|
|
128
|
-
expect(state.m.get('k')).to.equal(1);
|
|
129
|
-
});
|
|
130
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RawHtml.sxyt.d.ts","sourceRoot":"","sources":["../../src/components/RawHtml.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import { Window } from 'happy-dom';
|
|
3
|
-
import { describe } from 'sxy-test-runner';
|
|
4
|
-
import { RawHtml } from "./RawHtml.js";
|
|
5
|
-
import { createTestApp } from "../testing/index.js";
|
|
6
|
-
// Mounts RawHtml and returns the markup it actually put in the page. The parser
|
|
7
|
-
// itself is covered in rawHtml/parseHtml.sxyt.ts; what is under test here is
|
|
8
|
-
// that the component hands its props to the parser correctly.
|
|
9
|
-
const mount = async props => {
|
|
10
|
-
const window = new Window();
|
|
11
|
-
const testApp = await createTestApp(RawHtml, {
|
|
12
|
-
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
13
|
-
document: window.document,
|
|
14
|
-
props
|
|
15
|
-
});
|
|
16
|
-
try {
|
|
17
|
-
return {
|
|
18
|
-
html: testApp.container.innerHTML,
|
|
19
|
-
text: testApp.container.textContent,
|
|
20
|
-
elements: testApp.container.querySelectorAll('*').length
|
|
21
|
-
};
|
|
22
|
-
} finally {
|
|
23
|
-
await testApp.unmount();
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const render = async props => (await mount(props)).html;
|
|
27
|
-
describe('RawHtml', ({
|
|
28
|
-
it
|
|
29
|
-
}) => {
|
|
30
|
-
it('renders parsed markup as real elements', async () => {
|
|
31
|
-
const html = await render({
|
|
32
|
-
html: '<p>Bonuses for <strong>this month</strong>.</p>'
|
|
33
|
-
});
|
|
34
|
-
expect(html).to.contain('<p>');
|
|
35
|
-
expect(html).to.contain('<strong>this month</strong>');
|
|
36
|
-
});
|
|
37
|
-
it('renders nothing for empty markup', async () => {
|
|
38
|
-
// a component always leaves its delimiter comments behind, so the check
|
|
39
|
-
// is that it contributed no content, not that the container is empty
|
|
40
|
-
const {
|
|
41
|
-
text,
|
|
42
|
-
elements
|
|
43
|
-
} = await mount({
|
|
44
|
-
html: ''
|
|
45
|
-
});
|
|
46
|
-
expect(text).to.equal('');
|
|
47
|
-
expect(elements).to.equal(0);
|
|
48
|
-
});
|
|
49
|
-
it('drops scripts by default', async () => {
|
|
50
|
-
const html = await render({
|
|
51
|
-
html: '<p>a</p><script>alert(1)</script>'
|
|
52
|
-
});
|
|
53
|
-
expect(html).to.contain('<p>a</p>');
|
|
54
|
-
expect(html).to.not.contain('script');
|
|
55
|
-
expect(html).to.not.contain('alert');
|
|
56
|
-
});
|
|
57
|
-
it('keeps scripts when sanitizing is turned off', async () => {
|
|
58
|
-
expect(await render({
|
|
59
|
-
html: '<div><script>x()</script></div>',
|
|
60
|
-
sanitize: false
|
|
61
|
-
})).to.contain('<script>x()</script>');
|
|
62
|
-
});
|
|
63
|
-
// `safe` is the shortcut for Tungsten's built-in allow list
|
|
64
|
-
it('applies the built-in allow list when safe is set', async () => {
|
|
65
|
-
const html = await render({
|
|
66
|
-
html: '<p style="position:fixed">a</p><iframe src="//evil"></iframe>',
|
|
67
|
-
safe: true
|
|
68
|
-
});
|
|
69
|
-
expect(html).to.contain('a');
|
|
70
|
-
expect(html).to.not.contain('iframe');
|
|
71
|
-
// the safe list excludes style, which can disguise a page without script
|
|
72
|
-
expect(html).to.not.contain('position:fixed');
|
|
73
|
-
});
|
|
74
|
-
it('does not apply an allow list unless asked', async () => {
|
|
75
|
-
const html = await render({
|
|
76
|
-
html: '<p style="position:fixed">a</p>'
|
|
77
|
-
});
|
|
78
|
-
expect(html).to.contain('position:fixed');
|
|
79
|
-
});
|
|
80
|
-
it('lets an explicit allowList win over safe', async () => {
|
|
81
|
-
const onlyEmphasis = {
|
|
82
|
-
tags: ['em'],
|
|
83
|
-
attributes: []
|
|
84
|
-
};
|
|
85
|
-
// <strong> is on the safe list but not on this one, so if allowList is
|
|
86
|
-
// being applied it is unwrapped; if safe won, it would survive
|
|
87
|
-
const html = await render({
|
|
88
|
-
html: '<em>keep</em><strong>unwrap</strong>',
|
|
89
|
-
safe: true,
|
|
90
|
-
allowList: onlyEmphasis
|
|
91
|
-
});
|
|
92
|
-
expect(html).to.contain('<em>keep</em>');
|
|
93
|
-
expect(html).to.not.contain('<strong>');
|
|
94
|
-
expect(html).to.contain('unwrap');
|
|
95
|
-
});
|
|
96
|
-
it('renders whatever it is given without throwing', async () => {
|
|
97
|
-
const malformed = ['<p>unclosed', '</p>stray', '<p class="unterminated>x', '<<>>', '<!-- open'];
|
|
98
|
-
for (const html of malformed) {
|
|
99
|
-
expect(await render({
|
|
100
|
-
html
|
|
101
|
-
})).to.be.a('string');
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BindableSelect.sxyt.d.ts","sourceRoot":"","sources":["../../../src/components/bindable/BindableSelect.sxyt.tsx"],"names":[],"mappings":""}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
-
import { expect } from 'chai';
|
|
5
|
-
import { Window } from 'happy-dom';
|
|
6
|
-
import { describe } from 'sxy-test-runner';
|
|
7
|
-
import { TungstenStatefulComponent } from "../../Components.js";
|
|
8
|
-
import { createTestApp } from "../../testing/index.js";
|
|
9
|
-
import { BindableSelect } from "./BindableSelect.js";
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "tungsten/jsxRuntime.js";
|
|
11
|
-
const optionTexts = container => [...container.querySelectorAll('option')].map(option => option.textContent);
|
|
12
|
-
describe('BindableSelect', ({
|
|
13
|
-
it
|
|
14
|
-
}) => {
|
|
15
|
-
it('renders children when no options prop is given', async () => {
|
|
16
|
-
const window = new Window();
|
|
17
|
-
const document = window.document;
|
|
18
|
-
class Root extends TungstenStatefulComponent {
|
|
19
|
-
constructor(...args) {
|
|
20
|
-
super(...args);
|
|
21
|
-
_defineProperty(this, "state", {
|
|
22
|
-
choice: 'b'
|
|
23
|
-
});
|
|
24
|
-
_defineProperty(this, "content", () => _jsxs(BindableSelect, {
|
|
25
|
-
bind: [this.state, 'choice'],
|
|
26
|
-
children: [_jsx("option", {
|
|
27
|
-
value: "a",
|
|
28
|
-
children: "A"
|
|
29
|
-
}), _jsx("option", {
|
|
30
|
-
value: "b",
|
|
31
|
-
children: "B"
|
|
32
|
-
})]
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
const testApp = await createTestApp(Root, {
|
|
37
|
-
document
|
|
38
|
-
});
|
|
39
|
-
expect(optionTexts(testApp.container)).to.deep.equal(['A', 'B']);
|
|
40
|
-
await testApp.unmount();
|
|
41
|
-
});
|
|
42
|
-
// placeholder must behave exactly as it does on a plain <select>: it reaches the element as an
|
|
43
|
-
// attribute and HTML ignores it. It deliberately does NOT synthesize a placeholder option —
|
|
44
|
-
// that would make BindableSelect diverge from the plain element.
|
|
45
|
-
it('passes placeholder to the element like a plain select, adding no option', async () => {
|
|
46
|
-
const window = new Window();
|
|
47
|
-
const document = window.document;
|
|
48
|
-
class Root extends TungstenStatefulComponent {
|
|
49
|
-
constructor(...args) {
|
|
50
|
-
super(...args);
|
|
51
|
-
_defineProperty(this, "state", {
|
|
52
|
-
choice: ''
|
|
53
|
-
});
|
|
54
|
-
_defineProperty(this, "content", () => _jsxs("main", {
|
|
55
|
-
children: [_jsx(BindableSelect, {
|
|
56
|
-
placeholder: "Pick one",
|
|
57
|
-
options: [{
|
|
58
|
-
value: 'a',
|
|
59
|
-
text: 'A'
|
|
60
|
-
}, {
|
|
61
|
-
value: 'b',
|
|
62
|
-
text: 'B'
|
|
63
|
-
}],
|
|
64
|
-
bind: [this.state, 'choice']
|
|
65
|
-
}), _jsxs("select", {
|
|
66
|
-
placeholder: "Pick one",
|
|
67
|
-
bind: [this.state, 'choice'],
|
|
68
|
-
children: [_jsx("option", {
|
|
69
|
-
value: "a",
|
|
70
|
-
children: "A"
|
|
71
|
-
}), _jsx("option", {
|
|
72
|
-
value: "b",
|
|
73
|
-
children: "B"
|
|
74
|
-
})]
|
|
75
|
-
})]
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const testApp = await createTestApp(Root, {
|
|
80
|
-
document
|
|
81
|
-
});
|
|
82
|
-
const [bindable, plain] = [...testApp.container.querySelectorAll('select')];
|
|
83
|
-
expect(bindable?.getAttribute('placeholder')).to.equal('Pick one');
|
|
84
|
-
expect(bindable?.querySelectorAll('option').length).to.equal(2);
|
|
85
|
-
// parity with the plain element it stands in for
|
|
86
|
-
expect(bindable?.getAttribute('placeholder')).to.equal(plain?.getAttribute('placeholder'));
|
|
87
|
-
expect(bindable?.innerHTML).to.equal(plain?.innerHTML);
|
|
88
|
-
await testApp.unmount();
|
|
89
|
-
});
|
|
90
|
-
// text is ContentNode, not string — existing string call sites are unaffected (widening).
|
|
91
|
-
it('accepts JSX as an option text as well as a plain string', async () => {
|
|
92
|
-
const window = new Window();
|
|
93
|
-
const document = window.document;
|
|
94
|
-
class Root extends TungstenStatefulComponent {
|
|
95
|
-
constructor(...args) {
|
|
96
|
-
super(...args);
|
|
97
|
-
_defineProperty(this, "state", {
|
|
98
|
-
choice: 'a'
|
|
99
|
-
});
|
|
100
|
-
_defineProperty(this, "content", () => _jsx(BindableSelect, {
|
|
101
|
-
options: [{
|
|
102
|
-
value: 'a',
|
|
103
|
-
text: 'Plain'
|
|
104
|
-
}, {
|
|
105
|
-
value: 'b',
|
|
106
|
-
text: _jsx("em", {
|
|
107
|
-
children: "Rich"
|
|
108
|
-
})
|
|
109
|
-
}, {
|
|
110
|
-
value: 'c',
|
|
111
|
-
text: 3
|
|
112
|
-
}],
|
|
113
|
-
bind: [this.state, 'choice']
|
|
114
|
-
}));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
const testApp = await createTestApp(Root, {
|
|
118
|
-
document
|
|
119
|
-
});
|
|
120
|
-
expect(optionTexts(testApp.container)).to.deep.equal(['Plain', 'Rich', '3']);
|
|
121
|
-
expect(testApp.container.querySelector('option em')).not.to.equal(null);
|
|
122
|
-
await testApp.unmount();
|
|
123
|
-
});
|
|
124
|
-
it('renders options then children when both are given', async () => {
|
|
125
|
-
const window = new Window();
|
|
126
|
-
const document = window.document;
|
|
127
|
-
class Root extends TungstenStatefulComponent {
|
|
128
|
-
constructor(...args) {
|
|
129
|
-
super(...args);
|
|
130
|
-
_defineProperty(this, "state", {
|
|
131
|
-
choice: 'a'
|
|
132
|
-
});
|
|
133
|
-
_defineProperty(this, "content", () => _jsx(BindableSelect, {
|
|
134
|
-
options: [{
|
|
135
|
-
value: 'a',
|
|
136
|
-
text: 'A'
|
|
137
|
-
}],
|
|
138
|
-
bind: [this.state, 'choice'],
|
|
139
|
-
children: _jsx("option", {
|
|
140
|
-
value: "z",
|
|
141
|
-
children: "Z"
|
|
142
|
-
})
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
const testApp = await createTestApp(Root, {
|
|
147
|
-
document
|
|
148
|
-
});
|
|
149
|
-
expect(optionTexts(testApp.container)).to.deep.equal(['A', 'Z']);
|
|
150
|
-
await testApp.unmount();
|
|
151
|
-
});
|
|
152
|
-
it('still binds the selected value back to state', async () => {
|
|
153
|
-
const window = new Window();
|
|
154
|
-
const document = window.document;
|
|
155
|
-
class Root extends TungstenStatefulComponent {
|
|
156
|
-
constructor(...args) {
|
|
157
|
-
super(...args);
|
|
158
|
-
_defineProperty(this, "state", {
|
|
159
|
-
choice: 'a'
|
|
160
|
-
});
|
|
161
|
-
_defineProperty(this, "content", () => _jsx(BindableSelect, {
|
|
162
|
-
placeholder: "Pick one",
|
|
163
|
-
options: [{
|
|
164
|
-
value: 'a',
|
|
165
|
-
text: 'A'
|
|
166
|
-
}, {
|
|
167
|
-
value: 'b',
|
|
168
|
-
text: 'B'
|
|
169
|
-
}],
|
|
170
|
-
bind: [this.state, 'choice']
|
|
171
|
-
}));
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
const testApp = await createTestApp(Root, {
|
|
175
|
-
document
|
|
176
|
-
});
|
|
177
|
-
const select = testApp.container.querySelector('select');
|
|
178
|
-
select.value = 'b';
|
|
179
|
-
select.dispatchEvent(new window.Event('input', {
|
|
180
|
-
bubbles: true
|
|
181
|
-
}));
|
|
182
|
-
await testApp.resolved();
|
|
183
|
-
expect(testApp.component.state.choice).to.equal('b');
|
|
184
|
-
await testApp.unmount();
|
|
185
|
-
});
|
|
186
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injectEnv.sxyt.d.ts","sourceRoot":"","sources":["../../src/env/injectEnv.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { should as setupShould, expect } from 'chai';
|
|
3
|
-
const should = setupShould(); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
-
import { injectEnv } from "./injectEnv.js";
|
|
5
|
-
describe('injectEnv()', ({
|
|
6
|
-
it
|
|
7
|
-
}) => {
|
|
8
|
-
it('should inject key value pairs into process.env', () => {
|
|
9
|
-
delete process.env.foo;
|
|
10
|
-
delete process.env.bar;
|
|
11
|
-
expect(process.env.foo).to.be.undefined;
|
|
12
|
-
expect(process.env.bar).to.be.undefined;
|
|
13
|
-
injectEnv({
|
|
14
|
-
foo: 'FOO',
|
|
15
|
-
bar: 'BAZ'
|
|
16
|
-
});
|
|
17
|
-
expect(process.env.foo).to.equal('FOO');
|
|
18
|
-
expect(process.env.bar).to.equal('BAZ');
|
|
19
|
-
});
|
|
20
|
-
});
|
package/dist/env/parseEnv.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseEnv.d.ts","sourceRoot":"","sources":["../../src/env/parseEnv.ts"],"names":[],"mappings":""}
|
package/dist/env/parseEnv.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
// export function parseEnv(envContent: string): Record<string, string> {
|
|
3
|
-
// const env: Record<string, string> = {}
|
|
4
|
-
// //console.log('parseEnv')
|
|
5
|
-
// const lines = envContent.split('\n')
|
|
6
|
-
// for (const line of lines) {
|
|
7
|
-
// //console.log('line', line)
|
|
8
|
-
// const parts = line.split('=')
|
|
9
|
-
// if (parts.length === 2) {
|
|
10
|
-
// env[parts[0].trim()] = parts[1].trim()
|
|
11
|
-
// }
|
|
12
|
-
// }
|
|
13
|
-
// return env
|
|
14
|
-
// }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseEnv.sxyt.d.ts","sourceRoot":"","sources":["../../src/env/parseEnv.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// import { describe } from 'sxy-test-runner'
|
|
2
|
-
// import { should as setupShould } from 'chai'
|
|
3
|
-
// const should = setupShould() // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
-
export {};
|
|
5
|
-
// import { parseEnv } from './parseEnv.js'
|
|
6
|
-
// describe('loadEnv()', ({it}) => {
|
|
7
|
-
// it('should extra a key value pair from some text', () => {
|
|
8
|
-
// const env = parseEnv(' foo = bar ')
|
|
9
|
-
// env.should.deep.equal({ foo: 'bar' })
|
|
10
|
-
// })
|
|
11
|
-
// })
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"findProjectDir.sxyt.d.ts","sourceRoot":"","sources":["../src/findProjectDir.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'fs';
|
|
3
|
-
import { tmpdir } from 'os';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { findProjectDir } from "./findProjectDir.js";
|
|
6
|
-
// Build a fixture that mirrors zod v4 - a named package containing a sub folder with a
|
|
7
|
-
// nameless marker package.json that only sets the module format and local entry points.
|
|
8
|
-
function makeFixture() {
|
|
9
|
-
const root = mkdtempSync(join(tmpdir(), 'tungsten-find-project-dir-'));
|
|
10
|
-
const packageDir = join(root, 'fake-package');
|
|
11
|
-
const markerDir = join(packageDir, 'v4', 'core');
|
|
12
|
-
mkdirSync(markerDir, {
|
|
13
|
-
recursive: true
|
|
14
|
-
});
|
|
15
|
-
writeFileSync(join(packageDir, 'package.json'), JSON.stringify({
|
|
16
|
-
name: 'fake-package',
|
|
17
|
-
version: '1.2.3',
|
|
18
|
-
type: 'module'
|
|
19
|
-
}));
|
|
20
|
-
writeFileSync(join(markerDir, 'package.json'), JSON.stringify({
|
|
21
|
-
type: 'module',
|
|
22
|
-
main: './index.cjs',
|
|
23
|
-
module: './index.js'
|
|
24
|
-
}));
|
|
25
|
-
writeFileSync(join(markerDir, 'index.js'), '');
|
|
26
|
-
return {
|
|
27
|
-
root,
|
|
28
|
-
packageDir,
|
|
29
|
-
markerDir
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
describe('findProjectDir()', ({
|
|
33
|
-
it
|
|
34
|
-
}) => {
|
|
35
|
-
it(`returns the nearest package.json dir, named or not, by default`, () => {
|
|
36
|
-
const {
|
|
37
|
-
root,
|
|
38
|
-
markerDir
|
|
39
|
-
} = makeFixture();
|
|
40
|
-
try {
|
|
41
|
-
findProjectDir(markerDir).should.equal(markerDir);
|
|
42
|
-
} finally {
|
|
43
|
-
rmSync(root, {
|
|
44
|
-
recursive: true,
|
|
45
|
-
force: true
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
it(`skips nameless package.json files when requireName is set`, () => {
|
|
50
|
-
const {
|
|
51
|
-
root,
|
|
52
|
-
packageDir,
|
|
53
|
-
markerDir
|
|
54
|
-
} = makeFixture();
|
|
55
|
-
try {
|
|
56
|
-
findProjectDir(markerDir, {
|
|
57
|
-
requireName: true
|
|
58
|
-
}).should.equal(packageDir);
|
|
59
|
-
} finally {
|
|
60
|
-
rmSync(root, {
|
|
61
|
-
recursive: true,
|
|
62
|
-
force: true
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
it(`returns the named package dir when it is the nearest one`, () => {
|
|
67
|
-
const {
|
|
68
|
-
root,
|
|
69
|
-
packageDir
|
|
70
|
-
} = makeFixture();
|
|
71
|
-
try {
|
|
72
|
-
findProjectDir(packageDir, {
|
|
73
|
-
requireName: true
|
|
74
|
-
}).should.equal(packageDir);
|
|
75
|
-
} finally {
|
|
76
|
-
rmSync(root, {
|
|
77
|
-
recursive: true,
|
|
78
|
-
force: true
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"applyHmrModule.sxyt.d.ts","sourceRoot":"","sources":["../../src/hmr/applyHmrModule.sxyt.tsx"],"names":[],"mappings":""}
|