tungsten 0.4.11 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-complete +1 -1
- package/dist/.tsbuildinfo +1 -0
- package/dist/AnyComponent.d.ts.map +1 -1
- package/dist/AnyComponent.js +1 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +25 -23
- package/dist/ContentNode.js +2 -2
- package/dist/DomPointer.js +1 -1
- package/dist/DomRegion.js +3 -3
- package/dist/Framework.d.ts +2 -1
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +44 -35
- package/dist/FrameworkConfig.d.ts +16 -0
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.js +8 -8
- package/dist/Instance/Instance.js +12 -12
- package/dist/RenderedContentNode.d.ts.map +1 -1
- package/dist/RenderedContentNode.js +4 -3
- package/dist/RenderingNode.js +2 -2
- package/dist/Sass.d.ts.map +1 -1
- package/dist/Sass.js +1 -0
- package/dist/Script.js +1 -1
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +33 -32
- package/dist/Servers/ProdServer.js +15 -15
- package/dist/Servers/StaticSiteServer.js +4 -4
- package/dist/Servers/TungstenServer.js +5 -5
- package/dist/Servers/devErrorPageAutoRetry.js +1 -1
- package/dist/Servers/initStores.js +3 -3
- package/dist/Servers/loadEnvsDev.d.ts +1 -1
- package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
- package/dist/Servers/loadEnvsDev.js +10 -8
- package/dist/Servers/routing.d.ts.map +1 -1
- package/dist/Servers/routing.js +4 -4
- package/dist/Store/Store.js +1 -1
- package/dist/Store/TypeSafeStore.js +1 -1
- package/dist/Store/createStores.js +2 -2
- package/dist/Store/makeStore.js +3 -3
- package/dist/Store/registerStore.js +3 -3
- package/dist/TElement.js +1 -1
- package/dist/TungstenApp.js +9 -5
- package/dist/TungstenStyleObject.js +1 -1
- package/dist/__deproxy.js +2 -2
- package/dist/_client/client.js +3 -3
- package/dist/alive.js +1 -1
- package/dist/api/getApiRoutes.js +3 -3
- package/dist/api/getExport.d.ts.map +1 -1
- package/dist/api/getExport.js +5 -4
- package/dist/api/getExportDev.js +1 -1
- package/dist/appOutput.js +1 -1
- package/dist/auth/index.js +2 -2
- package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -1
- package/dist/babelPlugins/BabelAddDevCacheBust.js +4 -2
- package/dist/babelPlugins/BabelTransformBindDirect.js +4 -2
- package/dist/babelPlugins/BabelTransformBindVar.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformBindVar.js +3 -3
- package/dist/babelPlugins/BabelTransformCjsToEsm.js +1 -1
- package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentState.js +2 -2
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.js +32 -15
- package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformCssImports.js +3 -3
- package/dist/babelPlugins/BabelTransformDependencyImportsOld.js +1 -1
- package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformDeproxyState.js +1 -1
- package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.js +6 -2
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +75 -53
- package/dist/babelPlugins/BabelTransformReactive.js +1 -1
- package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.js +1 -1
- package/dist/babelPlugins/BabelTransformRemoveBlocks.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformSxyFrameworkImports.js +1 -1
- package/dist/babelPlugins/BabelTransformUniqueComponents.js +1 -1
- package/dist/babelPlugins/fixImportsInSassErrorMessage.js +1 -1
- package/dist/babelPlugins/test.js +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +5 -4
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +3 -2
- package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +2 -2
- package/dist/bin/args.js +2 -2
- package/dist/bin/commands/build.js +6 -6
- package/dist/bin/commands/buildHelp.js +1 -1
- package/dist/bin/commands/clean.js +4 -4
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +24 -17
- package/dist/bin/commands/compileSimplePackage.js +3 -2
- package/dist/bin/commands/dev.d.ts.map +1 -1
- package/dist/bin/commands/dev.js +16 -9
- package/dist/bin/commands/devmon.js +4 -4
- package/dist/bin/commands/help.js +2 -2
- package/dist/bin/commands/start.js +2 -2
- package/dist/bin/commands/static.js +3 -3
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +24 -16
- package/dist/bin/moduleLoadAnalysis.js +2 -2
- package/dist/bin/vendorHook.d.ts +3 -0
- package/dist/bin/vendorHook.d.ts.map +1 -0
- package/dist/bin/vendorHook.js +34 -0
- package/dist/browserStorage.js +6 -4
- package/dist/build/babel.user.common.config.d.ts +9 -2
- package/dist/build/babel.user.common.config.d.ts.map +1 -1
- package/dist/build/babel.user.common.config.js +21 -16
- package/dist/build/bundle.d.ts +1 -1
- package/dist/build/bundle.d.ts.map +1 -1
- package/dist/build/bundle.js +15 -7
- package/dist/build/bundleBabelOptions.d.ts +6 -0
- package/dist/build/bundleBabelOptions.d.ts.map +1 -0
- package/dist/build/bundleBabelOptions.js +23 -0
- package/dist/build/combineComponentCss.js +2 -2
- package/dist/build/compileJavascript.d.ts +4 -0
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +174 -103
- package/dist/build/compileStyles.js +8 -8
- package/dist/build/compileUserApp.d.ts +1 -1
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/compileUserApp.js +15 -12
- package/dist/build/componentStylesCache.d.ts +10 -0
- package/dist/build/componentStylesCache.d.ts.map +1 -0
- package/dist/build/componentStylesCache.js +54 -0
- package/dist/build/copyAssets.js +4 -4
- package/dist/build/copyPackageModulesToPackagesFolder.js +4 -4
- package/dist/build/copyPublicFiles.js +4 -4
- package/dist/build/createClientFiles.js +3 -3
- package/dist/build/createInstanceConfigFile.js +2 -2
- package/dist/build/createPackageVirtualFileSystems.js +1 -1
- package/dist/build/devBundle.js +5 -5
- package/dist/build/devBundle.rollup.config.d.ts.map +1 -1
- package/dist/build/devBundle.rollup.config.js +0 -1
- package/dist/build/frameworkDestLocation.d.ts +1 -0
- package/dist/build/frameworkDestLocation.d.ts.map +1 -1
- package/dist/build/frameworkDestLocation.js +8 -4
- package/dist/build/frameworkStylesheets.js +2 -2
- package/dist/build/getAllSxyClientModules.d.ts.map +1 -1
- package/dist/build/getAllSxyClientModules.js +4 -28
- package/dist/build/getPackageDirForFile.js +1 -1
- package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
- package/dist/build/getSxyClientPackageAliases.js +4 -2
- package/dist/build/getTempDirForAppCompilation.js +1 -1
- package/dist/build/makeBabelRawConfig.d.ts +3 -0
- package/dist/build/makeBabelRawConfig.d.ts.map +1 -0
- package/dist/build/makeBabelRawConfig.js +12 -0
- package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +11 -8
- package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.js +10 -5
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +13 -11
- package/dist/build/rollupExtractComponentStylesheets.js +3 -3
- package/dist/build/sassImportParser.js +4 -4
- package/dist/build/tallyBabel.d.ts +3 -0
- package/dist/build/tallyBabel.d.ts.map +1 -0
- package/dist/build/tallyBabel.js +11 -0
- package/dist/calculateImportedStaticFileLocations.js +2 -2
- package/dist/calledFrom.js +2 -2
- package/dist/clone.js +4 -4
- package/dist/compat/context.d.ts.map +1 -1
- package/dist/compat/forwardRef.js +1 -1
- package/dist/compat/index.js +1 -1
- package/dist/compat/types.d.ts.map +1 -1
- package/dist/componentProxyHandlers.d.ts.map +1 -1
- package/dist/componentProxyHandlers.js +8 -12
- package/dist/components/Link.js +2 -2
- package/dist/components/PopMessages.js +3 -3
- package/dist/components/RawHtml.js +2 -2
- package/dist/components/Stylesheet.d.ts +1 -2
- package/dist/components/Stylesheet.d.ts.map +1 -1
- package/dist/components/Stylesheet.js +4 -4
- package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
- package/dist/components/bindable/BindableCheckbox.js +1 -1
- package/dist/components/bindable/BindableInput.d.ts.map +1 -1
- package/dist/components/bindable/BindableInput.js +1 -1
- package/dist/components/bindable/BindableInputNonString.js +1 -1
- package/dist/components/bindable/BindableInputString.js +1 -1
- package/dist/components/bindable/BindableInputTyped.js +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.js +1 -1
- package/dist/components/bindable/BindableRadio.d.ts.map +1 -1
- package/dist/components/bindable/BindableRadio.js +1 -1
- package/dist/components/bindable/BindableSelect.js +1 -1
- package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
- package/dist/components/bindable/BindableTextarea.js +1 -1
- package/dist/components/library/RichTextEditor/RichTextEditor.js +10 -10
- package/dist/components/library/RichTextEditor/contentTree.js +5 -5
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +2 -2
- package/dist/components/library/__StatefulMessage/StatefulMessage.js +2 -2
- package/dist/components/library/index.js +2 -2
- package/dist/concat.d.ts.map +1 -1
- package/dist/concat.js +2 -2
- package/dist/copy.d.ts.map +1 -1
- package/dist/createElement.js +1 -1
- package/dist/createRoutes.d.ts +1 -1
- package/dist/createRoutes.d.ts.map +1 -1
- package/dist/defaultConfig.d.ts +0 -1
- package/dist/defaultConfig.d.ts.map +1 -1
- package/dist/defaultConfig.js +2 -2
- package/dist/deleteDirs.js +1 -1
- package/dist/env/Env.js +2 -2
- package/dist/env/addToEnv.js +1 -1
- package/dist/env/funcs.js +4 -4
- package/dist/env/getEnvSchemas.d.ts +2 -2
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +16 -10
- package/dist/env/privateEnv.js +2 -2
- package/dist/env/privateEnvOrThrow.js +1 -1
- package/dist/env/publicEnv.js +1 -1
- package/dist/env/publicEnvOrThrow.js +1 -1
- package/dist/env/windowGlobalEnvStatement.d.ts.map +1 -1
- package/dist/filePathFromUrl.js +1 -1
- package/dist/findProjectDir.d.ts.map +1 -1
- package/dist/findProjectDir.js +19 -5
- package/dist/findUserConfig.js +7 -7
- package/dist/fixExtension.d.ts.map +1 -1
- package/dist/fixExtension.js +5 -3
- package/dist/foreach.js +1 -0
- package/dist/frameworkConfigSchema.d.ts +16 -0
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +14 -2
- package/dist/getComponent.d.ts.map +1 -1
- package/dist/getComponent.js +5 -5
- package/dist/getComponentDev.d.ts.map +1 -1
- package/dist/getComponentDev.js +1 -1
- package/dist/getFrameworkDir.js +1 -1
- package/dist/getRoutes.d.ts.map +1 -1
- package/dist/getRoutes.js +18 -27
- package/dist/getRoutesDevs.d.ts.map +1 -1
- package/dist/getRoutesDevs.js +1 -1
- package/dist/getStackTrace.js +1 -1
- package/dist/getUserConfig.js +7 -7
- package/dist/glob.d.ts +5 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +103 -0
- package/dist/hasValidKey.js +1 -1
- package/dist/helpers/getFetchCompatibleHeaders.js +2 -2
- package/dist/helpers/index.js +2 -2
- package/dist/hmr/applyHmrModule.js +10 -10
- package/dist/hmr/componentIdentity.js +3 -3
- package/dist/hmr/instanceRegistry.js +2 -2
- package/dist/hooks/clearCurrentComponent.js +1 -1
- package/dist/hooks/getCurrentComponent.js +3 -3
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/setCurrentComponent.js +1 -1
- package/dist/hooks/useCallback.js +2 -2
- package/dist/hooks/useEffect.js +2 -2
- package/dist/hooks/useInstance.js +1 -1
- package/dist/hooks/useMemo.js +2 -2
- package/dist/hooks/useReducer.d.ts.map +1 -1
- package/dist/hooks/useState.d.ts.map +1 -1
- package/dist/hooks/useState.js +3 -9
- package/dist/hydrate/hydrate.d.ts +1 -1
- package/dist/hydrate/hydrate.d.ts.map +1 -1
- package/dist/hydrate/hydrate.js +56 -54
- package/dist/hydrate/reconcileHydratedAttributes.js +5 -5
- package/dist/index.js +2 -2
- package/dist/indexInner.d.ts +1 -1
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +45 -45
- package/dist/innerHtmlFromProps.js +1 -1
- package/dist/isBrowser.js +1 -1
- package/dist/isDev.js +1 -1
- package/dist/isProd.js +1 -1
- package/dist/isServer.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/jsxRuntime.d.ts.map +1 -1
- package/dist/jsxRuntime.js +12 -7
- package/dist/jsxRuntimeSignals.d.ts.map +1 -1
- package/dist/jsxRuntimeSignals.js +15 -8
- package/dist/makeFinalConfig.d.ts.map +1 -1
- package/dist/makeFinalConfig.js +3 -3
- package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -1
- package/dist/makeServerRpc.js +3 -3
- package/dist/markOptionSelected.js +2 -2
- package/dist/mergeConfigs.d.ts.map +1 -1
- package/dist/mergeConfigs.js +11 -2
- package/dist/mutatingFunctions.js +3 -3
- package/dist/nbsp.js +1 -1
- package/dist/output.js +1 -1
- package/dist/pop.js +2 -2
- package/dist/postcssPlugins/TransformCssNames.js +8 -8
- package/dist/postcssPlugins/parseSelectors.js +1 -1
- package/dist/postcssPlugins/parseSelectorsRich.js +1 -1
- package/dist/postcssPlugins/scopeAnimationValue.js +2 -2
- package/dist/propsAreEqual.js +3 -3
- package/dist/rawHtml/filterContentNode.js +4 -4
- package/dist/rawHtml/parseHtml.js +5 -5
- package/dist/rawHtml/sanitizeHtml.js +3 -3
- package/dist/rawHtml/tokenizeHtml.js +2 -2
- package/dist/render/addImportMap.js +2 -2
- package/dist/render/classComponentNodeToRenderingTree.js +4 -4
- package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
- package/dist/render/componentNodeToRenderingTree.js +13 -24
- package/dist/render/contentNodeToHtml.js +11 -11
- package/dist/render/contentToHtml.d.ts.map +1 -1
- package/dist/render/contentToHtml.js +5 -5
- package/dist/render/contentToHtmlDev.js +1 -1
- package/dist/render/contentTreeToRenderingTree.js +7 -7
- package/dist/render/functionComponentNodeToRenderingTree.js +4 -4
- package/dist/render/getFunctionBodyAsString.d.ts.map +1 -1
- package/dist/render/getFunctionBodyAsString.js +3 -6
- package/dist/render/instantiateClassComponent.js +2 -2
- package/dist/render/instantiateComponent.js +3 -3
- package/dist/render/instantiateFunctionComponent.js +2 -2
- package/dist/render/printComponentNameInSource.js +1 -1
- package/dist/render/processHead.js +5 -5
- package/dist/render/processHtmlNode.js +1 -1
- package/dist/render/processProps.js +4 -4
- package/dist/render/processRenderingNodeHtml.js +6 -6
- package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
- package/dist/render/renderingTreeToHtml.js +16 -16
- package/dist/render/rootToHtml.d.ts.map +1 -1
- package/dist/render/rootToHtml.js +2 -2
- package/dist/render/rootToHtmlDev.js +1 -1
- package/dist/requests/fetch/delete.js +2 -2
- package/dist/requests/fetch/get.js +3 -3
- package/dist/requests/fetch/patch.js +2 -2
- package/dist/requests/fetch/post.js +2 -2
- package/dist/requests/fetch/put.js +2 -2
- package/dist/requests/index.js +5 -5
- package/dist/routing/MatchedRoute.js +2 -2
- package/dist/routing/Route.js +1 -1
- package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
- package/dist/routing/RoutesWithSafeParams.js +1 -1
- package/dist/routing/WebRedirect.d.ts.map +1 -1
- package/dist/routing/compareRequestToRegex.js +2 -2
- package/dist/routing/getPathPriority.js +2 -2
- package/dist/routing/matchPath.js +3 -3
- package/dist/routing/patternToRegex.js +1 -1
- package/dist/server.js +3 -3
- package/dist/serverModuleLocation.d.ts +3 -0
- package/dist/serverModuleLocation.d.ts.map +1 -0
- package/dist/serverModuleLocation.js +12 -0
- package/dist/serverRpc.d.ts.map +1 -1
- package/dist/settings.d.ts +4 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +9 -0
- package/dist/slash.d.ts +2 -0
- package/dist/slash.d.ts.map +1 -0
- package/dist/slash.js +5 -0
- package/dist/spawnShellCommand.js +1 -1
- package/dist/standardSchema.js +1 -1
- package/dist/staticGen/getAppRoutes.js +3 -3
- package/dist/staticGen/staticGen.d.ts.map +1 -1
- package/dist/staticGen/staticGen.js +16 -14
- package/dist/staticGen/staticGenFunctions.js +1 -1
- package/dist/style/jssToCss.d.ts.map +1 -1
- package/dist/style/jssToCss.js +13 -11
- package/dist/style/styleContent.js +1 -1
- package/dist/style/styleContentSxy.js +8 -8
- package/dist/style/unusedStyles.d.ts.map +1 -1
- package/dist/style/unusedStyles.js +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/syncServer/preload.js +1 -1
- package/dist/testing/host.js +12 -12
- package/dist/testing/hydrateTestApp.d.ts.map +1 -1
- package/dist/testing/hydrateTestApp.js +18 -18
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +11 -11
- package/dist/testing/installTestStyleProcessors.js +2 -2
- package/dist/testing/loadEnv.d.ts +4 -1
- package/dist/testing/loadEnv.d.ts.map +1 -1
- package/dist/testing/loadEnv.js +5 -5
- package/dist/testing/temp/componentPackageMock.js +5 -5
- package/dist/testing/temp/contentHtmlElements.js +2 -2
- package/dist/throwError.js +2 -2
- package/dist/timeProfiler.d.ts +5 -1
- package/dist/timeProfiler.d.ts.map +1 -1
- package/dist/timeProfiler.js +76 -24
- package/dist/todo.js +2 -1
- package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
- package/dist/update/integrateUpdateVdom.js +44 -41
- package/dist/update/integrateUpdateVdomPrebuild.js +5 -5
- package/dist/validChildren.js +2 -2
- package/dist/warnOnFrameworkChange.js +2 -2
- package/dist/watch.js +2 -2
- package/dist/zones/react.js +3 -3
- package/package.json +27 -39
- package/types/modules.d.ts +2 -1
- package/vendor/babel-core.js +26 -0
- package/vendor/babel-parser.js +9 -0
- package/vendor/babel-plugin-syntax-import-assertions.js +50 -0
- package/vendor/babel-preset-react.js +872 -0
- package/vendor/babel-preset-typescript.js +26 -0
- package/vendor/babel-types.js +9 -0
- package/vendor/chalk-extensions.js +1994 -0
- package/vendor/chalk.js +647 -0
- package/vendor/chokidar.js +6889 -0
- package/vendor/chunk-1TN2rK3j.js +1218 -0
- package/vendor/chunk-1UuLTU0U.js +34 -0
- package/vendor/chunk-B_NeooyV.js +86 -0
- package/vendor/chunk-C12hSZn7.js +88 -0
- package/vendor/chunk-C3YkUGz5.js +19 -0
- package/vendor/chunk-C3fcZDjl.js +41964 -0
- package/vendor/chunk-C9FSKeSx.js +14603 -0
- package/vendor/chunk-CPArXGxa.js +14623 -0
- package/vendor/cjs-module-lexer.js +6 -0
- package/vendor/dotenv.js +412 -0
- package/vendor/express.js +40577 -0
- package/vendor/import-meta-resolve.js +2201 -0
- package/vendor/manifest.json +29 -0
- package/vendor/postcss.js +8546 -0
- package/vendor/serialize-javascript.js +293 -0
- package/vendor/sxy-lib-arrays.js +113 -0
- package/vendor/sxy-lib-object-copy.js +1781 -0
- package/vendor/sxy-lib-objects.js +156 -0
- package/vendor/sxy-lib-promises.js +47 -0
- package/vendor/sxy-package-investigator.js +202 -0
- package/vendor/valibot.js +7664 -0
- package/dist/Servers/hono/DevServerHono.d.ts +0 -2
- package/dist/Servers/hono/DevServerHono.d.ts.map +0 -1
- package/dist/Servers/hono/DevServerHono.js +0 -423
- package/dist/Servers/hono/ProdServerHono.d.ts +0 -2
- package/dist/Servers/hono/ProdServerHono.d.ts.map +0 -1
- package/dist/Servers/hono/ProdServerHono.js +0 -220
- package/dist/Servers/hono/TungstenServerHono.d.ts +0 -6
- package/dist/Servers/hono/TungstenServerHono.d.ts.map +0 -1
- package/dist/Servers/hono/TungstenServerHono.js +0 -36
- package/dist/api/ApiEndpointHono.d.ts +0 -3
- package/dist/api/ApiEndpointHono.d.ts.map +0 -1
- package/dist/api/ApiEndpointHono.js +0 -1
- package/dist/api/ApiRouteHono.d.ts +0 -7
- package/dist/api/ApiRouteHono.d.ts.map +0 -1
- package/dist/api/ApiRouteHono.js +0 -1
- package/dist/api/ApiRoutesHono.d.ts +0 -5
- package/dist/api/ApiRoutesHono.d.ts.map +0 -1
- package/dist/api/ApiRoutesHono.js +0 -1
- package/dist/api/getApiRoutesHono.d.ts +0 -6
- package/dist/api/getApiRoutesHono.d.ts.map +0 -1
- package/dist/api/getApiRoutesHono.js +0 -14
- package/dist/build/compilePackages.d.ts +0 -2
- package/dist/build/compilePackages.d.ts.map +0 -1
- package/dist/build/compilePackages.js +0 -89
- package/dist/build/findRequiredUserModule.d.ts +0 -2
- package/dist/build/findRequiredUserModule.d.ts.map +0 -1
- package/dist/build/findRequiredUserModule.js +0 -36
- package/dist/build/processPackage.d.ts +0 -4
- package/dist/build/processPackage.d.ts.map +0 -1
- package/dist/build/processPackage.js +0 -91
- package/dist/build/tallyBabelPlugins.d.ts +0 -3
- package/dist/build/tallyBabelPlugins.d.ts.map +0 -1
- package/dist/build/tallyBabelPlugins.js +0 -68
- package/dist/testing/loadEnvSetup.d.ts +0 -2
- package/dist/testing/loadEnvSetup.d.ts.map +0 -1
- package/dist/testing/loadEnvSetup.js +0 -7
- package/sxy-loader.config.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//import { T } from '@babel/core'
|
|
2
|
-
import { TungstenError } from
|
|
3
|
-
import { throwError } from
|
|
2
|
+
import { TungstenError } from '../TungstenError.js';
|
|
3
|
+
import { throwError } from '../throwError.js';
|
|
4
4
|
// BabelTransformBind
|
|
5
5
|
// exports MakeBabelTransformBind (function)
|
|
6
6
|
//
|
|
@@ -147,6 +147,7 @@ export function MakeBabelTransformBindDirect(/*opts: Opts*/
|
|
|
147
147
|
let setFieldExpression;
|
|
148
148
|
if (stateBased) {
|
|
149
149
|
if (stateSettingMode === 'assignment') {
|
|
150
|
+
// eslint-disable-line @typescript-eslint/no-unnecessary-condition -- other modes kept switchable
|
|
150
151
|
stateAssignmentExpression = make.expressionStatement(make.assignmentExpression('=', originalVariable, make.identifier('value')));
|
|
151
152
|
} else {
|
|
152
153
|
//// unused
|
|
@@ -185,6 +186,7 @@ export function MakeBabelTransformBindDirect(/*opts: Opts*/
|
|
|
185
186
|
else functionBodyExpressions.push(assignToValueVarExpression);
|
|
186
187
|
if (stateBased) {
|
|
187
188
|
if (stateSettingMode === 'assignment') {
|
|
189
|
+
// eslint-disable-line @typescript-eslint/no-unnecessary-condition -- other modes kept switchable
|
|
188
190
|
if (stateAssignmentExpression === undefined) {
|
|
189
191
|
throwError('BabelTransformBindDirect', 'failed to create the state assignment expression');
|
|
190
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformBindVar.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformBindVar.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"BabelTransformBindVar.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformBindVar.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AA0FzD,wBAAgB,yBAAyB,KACC,OAAO,SAAS;;;2BAKvB,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,UAAU;;EAgRjF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//import { T } from '@babel/core'
|
|
2
|
-
import { TungstenError } from
|
|
3
|
-
import { bindableHtmlElements } from
|
|
4
|
-
import { throwError } from
|
|
2
|
+
import { TungstenError } from '../TungstenError.js';
|
|
3
|
+
import { bindableHtmlElements } from '../components/bindable/bindableHtmlElements.js';
|
|
4
|
+
import { throwError } from '../throwError.js';
|
|
5
5
|
// BabelTransformBind
|
|
6
6
|
// exports MakeBabelTransformBind (function)
|
|
7
7
|
//
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { readFileSync } from 'fs';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import { init as lexerInit, parse as lexerParse } from 'cjs-module-lexer';
|
|
5
|
-
import { throwError } from
|
|
5
|
+
import { throwError } from '../throwError.js';
|
|
6
6
|
lexerInit();
|
|
7
7
|
const filenameAndDirnameCode = `import { fileURLToPath } from 'url';
|
|
8
8
|
import { dirname } from 'path';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformComponentState.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformComponentState.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAQ,QAAQ,
|
|
1
|
+
{"version":3,"file":"BabelTransformComponentState.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformComponentState.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EACH,oBAAoB,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAChE,sBAAsB,EAAoB,gBAAgB,EAAE,mBAAmB,EAClF,MAAM,cAAc,CAAA;AAGrB,wBAAgB,gCAAgC,KACC,OAAO,SAAS;;;;wBAuFzC,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC;uBAOtC,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC;;;wBAPpC,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC;uBAOtC,QAAQ,CAAC,WAAW,GAAG,aAAa,CAAC;;mCAgBjB,QAAQ,CAAC,oBAAoB,CAAC;+BA0BlC,QAAQ,CAAC,gBAAgB,CAAC;6BAU5B,QAAQ,CAAC,cAAc,CAAC;kCAqCnB,QAAQ,CAAC,mBAAmB,CAAC;qCAgB1B,QAAQ,CAAC,sBAAsB,CAAC;;EA0B5E"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
// currently not used
|
|
5
5
|
// proxy and deproxy solution seems preferable
|
|
6
|
-
import { arrayMutatingFunctions } from
|
|
7
|
-
import { throwError } from
|
|
6
|
+
import { arrayMutatingFunctions } from '../mutatingFunctions.js';
|
|
7
|
+
import { throwError } from '../throwError.js';
|
|
8
8
|
export function MakeBabelTransformComponentState(/*opts: Opts*/
|
|
9
9
|
) {
|
|
10
10
|
return function BabelTransformComponentState(babel) {
|
|
@@ -10,6 +10,8 @@ type Opts = {
|
|
|
10
10
|
functionNames?: string[];
|
|
11
11
|
modulePrefix?: string;
|
|
12
12
|
watch?: boolean;
|
|
13
|
+
cacheDir?: string | undefined;
|
|
14
|
+
freshCache?: boolean;
|
|
13
15
|
};
|
|
14
16
|
export declare function MakeBabelTransformComponentStyles(opts: Opts): (babel: Babel) => {
|
|
15
17
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformComponentStyles.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformComponentStyles.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"BabelTransformComponentStyles.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformComponentStyles.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAYjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAiRvD,KAAK,IAAI,GAAG;IACR,iBAAiB,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,MAAM,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAKxB,YAAY,CAAC,EAAE,MAAM,CAAA;IAIrB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAE7B,UAAU,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAID,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,IAAI,IAsMV,OAAO,KAAK;;;;6BAMjC,MAAM;;mBAIZ,MAAM;;;uCAkBkB,QAAQ,CAAC,wBAAwB,CAAC;sBAf3D,MAAM;kBACV;gBACF,IAAI;qCATS,MAAM;kBASL;aACjB;+BACkB,MAAM;;;EAsKpC"}
|
|
@@ -9,20 +9,22 @@ import fs from 'fs';
|
|
|
9
9
|
import { join, dirname, basename, relative } from 'path';
|
|
10
10
|
import * as sass from 'sass';
|
|
11
11
|
import postcss from 'postcss';
|
|
12
|
+
import url from 'url';
|
|
12
13
|
import { mapToArray as objectMapToArray } from 'sxy-lib/objects.js';
|
|
13
|
-
import { TransformCssNames } from
|
|
14
|
-
import { CssNames } from
|
|
14
|
+
import { TransformCssNames } from '../postcssPlugins/TransformCssNames.js';
|
|
15
|
+
import { CssNames } from '../CssNames.js';
|
|
15
16
|
//const CSSModulesSync = require('postcss-modules-sync').default
|
|
16
|
-
import { watch } from
|
|
17
|
-
import slash from 'slash';
|
|
17
|
+
import { watch } from '../watch.js';
|
|
18
|
+
import slash from '../slash.js';
|
|
18
19
|
import { resolveSassImport } from 'tungsten/build/resolveSassScssImports.js';
|
|
19
20
|
import { sassImportParser } from 'tungsten/build/sassImportParser.js';
|
|
20
21
|
import { modifySassImports } from 'tungsten/build/modifySassImports.js';
|
|
21
22
|
import { scssImportParserChatgpt } from 'tungsten/build/scssImportParserChatgpt.js';
|
|
22
23
|
import { errorOut } from 'tungsten';
|
|
23
|
-
import { fixImportsInSassErrorMessage } from
|
|
24
|
-
import { throwError } from
|
|
25
|
-
import {
|
|
24
|
+
import { fixImportsInSassErrorMessage } from './fixImportsInSassErrorMessage.js';
|
|
25
|
+
import { throwError } from '../throwError.js';
|
|
26
|
+
import { tallied } from '../timeProfiler.js';
|
|
27
|
+
import { makeComponentStylesCache } from '../build/componentStylesCache.js';
|
|
26
28
|
class StyleAssistant {
|
|
27
29
|
static toCss(data, fullFile, fullSourceFile, importBase) {
|
|
28
30
|
return {
|
|
@@ -72,13 +74,14 @@ class Css extends StyleAssistant {
|
|
|
72
74
|
function sassScssToCss(data, fullFile, fullSourceFile, importBase, syntax) {
|
|
73
75
|
//console.log(`Component SCSS in ${fullSourceFile} to css`)
|
|
74
76
|
const dependencies = new Set();
|
|
77
|
+
// the parser only rewrites imports to tungsten's resolution; the dependencies come from what
|
|
78
|
+
// sass then actually loaded (below), which includes the partials' own imports
|
|
75
79
|
const imports = syntax === 'indented' ? sassImportParser(data) : scssImportParserChatgpt(data);
|
|
76
80
|
const importsMap = [];
|
|
77
81
|
//if (sassImportResolution === 'js') {
|
|
78
82
|
for (const i of imports) {
|
|
79
83
|
const resolved = resolveSassImport(i.target, fullSourceFile, importBase);
|
|
80
84
|
//console.log('relative', fullSourceFile, resolved, slash(relative(dirname(fullSourceFile), resolved)))
|
|
81
|
-
dependencies.add(resolved);
|
|
82
85
|
importsMap.push({
|
|
83
86
|
...i,
|
|
84
87
|
to: slash(relative(dirname(fullSourceFile), resolved)) // should we use absolute or relative?
|
|
@@ -96,9 +99,7 @@ function sassScssToCss(data, fullFile, fullSourceFile, importBase, syntax) {
|
|
|
96
99
|
};
|
|
97
100
|
let compileResult;
|
|
98
101
|
try {
|
|
99
|
-
|
|
100
|
-
compileResult = sass.compileString(data, compileOptions);
|
|
101
|
-
tally('component sass compile', performance.now() - sassStart);
|
|
102
|
+
compileResult = tallied('component sass compile', () => sass.compileString(data, compileOptions));
|
|
102
103
|
} catch (e) {
|
|
103
104
|
if (typeof e !== 'object' || e === null || !('message' in e) || typeof e.message !== 'string') {
|
|
104
105
|
throwError('BabelTransformComponentStyles', `the Sass compiler threw a value without a string message: ${String(e)}`);
|
|
@@ -114,6 +115,12 @@ function sassScssToCss(data, fullFile, fullSourceFile, importBase, syntax) {
|
|
|
114
115
|
const {
|
|
115
116
|
css
|
|
116
117
|
} = compileResult;
|
|
118
|
+
// loadedUrls lists the entry itself too
|
|
119
|
+
const entry = slash(fullSourceFile);
|
|
120
|
+
for (const loaded of compileResult.loadedUrls) {
|
|
121
|
+
const file = slash(url.fileURLToPath(loaded));
|
|
122
|
+
if (file !== entry) dependencies.add(file);
|
|
123
|
+
}
|
|
117
124
|
return {
|
|
118
125
|
// seem to accept a file location, which is needed for imports
|
|
119
126
|
css,
|
|
@@ -216,6 +223,7 @@ export function MakeBabelTransformComponentStyles(opts) {
|
|
|
216
223
|
fs.writeFileSync(opts.cssOutputFile, '');
|
|
217
224
|
}
|
|
218
225
|
const styleDependers = {};
|
|
226
|
+
const stylesCache = makeComponentStylesCache(opts.cacheDir, opts.freshCache === true);
|
|
219
227
|
// start watching for changes to sass files
|
|
220
228
|
if (watchStyles) {
|
|
221
229
|
watch({
|
|
@@ -301,6 +309,7 @@ export function MakeBabelTransformComponentStyles(opts) {
|
|
|
301
309
|
if (typeof opts.cssOutputFile === 'string' && opts.cssOutputFile !== '') {
|
|
302
310
|
//console.log('css:', css)
|
|
303
311
|
if (mode === 'new') {
|
|
312
|
+
// eslint-disable-line @typescript-eslint/no-unnecessary-condition -- 'old' kept switchable
|
|
304
313
|
// write a bunch of @import statements
|
|
305
314
|
fs.writeFileSync(opts.cssOutputFile, Object.values(stylesheets).map(file => `@import "${individualFolderName}/${file}";`).join('\n'));
|
|
306
315
|
} else {
|
|
@@ -353,7 +362,7 @@ export function MakeBabelTransformComponentStyles(opts) {
|
|
|
353
362
|
const tag = tte.tag;
|
|
354
363
|
if (tag.type === 'Identifier' && tag.name in languages) {
|
|
355
364
|
//if ( opts.functionNames.includes(tag.name) ) {
|
|
356
|
-
const tagName = tag.name; // eslint-disable-line
|
|
365
|
+
const tagName = tag.name; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- fine, TS narrowing from the 'in' check above isn't working here
|
|
357
366
|
//console.log('found stylesheet', tag.name)
|
|
358
367
|
const Assistant = languages[tagName];
|
|
359
368
|
const template = tte.quasi.quasis[0];
|
|
@@ -375,10 +384,18 @@ export function MakeBabelTransformComponentStyles(opts) {
|
|
|
375
384
|
const moduleName = getModuleName(relFilePath, state.file.opts.stylesheetIndex);
|
|
376
385
|
//console.log('transforming to css')
|
|
377
386
|
// transform the CSS and find it's dependncies (if using a pre-processor)
|
|
387
|
+
// plain Css has no compile stage worth caching
|
|
388
|
+
const cached = tagName === 'Css' ? undefined : tallied('component styles cache lookup', () => stylesCache.lookup(moduleName, tagName, rawStyles));
|
|
378
389
|
const {
|
|
379
390
|
css,
|
|
380
391
|
dependencies
|
|
381
|
-
} = Assistant.toCss(rawStyles, fullFilePath, fullSourceFilePath, opts.projectAbsStyleImportDir);
|
|
392
|
+
} = cached ?? Assistant.toCss(rawStyles, fullFilePath, fullSourceFilePath, opts.projectAbsStyleImportDir);
|
|
393
|
+
if (cached === undefined && tagName !== 'Css') {
|
|
394
|
+
stylesCache.store(moduleName, tagName, rawStyles, {
|
|
395
|
+
css,
|
|
396
|
+
dependencies
|
|
397
|
+
});
|
|
398
|
+
}
|
|
382
399
|
//console.log('result,', css)
|
|
383
400
|
//////////////////// deps
|
|
384
401
|
//console.log(index, 'watchStyles', watchStyles)
|
|
@@ -421,13 +438,13 @@ export function MakeBabelTransformComponentStyles(opts) {
|
|
|
421
438
|
const {
|
|
422
439
|
names,
|
|
423
440
|
transformedCss
|
|
424
|
-
} = tagName === 'ReactZoneScss' ? cssToReactZoneStyles(css, fullFilePath, moduleName) : cssToLocalClassNames(css, fullFilePath, moduleName);
|
|
441
|
+
} = tallied('component css names (postcss)', () => tagName === 'ReactZoneScss' ? cssToReactZoneStyles(css, fullFilePath, moduleName) : cssToLocalClassNames(css, fullFilePath, moduleName));
|
|
425
442
|
// `#` is a fragment delimiter in the `@import "i/….css"`
|
|
426
443
|
// the manifest is built from, so it cannot survive into
|
|
427
444
|
// a filename. The prefix's trailing `-` keeps the result
|
|
428
445
|
// readable and distinct.
|
|
429
446
|
stylesheets[moduleName] = moduleName.replaceAll('#', '') + '.css';
|
|
430
|
-
writeOutIfNeeded(transformedCss, names, opts);
|
|
447
|
+
tallied('component css write', () => writeOutIfNeeded(transformedCss, names, opts));
|
|
431
448
|
// Kept out of the style object, which ships to the browser: a separate
|
|
432
449
|
// static the build can extract and then erase.
|
|
433
450
|
const classBody = path.findParent(parent => parent.isClassBody());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformCssImports.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformCssImports.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"BabelTransformCssImports.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformCssImports.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAQjD,KAAK,IAAI,GAAG;IACR,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACrB,CAAA;AACD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,IAAI,IACV,OAAO,KAAK;;iBAOvB,UAAU;;kCAUO,QAAQ,CAAC,iBAAiB,CAAC;;EAiJ7E"}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
// that stylesheet
|
|
11
11
|
import { createRequire } from 'module';
|
|
12
12
|
import { dirname } from 'path';
|
|
13
|
-
import slash from 'slash';
|
|
13
|
+
import slash from '../slash.js';
|
|
14
14
|
import { cliError } from 'tungsten/cliOutput.js';
|
|
15
15
|
import { throwError } from 'tungsten/throwError.js';
|
|
16
16
|
import { existsSync } from 'fs';
|
|
17
|
-
import { isBareImport } from
|
|
17
|
+
import { isBareImport } from './isBareImport.js';
|
|
18
18
|
export function MakeBabelTransformCssImports(opts) {
|
|
19
19
|
return function BabelTransformCssImports(babel) {
|
|
20
20
|
const t = babel.types;
|
|
@@ -41,7 +41,7 @@ export function MakeBabelTransformCssImports(opts) {
|
|
|
41
41
|
//console.log('found a css import in', filename)
|
|
42
42
|
//console.log('absCodeDir', opts.absCodeDir)
|
|
43
43
|
//console.log('found stylesheet import', location)
|
|
44
|
-
|
|
44
|
+
const bare = false;
|
|
45
45
|
if (isBareImport(location)) {
|
|
46
46
|
//bare = true
|
|
47
47
|
// cliAlert('Bare CSS import:', location)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// to relative imports e.g. '../../axios', pointing to local (and transpiled?)
|
|
13
13
|
// copies of that package
|
|
14
14
|
import { dirname, relative } from 'path';
|
|
15
|
-
import slash from 'slash';
|
|
15
|
+
import slash from '../slash.js';
|
|
16
16
|
import { createRequire } from 'module';
|
|
17
17
|
export function MakeBabelTransformDependencyImports(opts) {
|
|
18
18
|
return function BabelTransformDependencyImports(babel) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformDeproxyState.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformDeproxyState.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"BabelTransformDeproxyState.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformDeproxyState.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAc,sBAAsB,EAAoB,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAanJ,wBAAgB,8BAA8B,KACC,OAAO,SAAS;;;mCAiDpB,QAAQ,CAAC,oBAAoB,CAAC;6BASpC,QAAQ,CAAC,cAAc,CAAC;kCAgBnB,QAAQ,CAAC,mBAAmB,CAAC;qCAW1B,QAAQ,CAAC,sBAAsB,CAAC;;gBAWrD,SAAS;EAgBhC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// without its proxy wrapper in certain situations -
|
|
6
6
|
// perhaps when passing the state to external functions,
|
|
7
7
|
// not sure
|
|
8
|
-
import { throwError } from
|
|
8
|
+
import { throwError } from '../throwError.js';
|
|
9
9
|
function ExpressionIsMemberExpression(expression) {
|
|
10
10
|
return expression.type === 'MemberExpression';
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformJsxExtensionsToJs.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformJsxExtensionsToJs.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAGrD,wBAAgB,mCAAmC;;;kCAMA,QAAQ,CAAC,iBAAiB,CAAC;;
|
|
1
|
+
{"version":3,"file":"BabelTransformJsxExtensionsToJs.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformJsxExtensionsToJs.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAGrD,wBAAgB,mCAAmC;;;kCAMA,QAAQ,CAAC,iBAAiB,CAAC;;EAa7E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// BabelTransformJsxExtensionsToJs
|
|
2
2
|
// exports MakeBabelTransformJsxExtensionsToJs (function)
|
|
3
3
|
//
|
|
4
|
-
// Converts any imports of .jsx files to .js, as our
|
|
5
|
-
// files will all be .js
|
|
4
|
+
// Converts any imports of .jsx (and, with typescript: true, .ts/.tsx) files to .js, as our
|
|
5
|
+
// compiled files will all be .js
|
|
6
6
|
export function MakeBabelTransformJsxExtensionsToJs(/*opts: Opts*/
|
|
7
7
|
) {
|
|
8
8
|
return function BabelTransformJsxExtensionsToJs(/*babel*/
|
|
@@ -15,6 +15,10 @@ export function MakeBabelTransformJsxExtensionsToJs(/*opts: Opts*/
|
|
|
15
15
|
const location = path.node.source.value;
|
|
16
16
|
if (location.endsWith('.jsx')) {
|
|
17
17
|
path.node.source.value = location.slice(0, -1);
|
|
18
|
+
} else if (location.endsWith('.tsx')) {
|
|
19
|
+
path.node.source.value = `${location.slice(0, -3)}js`;
|
|
20
|
+
} else if (location.endsWith('.ts')) {
|
|
21
|
+
path.node.source.value = `${location.slice(0, -2)}js`;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformPackageImports.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformPackageImports.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"BabelTransformPackageImports.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformPackageImports.ts"],"names":[],"mappings":"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"}
|
|
@@ -9,35 +9,49 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
9
9
|
// The end of the page ('index.js') is determining through import
|
|
10
10
|
// resolution
|
|
11
11
|
import { join, dirname, relative } from 'path';
|
|
12
|
-
import slash from 'slash';
|
|
13
|
-
import precinct from 'precinct';
|
|
14
|
-
//import sxyPrecinct from 'sxy-precinct'
|
|
12
|
+
import slash from '../slash.js';
|
|
15
13
|
import { existsSync, mkdirSync, promises as fsPromises, readFileSync, writeFileSync } from 'fs';
|
|
16
14
|
import { createRequire } from 'module';
|
|
17
15
|
import { transformFileSync as babelTransformFileSync, transformSync as babelTransformSync } from '@babel/core';
|
|
18
16
|
import babelPluginSyntaxImportAssertionsModule from '@babel/plugin-syntax-import-assertions';
|
|
19
|
-
import {
|
|
17
|
+
import { mapToObject } from 'sxy-lib/arrays.js';
|
|
20
18
|
const babelPluginSyntaxImportAssertions = babelPluginSyntaxImportAssertionsModule.default;
|
|
21
19
|
import { init as lexerInit, parse as lexerParse } from 'cjs-module-lexer';
|
|
22
20
|
lexerInit();
|
|
23
|
-
import { MakeBabelTransformCjsToFunction } from
|
|
24
|
-
import { MakeBabelExtractComponentStylesheet } from
|
|
25
|
-
import { recordFrameworkStylesheet } from
|
|
26
|
-
import { MakeBabelTransformDependencyImportsEsm } from
|
|
27
|
-
import { MakeBabelTransformDependencyImportsCjs } from
|
|
28
|
-
import { frameworkDistFolder, packageName as frameworkPackageName, packageName, packagesFolder /*, packagesCacheInfoName*/ } from
|
|
29
|
-
import { findProjectDir } from
|
|
30
|
-
import { cliError, cliWarn, cliNote, cliInfo, cliNews } from
|
|
31
|
-
import { isBareImport } from
|
|
32
|
-
import { resolveBareImport } from
|
|
33
|
-
import { TungstenError } from
|
|
34
|
-
import { throwError } from
|
|
35
|
-
import { isProfiling,
|
|
21
|
+
import { MakeBabelTransformCjsToFunction } from './BabelTransformCjsToFunction.js';
|
|
22
|
+
import { MakeBabelExtractComponentStylesheet } from './BabelExtractComponentStylesheet.js';
|
|
23
|
+
import { recordFrameworkStylesheet } from '../build/frameworkStylesheets.js';
|
|
24
|
+
import { MakeBabelTransformDependencyImportsEsm } from './transformPackageImports/BabelTransformDependencyImportsEsm.js';
|
|
25
|
+
import { MakeBabelTransformDependencyImportsCjs } from './transformPackageImports/BabelTransformDependencyImportsCjs.js';
|
|
26
|
+
import { frameworkDistFolder, packageName as frameworkPackageName, packageName, packagesFolder /*, packagesCacheInfoName*/ } from '../settings.js';
|
|
27
|
+
import { findProjectDir } from '../findProjectDir.js';
|
|
28
|
+
import { cliError, cliWarn, cliNote, cliInfo, cliNews } from '../cliOutput.js';
|
|
29
|
+
import { isBareImport } from './isBareImport.js';
|
|
30
|
+
import { resolveBareImport } from './transformPackageImports/resolveBareImport.js';
|
|
31
|
+
import { TungstenError } from '../TungstenError.js';
|
|
32
|
+
import { throwError } from '../throwError.js';
|
|
33
|
+
import { isProfiling, tallied } from '../timeProfiler.js';
|
|
36
34
|
//import { copyPackageModulesToPackagesFolder } from '../build/copyPackageModulesToPackagesFolder.js'
|
|
37
35
|
const require = createRequire(import.meta.url);
|
|
36
|
+
// precinct drags in typescript and the typescript-eslint parser (~250 modules), so it is only
|
|
37
|
+
// paid for on a packages-cache miss
|
|
38
|
+
let precinctLoaded;
|
|
39
|
+
function precinct() {
|
|
40
|
+
return precinctLoaded ??= require('precinct'); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- require() is untyped
|
|
41
|
+
}
|
|
38
42
|
function debug(...texts) {
|
|
39
43
|
//console.log(...texts)
|
|
40
44
|
}
|
|
45
|
+
// '@scope/name@1.2.3/dist/index.js' -> its package identifier and the file's path within the package
|
|
46
|
+
function breakFileIdentifier(fileIdentifier) {
|
|
47
|
+
// a scoped name starts with @, so the version's @ is the next one
|
|
48
|
+
const atPos = fileIdentifier.indexOf('@', fileIdentifier.startsWith('@') ? 1 : 0);
|
|
49
|
+
const startOfInternal = fileIdentifier.indexOf('/', atPos);
|
|
50
|
+
return {
|
|
51
|
+
packageIdentifier: fileIdentifier.slice(0, startOfInternal),
|
|
52
|
+
relFile: fileIdentifier.slice(startOfInternal + 1)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
41
55
|
class UnsupportedCompiledDependencyError extends TungstenError {
|
|
42
56
|
constructor(dependency, importedFrom, importHistory, options) {
|
|
43
57
|
super(`Could not resolve ${dependency} from ${importedFrom}`);
|
|
@@ -210,11 +224,9 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
210
224
|
const {
|
|
211
225
|
file
|
|
212
226
|
} = fileInfo;
|
|
213
|
-
const
|
|
214
|
-
const precinctResults = precinct.paperwork(file, {
|
|
227
|
+
const precinctResults = tallied('precinct.paperwork', () => precinct().paperwork(file, {
|
|
215
228
|
includeCore: false
|
|
216
|
-
});
|
|
217
|
-
tally('precinct.paperwork', performance.now() - precinctStart);
|
|
229
|
+
}));
|
|
218
230
|
const deps = precinctResults.map(d => {
|
|
219
231
|
//console.log('getFileDependencies', 'd', d)
|
|
220
232
|
return isBareImport(d) ? applyImportAliases(d, fileInfo.type) : d;
|
|
@@ -348,9 +360,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
348
360
|
async function babelFileEsm(file /*, packageInfo*/, nonEsmDeps, onStylesheet) {
|
|
349
361
|
// Sync, so it can be tallied: these run concurrently in the deferred package work, where a
|
|
350
362
|
// wall clock around an async call would count the same time once per file in flight.
|
|
351
|
-
const
|
|
352
|
-
const result = babelTransformFileSync(file, makeModifyImportsEsmBabelOptions(nonEsmDeps.map(d => d.webLocation), onStylesheet));
|
|
353
|
-
tally('babel transform (packages)', performance.now() - esmStart);
|
|
363
|
+
const result = tallied('babel transform (packages)', () => babelTransformFileSync(file, makeModifyImportsEsmBabelOptions(nonEsmDeps.map(d => d.webLocation), onStylesheet)));
|
|
354
364
|
if (result === null) {
|
|
355
365
|
throw new TungstenError(`BabelTransformPackageImports error: sub file babel transform (1) returned null: ${file}`);
|
|
356
366
|
}
|
|
@@ -384,9 +394,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
384
394
|
async function babelFileCjs(file, cacheDest, finalDest, packageInfo, nonEsmDeps) {
|
|
385
395
|
//console.log(chalk.yellow`cjs file ${file}`)
|
|
386
396
|
const nonEsmDepsWebPath = nonEsmDeps.map(fi => fi.webLocation);
|
|
387
|
-
|
|
388
|
-
let result = babelTransformFileSync(file, makeCjsToEsmBabelOptions(nonEsmDepsWebPath));
|
|
389
|
-
tally('babel transform (packages)', performance.now() - cjsStart);
|
|
397
|
+
let result = tallied('babel transform (packages)', () => babelTransformFileSync(file, makeCjsToEsmBabelOptions(nonEsmDepsWebPath)));
|
|
390
398
|
if (result === null) {
|
|
391
399
|
throw new TungstenError(`BabelTransformPackageImports error: sub file babel transform (2) returned null: ${file}`);
|
|
392
400
|
}
|
|
@@ -399,12 +407,11 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
399
407
|
});
|
|
400
408
|
//console.log('writing file', intermedCacheLocation)
|
|
401
409
|
await fsPromises.writeFile(intermedCacheLocation, result.code); // rel contains the slash at start
|
|
402
|
-
const
|
|
403
|
-
result = babelTransformSync(
|
|
410
|
+
const code = result.code;
|
|
411
|
+
result = tallied('babel transform (packages)', () => babelTransformSync(code, {
|
|
404
412
|
filename: file,
|
|
405
413
|
...makeModifyImportsCjsBabelOptions(nonEsmDepsWebPath)
|
|
406
|
-
});
|
|
407
|
-
tally('babel transform (packages)', performance.now() - cjsImportsStart);
|
|
414
|
+
}));
|
|
408
415
|
if (result === null) {
|
|
409
416
|
throw new TungstenError(`BabelTransformPackageImports error: sub file babel transform (3) returned null: ${file}
|
|
410
417
|
`);
|
|
@@ -567,6 +574,24 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
567
574
|
// A cached file is only reusable if its whole dependency closure is too: processCacheDependencies
|
|
568
575
|
// walks that closure from identifiers alone and has no way to resolve one back to a source file
|
|
569
576
|
// to compile instead, so the entire subtree is checked before any of it is used.
|
|
577
|
+
// Existence is checked per package directory, not per file. An installed package at a version
|
|
578
|
+
// has all its files, and the graph is written only once a run has completed, so a cache
|
|
579
|
+
// directory a node names is whole unless deleted by hand - `--fresh` covers that. Two stats per
|
|
580
|
+
// node were ~85ms of a full-hit start on 327 nodes; a recursive readdirSync of the cache was
|
|
581
|
+
// 68ms, so it was not taken either.
|
|
582
|
+
const dirsKnown = new Map();
|
|
583
|
+
function dirExists(dir) {
|
|
584
|
+
let known = dirsKnown.get(dir);
|
|
585
|
+
if (known === undefined) dirsKnown.set(dir, known = existsSync(dir));
|
|
586
|
+
return known;
|
|
587
|
+
}
|
|
588
|
+
function packageDirsExist(fileIdentifier, node) {
|
|
589
|
+
// both locations end in the file's path within its package; what precedes it is the package
|
|
590
|
+
const {
|
|
591
|
+
relFile
|
|
592
|
+
} = breakFileIdentifier(fileIdentifier);
|
|
593
|
+
return dirExists(node.originalLocation.slice(0, -relFile.length)) && dirExists(node.cacheLocation.slice(0, -relFile.length));
|
|
594
|
+
}
|
|
570
595
|
const subtreeUsable = new Map();
|
|
571
596
|
function cachedSubtreeIsUsable(fileIdentifier, visiting) {
|
|
572
597
|
const settled = subtreeUsable.get(fileIdentifier);
|
|
@@ -579,7 +604,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
579
604
|
// pays rather than recompiling a linked framework's every file. The cache key is the
|
|
580
605
|
// version, which a linked package changes underneath, so a profiled run can compile stale
|
|
581
606
|
// code after that package is rebuilt until the packages cache is deleted - it warns.
|
|
582
|
-
const usable = node !== undefined && (isProfiling() || cacheKeyIdentifiesContent(node.originalLocation)) &&
|
|
607
|
+
const usable = node !== undefined && (isProfiling() || cacheKeyIdentifiesContent(node.originalLocation)) && tallied('package dirs exist', () => packageDirsExist(fileIdentifier, node)) && (node.dependencies ?? []).every(dep => cachedSubtreeIsUsable(dep, visiting));
|
|
583
608
|
visiting.delete(fileIdentifier);
|
|
584
609
|
subtreeUsable.set(fileIdentifier, usable);
|
|
585
610
|
return usable;
|
|
@@ -600,7 +625,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
600
625
|
} else {
|
|
601
626
|
processedFilesCache[file] = fileInfo.packageInfo;
|
|
602
627
|
const cacheNode = opts.oldDependencyGraph[fileInfo.fileIdentifier];
|
|
603
|
-
if (cacheNode !== undefined && cachedSubtreeIsUsable(fileInfo.fileIdentifier, new Set())) {
|
|
628
|
+
if (cacheNode !== undefined && tallied('cached subtree check', () => cachedSubtreeIsUsable(fileInfo.fileIdentifier, new Set()))) {
|
|
604
629
|
await copyFileFromCache(fileInfo.fileIdentifier, cacheNode);
|
|
605
630
|
} else {
|
|
606
631
|
await doProcessFile(fileInfo, sourceFilename, history);
|
|
@@ -660,8 +685,10 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
660
685
|
if (cachedFileInfo) {
|
|
661
686
|
return cachedFileInfo;
|
|
662
687
|
} else {
|
|
663
|
-
const fileInfo = resolveFile(file);
|
|
664
|
-
|
|
688
|
+
const fileInfo = tallied('resolve file', () => resolveFile(file));
|
|
689
|
+
// async: the tally covers its synchronous prefix, up to the first await
|
|
690
|
+
const processing = tallied('start processing file', () => processFile(fileInfo, sourceFilename, [sourceFilename]));
|
|
691
|
+
opts.promises.push(processing.catch(error => {
|
|
665
692
|
if (error instanceof UnsupportedCompiledDependencyError) {
|
|
666
693
|
cliError(formatUnsupportedDependencyError(error));
|
|
667
694
|
} else {
|
|
@@ -701,7 +728,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
701
728
|
reexports
|
|
702
729
|
} = lexerParse(code);
|
|
703
730
|
//console.log('lexInner exports', exports)
|
|
704
|
-
const exportsMap =
|
|
731
|
+
const exportsMap = mapToObject(exports, value => [value, true]);
|
|
705
732
|
//console.log('lexInner exports map', exportsMap)
|
|
706
733
|
for (const re of reexports) {
|
|
707
734
|
try {
|
|
@@ -775,18 +802,18 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
775
802
|
// const location = source.value
|
|
776
803
|
// }
|
|
777
804
|
// }
|
|
778
|
-
// Resolution is this visitor's whole cost - ~2ms of node_modules walking per bare import
|
|
779
|
-
//
|
|
780
|
-
//
|
|
781
|
-
//
|
|
782
|
-
//
|
|
805
|
+
// Resolution is this visitor's whole cost - ~2ms of node_modules walking per bare import.
|
|
806
|
+
// Every importer is under the one code dir, so they all walk the same node_modules chain
|
|
807
|
+
// and a specifier resolves identically wherever it is imported from (tungsten/jsx-runtime,
|
|
808
|
+
// from every component): one resolution per specifier, not per importer directory. A
|
|
809
|
+
// node_modules nested inside the code dir would break that; none is expected. Lives as long
|
|
810
|
+
// as the plugin, like importedPackageFiles, so a package changed in place is stale in both.
|
|
783
811
|
const resolvedImports = new Map();
|
|
784
812
|
function resolveImportTarget(location, fromDir, requireFrom) {
|
|
785
|
-
const
|
|
786
|
-
const known = resolvedImports.get(key);
|
|
813
|
+
const known = resolvedImports.get(location);
|
|
787
814
|
if (known !== undefined) return known;
|
|
788
815
|
const target = resolveBareImport(location, [fromDir]) ?? requireFrom.resolve(location);
|
|
789
|
-
resolvedImports.set(
|
|
816
|
+
resolvedImports.set(location, target);
|
|
790
817
|
return target;
|
|
791
818
|
}
|
|
792
819
|
return {
|
|
@@ -810,7 +837,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
810
837
|
ImportDeclaration: function (path) {
|
|
811
838
|
if (skipPackageCompilationForFile) return;
|
|
812
839
|
try {
|
|
813
|
-
|
|
840
|
+
const location = path.node.source.value;
|
|
814
841
|
//console.log('BabelTransformPackageImports', 'ImportDeclaration', location)
|
|
815
842
|
// see if it is a bare import
|
|
816
843
|
if (isBareImport(location)) {
|
|
@@ -823,15 +850,10 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
823
850
|
// throwError('BabelTransformPackageImports', 'Found an import to a node package in user code.')
|
|
824
851
|
// }
|
|
825
852
|
//console.log('*', filename, 'processing bare import', location)
|
|
826
|
-
// hacky alias
|
|
827
|
-
if (location === 'tungsten/jsx-runtime') {
|
|
828
|
-
//console.log(chalk.orange`We did the hacky jsx runtime alias in BabelTransformPackageImports`)
|
|
829
|
-
location = 'tungsten/jsxRuntime.js';
|
|
830
|
-
}
|
|
831
853
|
// the real file location of the file being imported.
|
|
832
854
|
// User code is served as ESM, so it resolves with the 'import'
|
|
833
855
|
// condition - see resolvePrecinctDependencies()
|
|
834
|
-
const importTarget = resolveImportTarget(location, dirname(filename), require);
|
|
856
|
+
const importTarget = tallied('resolve import target', () => resolveImportTarget(location, dirname(filename), require));
|
|
835
857
|
// Should do some checking here to show helpful errors about bad imports
|
|
836
858
|
if (importTarget === location) {
|
|
837
859
|
//console.log()
|
|
@@ -847,7 +869,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
847
869
|
return;
|
|
848
870
|
}
|
|
849
871
|
//console.log('** importTarget', importTarget)
|
|
850
|
-
const fileInfo = processPackageFile(importTarget, filename);
|
|
872
|
+
const fileInfo = tallied('process package file', () => processPackageFile(importTarget, filename));
|
|
851
873
|
const {
|
|
852
874
|
file: sourceFile,
|
|
853
875
|
finalDest,
|
|
@@ -868,7 +890,7 @@ export function MakeBabelTransformPackageImports(opts) {
|
|
|
868
890
|
addImportAlias(location, webLocation);
|
|
869
891
|
//console.log('add alias for', location)
|
|
870
892
|
} else {
|
|
871
|
-
const entryFile = makeCjsEntryFile(sourceFile, webLocation);
|
|
893
|
+
const entryFile = tallied('make cjs entry file', () => makeCjsEntryFile(sourceFile, webLocation));
|
|
872
894
|
addImportAlias(location, entryFile);
|
|
873
895
|
//console.log('add alias for', location)
|
|
874
896
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// exports MakeBabelTransformBind (function)
|
|
3
3
|
//
|
|
4
4
|
//
|
|
5
|
-
import { throwError } from
|
|
5
|
+
import { throwError } from '../throwError.js';
|
|
6
6
|
/////////////////////////////////////////////////
|
|
7
7
|
// Is this WIP?
|
|
8
8
|
/////////////////////////////////////////////////
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformRemoveBlocks.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformRemoveBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"BabelTransformRemoveBlocks.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformRemoveBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAc,qBAAqB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE7E,KAAK,IAAI,GAAG;IACR,KAAK,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI;;0BAmBvB,QAAQ,CAAC,WAAW,CAAC;oCAWX,QAAQ,CAAC,qBAAqB,CAAC;;EAS1E"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Seems to convert imports of 'tungsten' to import from the
|
|
5
5
|
// compiled tungsten packages in <buildLocation>/<packagesFolder>
|
|
6
6
|
// but not sure this is working/in use
|
|
7
|
-
import { packagesFolder } from
|
|
7
|
+
import { packagesFolder } from '../settings.js';
|
|
8
8
|
// type Opts = {
|
|
9
9
|
// }
|
|
10
10
|
export function MakeBabelTransformTungstenFrameworkImports(/*opts: Opts*/
|