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,255 +0,0 @@
|
|
|
1
|
-
import { execFile } from 'child_process';
|
|
2
|
-
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'fs/promises';
|
|
3
|
-
import { tmpdir } from 'os';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { promisify } from 'util';
|
|
6
|
-
import { expect } from 'chai';
|
|
7
|
-
import { describe } from 'sxy-test-runner';
|
|
8
|
-
import { findProjectDir } from "../../findProjectDir.js";
|
|
9
|
-
const execFileAsync = promisify(execFile);
|
|
10
|
-
describe('tungsten compile', ({
|
|
11
|
-
it
|
|
12
|
-
}) => {
|
|
13
|
-
it('exits non-zero and does not report completion when Babel cannot transform a file', async () => {
|
|
14
|
-
const projectDir = await mkdtemp(join(tmpdir(), 'tungsten-compile-test-'));
|
|
15
|
-
const cliLocation = join(findProjectDir(import.meta.url), 'dist', 'bin', 'index.js');
|
|
16
|
-
try {
|
|
17
|
-
await writeFile(join(projectDir, 'package.json'), '{"type":"module"}');
|
|
18
|
-
await writeFile(join(projectDir, 'broken.jsx'), 'export const broken = <div>');
|
|
19
|
-
let error;
|
|
20
|
-
try {
|
|
21
|
-
await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--quiet'], {
|
|
22
|
-
cwd: projectDir
|
|
23
|
-
});
|
|
24
|
-
} catch (caught) {
|
|
25
|
-
error = caught;
|
|
26
|
-
}
|
|
27
|
-
expect(error).not.to.equal(undefined);
|
|
28
|
-
expect(error?.code).not.to.equal(0);
|
|
29
|
-
expect(error?.stdout ?? '').not.to.contain('Compile complete');
|
|
30
|
-
} finally {
|
|
31
|
-
await rm(projectDir, {
|
|
32
|
-
recursive: true,
|
|
33
|
-
force: true
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
it('writes all JavaScript and readiness output beneath the selected locations', async () => {
|
|
38
|
-
const projectDir = await mkdtemp(join(tmpdir(), 'tungsten-compile-output-test-'));
|
|
39
|
-
const cliLocation = join(findProjectDir(import.meta.url), 'dist', 'bin', 'index.js');
|
|
40
|
-
try {
|
|
41
|
-
await writeFile(join(projectDir, 'package.json'), '{"type":"module"}');
|
|
42
|
-
await writeFile(join(projectDir, 'entry.jsx'), 'export const element = <div />');
|
|
43
|
-
const {
|
|
44
|
-
stdout
|
|
45
|
-
} = await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--output', '.tungsten/test', '--ready-file', '.tungsten/test.ready', '--quiet'], {
|
|
46
|
-
cwd: projectDir
|
|
47
|
-
});
|
|
48
|
-
const compiled = await readFile(join(projectDir, '.tungsten/test/code/entry.js'), 'utf8');
|
|
49
|
-
const ready = JSON.parse(await readFile(join(projectDir, '.tungsten/test.ready'), 'utf8'));
|
|
50
|
-
expect(stdout).to.contain('Compile complete');
|
|
51
|
-
expect(compiled).to.contain('export const element');
|
|
52
|
-
expect(ready.ready).to.equal(true);
|
|
53
|
-
expect(ready.output).to.equal(join(projectDir, '.tungsten/test'));
|
|
54
|
-
} finally {
|
|
55
|
-
await rm(projectDir, {
|
|
56
|
-
recursive: true,
|
|
57
|
-
force: true
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
it('reports an unsupported node dependency once and continues compiling', async () => {
|
|
62
|
-
const projectDir = await mkdtemp(join(tmpdir(), 'tungsten-compile-node-dependency-test-'));
|
|
63
|
-
const cliLocation = join(findProjectDir(import.meta.url), 'dist', 'bin', 'index.js');
|
|
64
|
-
const packageDir = join(projectDir, 'node_modules', 'fixture-package');
|
|
65
|
-
const sourceDir = join(projectDir, 'src');
|
|
66
|
-
try {
|
|
67
|
-
await mkdir(packageDir, {
|
|
68
|
-
recursive: true
|
|
69
|
-
});
|
|
70
|
-
await mkdir(sourceDir, {
|
|
71
|
-
recursive: true
|
|
72
|
-
});
|
|
73
|
-
await writeFile(join(projectDir, 'package.json'), '{"type":"module"}');
|
|
74
|
-
await writeFile(join(projectDir, 'tungsten.config.js'), 'export default { codeDir: "src", useRootComponent: false }');
|
|
75
|
-
await writeFile(join(sourceDir, 'entry.js'), 'import fixture from \'fixture-package\'; export { fixture }');
|
|
76
|
-
await writeFile(join(packageDir, 'package.json'), '{"name":"fixture-package","version":"1.0.0","main":"index.js"}');
|
|
77
|
-
await writeFile(join(packageDir, 'index.js'), 'module.exports = require(\'missing-native-module\')');
|
|
78
|
-
const {
|
|
79
|
-
stdout
|
|
80
|
-
} = await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--output', '.tungsten/test', '--quiet'], {
|
|
81
|
-
cwd: projectDir
|
|
82
|
-
});
|
|
83
|
-
expect(stdout).to.contain('Your code that is compiled may depend on a node module - this is not allowed.');
|
|
84
|
-
expect(stdout).to.contain('src/entry.js\n -> fixture-package/index.js\n -> missing-native-module (unresolved)');
|
|
85
|
-
expect(stdout).not.to.contain('Require stack:');
|
|
86
|
-
expect(stdout).not.to.contain('process file err');
|
|
87
|
-
expect(stdout.split('Your code that is compiled may depend on a node module - this is not allowed.')).to.have.length(2);
|
|
88
|
-
expect(stdout).to.contain('Compile complete');
|
|
89
|
-
await readFile(join(projectDir, '.tungsten/test/code/entry.js'), 'utf8');
|
|
90
|
-
} finally {
|
|
91
|
-
await rm(projectDir, {
|
|
92
|
-
recursive: true,
|
|
93
|
-
force: true
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
it('takes the import build of a dual package for an import, and the require build for a require', async () => {
|
|
98
|
-
const projectDir = await mkdtemp(join(tmpdir(), 'tungsten-compile-conditions-test-'));
|
|
99
|
-
const cliLocation = join(findProjectDir(import.meta.url), 'dist', 'bin', 'index.js');
|
|
100
|
-
const sourceDir = join(projectDir, 'src');
|
|
101
|
-
const dualDir = join(projectDir, 'node_modules', 'dual-package');
|
|
102
|
-
const cjsDir = join(projectDir, 'node_modules', 'cjs-package');
|
|
103
|
-
async function copiedToPackages(rel) {
|
|
104
|
-
try {
|
|
105
|
-
await readFile(join(projectDir, '.tungsten/test/.packages', rel), 'utf8');
|
|
106
|
-
return true;
|
|
107
|
-
} catch {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
try {
|
|
112
|
-
await mkdir(dualDir, {
|
|
113
|
-
recursive: true
|
|
114
|
-
});
|
|
115
|
-
await mkdir(cjsDir, {
|
|
116
|
-
recursive: true
|
|
117
|
-
});
|
|
118
|
-
await mkdir(sourceDir, {
|
|
119
|
-
recursive: true
|
|
120
|
-
});
|
|
121
|
-
await writeFile(join(projectDir, 'package.json'), '{"type":"module"}');
|
|
122
|
-
await writeFile(join(projectDir, 'tungsten.config.js'), 'export default { codeDir: "src", useRootComponent: false }');
|
|
123
|
-
// ships both builds, as @trpc/server and zod do
|
|
124
|
-
await writeFile(join(dualDir, 'package.json'), JSON.stringify({
|
|
125
|
-
name: 'dual-package',
|
|
126
|
-
version: '1.0.0',
|
|
127
|
-
exports: {
|
|
128
|
-
'.': {
|
|
129
|
-
import: './index.mjs',
|
|
130
|
-
require: './index.cjs'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}));
|
|
134
|
-
await writeFile(join(dualDir, 'index.mjs'), 'export const dual = "esm"');
|
|
135
|
-
await writeFile(join(dualDir, 'index.cjs'), 'module.exports = { dual: "cjs" }');
|
|
136
|
-
// a CJS package that require()s the dual package
|
|
137
|
-
await writeFile(join(cjsDir, 'package.json'), JSON.stringify({
|
|
138
|
-
name: 'cjs-package',
|
|
139
|
-
version: '1.0.0',
|
|
140
|
-
main: './index.js'
|
|
141
|
-
}));
|
|
142
|
-
await writeFile(join(cjsDir, 'index.js'), 'module.exports = require(\'dual-package\')');
|
|
143
|
-
await writeFile(join(sourceDir, 'entry.js'), 'import { dual } from \'dual-package\'\n' + 'import viaCjs from \'cjs-package\'\n' + 'export { dual, viaCjs }');
|
|
144
|
-
const {
|
|
145
|
-
stdout
|
|
146
|
-
} = await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--output', '.tungsten/test', '--quiet'], {
|
|
147
|
-
cwd: projectDir
|
|
148
|
-
});
|
|
149
|
-
expect(stdout).to.contain('Compile complete');
|
|
150
|
-
// the ESM import took ./index.mjs
|
|
151
|
-
expect(await copiedToPackages('dual-package@1.0.0/index.mjs')).to.equal(true);
|
|
152
|
-
// and the require() inside the CJS package took ./index.cjs, so that the
|
|
153
|
-
// converted require() shim can find it in its deps
|
|
154
|
-
expect(await copiedToPackages('dual-package@1.0.0/index.cjs')).to.equal(true);
|
|
155
|
-
} finally {
|
|
156
|
-
await rm(projectDir, {
|
|
157
|
-
recursive: true,
|
|
158
|
-
force: true
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
it('overrides the ignoreDirs and ignorePatterns config entries from the command line', async () => {
|
|
163
|
-
const projectDir = await mkdtemp(join(tmpdir(), 'tungsten-compile-ignore-test-'));
|
|
164
|
-
const cliLocation = join(findProjectDir(import.meta.url), 'dist', 'bin', 'index.js');
|
|
165
|
-
const sourceDir = join(projectDir, 'src');
|
|
166
|
-
async function compiled(rel) {
|
|
167
|
-
try {
|
|
168
|
-
await readFile(join(projectDir, '.tungsten/test/code', rel), 'utf8');
|
|
169
|
-
return true;
|
|
170
|
-
} catch {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
try {
|
|
175
|
-
await mkdir(join(sourceDir, 'server'), {
|
|
176
|
-
recursive: true
|
|
177
|
-
});
|
|
178
|
-
await mkdir(join(sourceDir, 'tests'), {
|
|
179
|
-
recursive: true
|
|
180
|
-
});
|
|
181
|
-
await writeFile(join(projectDir, 'package.json'), '{"type":"module"}');
|
|
182
|
-
await writeFile(join(projectDir, 'tungsten.config.js'), 'export default {' + ' codeDir: "src",' + ' useRootComponent: false,' + ' ignoreDirs: "server",' + ' ignorePatterns: "**/*.domTest.js"' + ' }');
|
|
183
|
-
await writeFile(join(sourceDir, 'entry.js'), 'export const entry = 1');
|
|
184
|
-
await writeFile(join(sourceDir, 'server', 'api.js'), 'export const api = 1');
|
|
185
|
-
await writeFile(join(sourceDir, 'tests', 'unit.js'), 'export const unit = 1');
|
|
186
|
-
await writeFile(join(sourceDir, 'component.domTest.js'), 'export const domTest = 1');
|
|
187
|
-
// the config entries alone - server/ and *.domTest.js are left out
|
|
188
|
-
await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--output', '.tungsten/test', '--quiet'], {
|
|
189
|
-
cwd: projectDir
|
|
190
|
-
});
|
|
191
|
-
expect(await compiled('entry.js')).to.equal(true);
|
|
192
|
-
expect(await compiled('server/api.js')).to.equal(false);
|
|
193
|
-
expect(await compiled('component.domTest.js')).to.equal(false);
|
|
194
|
-
// blank values override both entries away, so everything is compiled
|
|
195
|
-
await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--output', '.tungsten/test', '--quiet', '--ignore-dirs', '', '--ignore-patterns', ''], {
|
|
196
|
-
cwd: projectDir
|
|
197
|
-
});
|
|
198
|
-
expect(await compiled('server/api.js')).to.equal(true);
|
|
199
|
-
expect(await compiled('component.domTest.js')).to.equal(true);
|
|
200
|
-
// repeating an option replaces the config entry with all of the given values
|
|
201
|
-
await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--output', '.tungsten/test', '--quiet', '--ignore-dirs', 'tests', '--ignore-dirs', 'server'], {
|
|
202
|
-
cwd: projectDir
|
|
203
|
-
});
|
|
204
|
-
expect(await compiled('entry.js')).to.equal(true);
|
|
205
|
-
expect(await compiled('tests/unit.js')).to.equal(false);
|
|
206
|
-
expect(await compiled('server/api.js')).to.equal(false);
|
|
207
|
-
// ignorePatterns was not overridden, so it still applies
|
|
208
|
-
expect(await compiled('component.domTest.js')).to.equal(false);
|
|
209
|
-
} finally {
|
|
210
|
-
await rm(projectDir, {
|
|
211
|
-
recursive: true,
|
|
212
|
-
force: true
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
it('skips package compilation for files selected by a JavaScript glob', async () => {
|
|
217
|
-
const projectDir = await mkdtemp(join(tmpdir(), 'tungsten-skip-package-compilation-test-'));
|
|
218
|
-
const cliLocation = join(findProjectDir(import.meta.url), 'dist', 'bin', 'index.js');
|
|
219
|
-
const packageDir = join(projectDir, 'node_modules', 'fixture-package');
|
|
220
|
-
const sourceDir = join(projectDir, 'src');
|
|
221
|
-
try {
|
|
222
|
-
await mkdir(packageDir, {
|
|
223
|
-
recursive: true
|
|
224
|
-
});
|
|
225
|
-
await mkdir(sourceDir, {
|
|
226
|
-
recursive: true
|
|
227
|
-
});
|
|
228
|
-
await writeFile(join(projectDir, 'package.json'), '{"type":"module"}');
|
|
229
|
-
await writeFile(join(projectDir, 'tungsten.config.js'), 'export default {' + ' codeDir: "src",' + ' useRootComponent: false,' + ' skipPackageCompilation: "**/*.domTest.js"' + ' }');
|
|
230
|
-
await writeFile(join(sourceDir, 'component.domTest.js'), "import fixture from 'fixture-package'; export { fixture }");
|
|
231
|
-
await writeFile(join(packageDir, 'package.json'), '{"name":"fixture-package","version":"1.0.0","main":"index.js"}');
|
|
232
|
-
await writeFile(join(packageDir, 'index.js'), 'module.exports = 1');
|
|
233
|
-
const {
|
|
234
|
-
stdout
|
|
235
|
-
} = await execFileAsync(process.execPath, [cliLocation, 'compile', '--js', '--output', '.tungsten/test', '--quiet'], {
|
|
236
|
-
cwd: projectDir
|
|
237
|
-
});
|
|
238
|
-
const compiled = await readFile(join(projectDir, '.tungsten/test/code/component.domTest.js'), 'utf8');
|
|
239
|
-
expect(stdout).to.contain('Compile complete');
|
|
240
|
-
expect(compiled).to.contain("from 'fixture-package'");
|
|
241
|
-
let packageWasCopied = true;
|
|
242
|
-
try {
|
|
243
|
-
await readFile(join(projectDir, '.tungsten/test/.packages/fixture-package@1.0.0/index.js'), 'utf8');
|
|
244
|
-
} catch {
|
|
245
|
-
packageWasCopied = false;
|
|
246
|
-
}
|
|
247
|
-
expect(packageWasCopied).to.equal(false);
|
|
248
|
-
} finally {
|
|
249
|
-
await rm(projectDir, {
|
|
250
|
-
recursive: true,
|
|
251
|
-
force: true
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modifySassImports.sxyt.d.ts","sourceRoot":"","sources":["../../src/build/modifySassImports.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { modifySassImports } from "./modifySassImports.js";
|
|
3
|
-
import { sassImportParser } from "./sassImportParser.js";
|
|
4
|
-
describe('modifySassImports()', ({
|
|
5
|
-
it
|
|
6
|
-
}) => {
|
|
7
|
-
const input = `@import 'foo'`;
|
|
8
|
-
it(`modifies sass import 'foo' into 'C:/project/styles/foo' in content '${input}'`, () => {
|
|
9
|
-
//const imports = sassImportParser(input)
|
|
10
|
-
const imports = sassImportParser(input);
|
|
11
|
-
imports[0].to = '/project/styles/foo'; // eslint-disable-line no-type-assertion/no-type-assertion
|
|
12
|
-
console.log('imports', imports);
|
|
13
|
-
// const imports = [
|
|
14
|
-
// {
|
|
15
|
-
// target: 'foo',
|
|
16
|
-
// start: 9,
|
|
17
|
-
// to: 'C:/project/styles/foo'
|
|
18
|
-
// },
|
|
19
|
-
// ]
|
|
20
|
-
const result = modifySassImports(input, imports); // eslint-disable-line no-type-assertion/no-type-assertion
|
|
21
|
-
console.log('result', result);
|
|
22
|
-
result.should.equal(`@import '${imports[0].to}'`); // eslint-disable-line no-type-assertion/no-type-assertion
|
|
23
|
-
});
|
|
24
|
-
const input2 = `
|
|
25
|
-
@use 'foo' as bar
|
|
26
|
-
@import 'baz'
|
|
27
|
-
|
|
28
|
-
p
|
|
29
|
-
color: red
|
|
30
|
-
`;
|
|
31
|
-
it(`modifies 2 sass imports in content '${input2}'`, () => {
|
|
32
|
-
const imports = sassImportParser(input2);
|
|
33
|
-
imports[0].to = '/project/styles/foo' // eslint-disable-line no-type-assertion/no-type-assertion
|
|
34
|
-
;
|
|
35
|
-
imports[1].to = '/project/styles/baz'; // eslint-disable-line no-type-assertion/no-type-assertion
|
|
36
|
-
console.log('imports', imports);
|
|
37
|
-
// const imports = [
|
|
38
|
-
// {
|
|
39
|
-
// target: 'foo',
|
|
40
|
-
// start: 9,
|
|
41
|
-
// to: 'C:/project/styles/bar'
|
|
42
|
-
// },
|
|
43
|
-
// {
|
|
44
|
-
// target: 'baz',
|
|
45
|
-
// start: 19,
|
|
46
|
-
// to: 'C:/project/styles/foo'
|
|
47
|
-
// },
|
|
48
|
-
// ]
|
|
49
|
-
const result = modifySassImports(input2, imports); // eslint-disable-line no-type-assertion/no-type-assertion
|
|
50
|
-
console.log('result', result);
|
|
51
|
-
result.should.equal(input2.replace('foo', imports[0].to) // eslint-disable-line no-type-assertion/no-type-assertion
|
|
52
|
-
.replace('baz', imports[1].to) // eslint-disable-line no-type-assertion/no-type-assertion
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sassImportParser.sxyt.d.ts","sourceRoot":"","sources":["../../src/build/sassImportParser.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { sassImportParser } from "./sassImportParser.js";
|
|
3
|
-
describe('sassImportParser()', ({
|
|
4
|
-
it
|
|
5
|
-
}) => {
|
|
6
|
-
const input = `@import 'foo'`;
|
|
7
|
-
it(`parses out an import '${input}'`, () => {
|
|
8
|
-
const imports = sassImportParser(input);
|
|
9
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
10
|
-
targets.should.deep.equal(['foo']);
|
|
11
|
-
});
|
|
12
|
-
const input2 = `@import 'foo'
|
|
13
|
-
@import 'bar'`;
|
|
14
|
-
it(`parses out 2 imports from '${input2}'`, () => {
|
|
15
|
-
const imports = sassImportParser(input2);
|
|
16
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
17
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
18
|
-
});
|
|
19
|
-
const input3 = `
|
|
20
|
-
@import 'foo'
|
|
21
|
-
|
|
22
|
-
@import 'bar'
|
|
23
|
-
|
|
24
|
-
`;
|
|
25
|
-
it(`parses out 2 imports with spaces from '${input3}'`, () => {
|
|
26
|
-
const imports = sassImportParser(input3);
|
|
27
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
28
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
29
|
-
});
|
|
30
|
-
const input4 = `
|
|
31
|
-
@import 'foo'
|
|
32
|
-
@import 'bar'
|
|
33
|
-
p::after
|
|
34
|
-
content: "@import 'baz'"
|
|
35
|
-
`;
|
|
36
|
-
it(`ignores extra imports within style values '${input4}'`, () => {
|
|
37
|
-
const imports = sassImportParser(input4);
|
|
38
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
39
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
40
|
-
});
|
|
41
|
-
const input5 = `
|
|
42
|
-
@import 'foo'
|
|
43
|
-
@import 'bar'
|
|
44
|
-
// @import 'ignoreme'
|
|
45
|
-
/* @use 'ignoremetoo' */
|
|
46
|
-
/*
|
|
47
|
-
@use 'ignoremealso'
|
|
48
|
-
*/
|
|
49
|
-
@use 'baz'
|
|
50
|
-
`;
|
|
51
|
-
it(`ignores imports within comments in '${input5}'`, () => {
|
|
52
|
-
const imports = sassImportParser(input5);
|
|
53
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
54
|
-
targets.should.deep.equal(['foo', 'bar', 'baz']);
|
|
55
|
-
});
|
|
56
|
-
const input6 = `
|
|
57
|
-
@import /* comment */ 'foo'
|
|
58
|
-
@import /* comment */'bar'
|
|
59
|
-
`;
|
|
60
|
-
it(`tolerates comments within @import and @use statements in '${input6}'`, () => {
|
|
61
|
-
const imports = sassImportParser(input6);
|
|
62
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
63
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
64
|
-
});
|
|
65
|
-
const input7 = `
|
|
66
|
-
@import'foo'
|
|
67
|
-
@import/* comment */'bar'
|
|
68
|
-
`;
|
|
69
|
-
it(`does not require a space between @import / @use and the target using '${input7}'`, () => {
|
|
70
|
-
const imports = sassImportParser(input7);
|
|
71
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
72
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
73
|
-
});
|
|
74
|
-
const input8 = `@import 'foo'`;
|
|
75
|
-
it(`returns a correct index for the start position when extracting from '${input8}'`, () => {
|
|
76
|
-
const imports = sassImportParser(input8);
|
|
77
|
-
Array.from(imports).should.deep.equal([{
|
|
78
|
-
target: 'foo',
|
|
79
|
-
start: 9
|
|
80
|
-
}]);
|
|
81
|
-
});
|
|
82
|
-
const input9 = `
|
|
83
|
-
|
|
84
|
-
@import 'bar'`;
|
|
85
|
-
it(`returns a correct index for the start position when extracting from '${input9}'`, () => {
|
|
86
|
-
const imports = sassImportParser(input9);
|
|
87
|
-
Array.from(imports).should.deep.equal([{
|
|
88
|
-
target: 'bar',
|
|
89
|
-
start: 15
|
|
90
|
-
}]);
|
|
91
|
-
});
|
|
92
|
-
const input10 = `@use 'foo' as bar`;
|
|
93
|
-
it(`handles aliasing in @use statements in '${input10}'`, () => {
|
|
94
|
-
const imports = sassImportParser(input10);
|
|
95
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
96
|
-
targets.should.deep.equal(['foo']);
|
|
97
|
-
});
|
|
98
|
-
const input11 = `@use './foo' as bar`;
|
|
99
|
-
it(`extract relative targets from '${input11}'`, () => {
|
|
100
|
-
const imports = sassImportParser(input11);
|
|
101
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
102
|
-
targets.should.deep.equal(['./foo']);
|
|
103
|
-
});
|
|
104
|
-
const input12 = `@use "foo" as bar`;
|
|
105
|
-
it(`handles double quotes in '${input12}'`, () => {
|
|
106
|
-
const imports = sassImportParser(input12);
|
|
107
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
108
|
-
targets.should.deep.equal(['foo']);
|
|
109
|
-
});
|
|
110
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scssImportParserChatgpt.sxyt.d.ts","sourceRoot":"","sources":["../../src/build/scssImportParserChatgpt.sxyt.ts"],"names":[],"mappings":""}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { scssImportParserChatgpt } from "./scssImportParserChatgpt.js";
|
|
3
|
-
describe('sassImportParser()', ({
|
|
4
|
-
it
|
|
5
|
-
}) => {
|
|
6
|
-
const input = `@import 'foo';`;
|
|
7
|
-
it(`parses out an import '${input}'`, () => {
|
|
8
|
-
const imports = scssImportParserChatgpt(input);
|
|
9
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
10
|
-
targets.should.deep.equal(['foo']);
|
|
11
|
-
});
|
|
12
|
-
const input2 = `@import 'foo';
|
|
13
|
-
@import 'bar';`;
|
|
14
|
-
it(`parses out 2 imports from '${input2}'`, () => {
|
|
15
|
-
const imports = scssImportParserChatgpt(input2);
|
|
16
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
17
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
18
|
-
});
|
|
19
|
-
const input3 = `
|
|
20
|
-
@import 'foo';
|
|
21
|
-
|
|
22
|
-
@import 'bar';
|
|
23
|
-
|
|
24
|
-
`;
|
|
25
|
-
it(`parses out 2 imports with spaces from '${input3}'`, () => {
|
|
26
|
-
const imports = scssImportParserChatgpt(input3);
|
|
27
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
28
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
29
|
-
});
|
|
30
|
-
const input4 = `
|
|
31
|
-
@import 'foo';
|
|
32
|
-
@import 'bar';
|
|
33
|
-
p::after {
|
|
34
|
-
content: "@import 'baz'";
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
it(`ignores extra imports within style values '${input4}'`, () => {
|
|
38
|
-
const imports = scssImportParserChatgpt(input4);
|
|
39
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
40
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
41
|
-
});
|
|
42
|
-
const input5b = `
|
|
43
|
-
@import 'foo';
|
|
44
|
-
@import 'bar';
|
|
45
|
-
/* @use 'ignoremetoo'; */
|
|
46
|
-
@use 'baz';
|
|
47
|
-
`;
|
|
48
|
-
it(`ignores imports within comments in '${input5b}'`, () => {
|
|
49
|
-
const imports = scssImportParserChatgpt(input5b);
|
|
50
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
51
|
-
targets.should.deep.equal(['foo', 'bar', 'baz']);
|
|
52
|
-
});
|
|
53
|
-
const input5c = `
|
|
54
|
-
@import 'foo';
|
|
55
|
-
@import 'bar';
|
|
56
|
-
/*
|
|
57
|
-
@use 'ignoremealso';
|
|
58
|
-
*/
|
|
59
|
-
@use 'baz';
|
|
60
|
-
`;
|
|
61
|
-
it(`ignores imports within comments in '${input5c}'`, () => {
|
|
62
|
-
const imports = scssImportParserChatgpt(input5c);
|
|
63
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
64
|
-
targets.should.deep.equal(['foo', 'bar', 'baz']);
|
|
65
|
-
});
|
|
66
|
-
const input6 = `
|
|
67
|
-
@import /* comment */ 'foo';
|
|
68
|
-
@import /* comment */'bar';
|
|
69
|
-
`;
|
|
70
|
-
it(`tolerates comments within @import and @use statements in '${input6}'`, () => {
|
|
71
|
-
const imports = scssImportParserChatgpt(input6);
|
|
72
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
73
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
74
|
-
});
|
|
75
|
-
const input7 = `
|
|
76
|
-
@import'foo';
|
|
77
|
-
@import/* comment */'bar';
|
|
78
|
-
`;
|
|
79
|
-
it(`does not require a space between @import / @use and the target using '${input7}'`, () => {
|
|
80
|
-
const imports = scssImportParserChatgpt(input7);
|
|
81
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
82
|
-
targets.should.deep.equal(['foo', 'bar']);
|
|
83
|
-
});
|
|
84
|
-
const input8 = `@import 'foo';`;
|
|
85
|
-
it(`returns a correct index for the start position when extracting from '${input8}'`, () => {
|
|
86
|
-
const imports = scssImportParserChatgpt(input8);
|
|
87
|
-
Array.from(imports).should.deep.equal([{
|
|
88
|
-
target: 'foo',
|
|
89
|
-
start: 9
|
|
90
|
-
}]);
|
|
91
|
-
});
|
|
92
|
-
const input9 = `
|
|
93
|
-
|
|
94
|
-
@import 'bar';`;
|
|
95
|
-
it(`returns a correct index for the start position when extracting from '${input9}'`, () => {
|
|
96
|
-
const imports = scssImportParserChatgpt(input9);
|
|
97
|
-
Array.from(imports).should.deep.equal([{
|
|
98
|
-
target: 'bar',
|
|
99
|
-
start: 15
|
|
100
|
-
}]);
|
|
101
|
-
});
|
|
102
|
-
const input10 = `@use 'foo' as bar;`;
|
|
103
|
-
it(`handles aliasing in @use statements in '${input10}'`, () => {
|
|
104
|
-
const imports = scssImportParserChatgpt(input10);
|
|
105
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
106
|
-
targets.should.deep.equal(['foo']);
|
|
107
|
-
});
|
|
108
|
-
const input11 = `@use './foo' as bar;`;
|
|
109
|
-
it(`extract relative targets from '${input11}'`, () => {
|
|
110
|
-
const imports = scssImportParserChatgpt(input11);
|
|
111
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
112
|
-
targets.should.deep.equal(['./foo']);
|
|
113
|
-
});
|
|
114
|
-
const input12 = `@use "foo" as bar;`;
|
|
115
|
-
it(`handles double quotes in '${input12}'`, () => {
|
|
116
|
-
const imports = scssImportParserChatgpt(input12);
|
|
117
|
-
const targets = Array.from(imports).map(x => x.target);
|
|
118
|
-
targets.should.deep.equal(['foo']);
|
|
119
|
-
});
|
|
120
|
-
});
|
package/dist/clone.sxyt.d.ts
DELETED
package/dist/clone.sxyt.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clone.sxyt.d.ts","sourceRoot":"","sources":["../src/clone.sxyt.ts"],"names":[],"mappings":""}
|
package/dist/clone.sxyt.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { describe } from 'sxy-test-runner';
|
|
2
|
-
import { clone } from "./clone.js";
|
|
3
|
-
import { expect } from 'chai';
|
|
4
|
-
describe('clone()', ({
|
|
5
|
-
it
|
|
6
|
-
}) => {
|
|
7
|
-
it('clones an objects with symbols', () => {
|
|
8
|
-
const sym1 = Symbol(1);
|
|
9
|
-
const obj = {
|
|
10
|
-
a: 'a',
|
|
11
|
-
arr: [1, 2],
|
|
12
|
-
sub: {
|
|
13
|
-
[sym1]: 5,
|
|
14
|
-
sub2: {
|
|
15
|
-
foo: 'FOO'
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const newObj = clone(obj);
|
|
20
|
-
expect(newObj).not.to.equal(obj);
|
|
21
|
-
expect(newObj.sub).not.to.equal(obj.sub);
|
|
22
|
-
expect(newObj).to.deep.equal(obj);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentProxyHandlers.sxyt.d.ts","sourceRoot":"","sources":["../src/componentProxyHandlers.sxyt.ts"],"names":[],"mappings":""}
|