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,220 +0,0 @@
|
|
|
1
|
-
// Status/known gaps: see ./README.md
|
|
2
|
-
// import { Context, Hono } from 'hono'
|
|
3
|
-
// import { serve, type ServerType } from '@hono/node-server'
|
|
4
|
-
// import { serveStatic } from '@hono/node-server/serve-static'
|
|
5
|
-
// import { join } from 'path'
|
|
6
|
-
// import { existsSync } from 'fs'
|
|
7
|
-
// import type { FrameworkConfigComplete } from '../../FrameworkConfig.js'
|
|
8
|
-
// import type { CompilationInfo } from '../../build/CompilationInfo.js'
|
|
9
|
-
// import type { ApiRoutes } from '../../api/ApiRoutes.js'
|
|
10
|
-
// import { staticFolder, assetsFolder, packageNameCapitalized, publicFolder } from '../../settings.js'
|
|
11
|
-
// import { rootToHtml as renderRootToHtml } from '../../render/rootToHtml.js'
|
|
12
|
-
// import { contentToHtml as renderContentToHtml } from '../../render/contentToHtml.js'
|
|
13
|
-
// import { Instance } from '../../Instance/Instance.js'
|
|
14
|
-
// import { cliOut, cliWarn, cliLog, cliNews, cliDebug, cliTodo } from '../../cliOutput.js' // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
15
|
-
// import { Framework } from '../../Framework.js'
|
|
16
|
-
// import { TungstenError } from '../../TungstenError.js'
|
|
17
|
-
// import { makeInstanceConfigFromFrameworkConfig } from '../../makeInstanceConfigFromFrameworkConfig.js'
|
|
18
|
-
// import { standardizeWebPath } from '../../standardizeWebPath.js'
|
|
19
|
-
// import { throwError } from '../../throwError.js'
|
|
20
|
-
// import { AnyComponentType } from '../../AnyComponentType.js'
|
|
21
|
-
// import { AppRoutes } from '../../routing/AppRoutes.js'
|
|
22
|
-
// import { ReqRes } from '../../ReqRes.js'
|
|
23
|
-
// import { routing } from '../routing.jsx'
|
|
24
|
-
// import { globalDataFunc } from '../../routing/registerGlobalData.js'
|
|
25
|
-
// import { ServerDataLoading } from '../../Store/ServerDataLoading.js'
|
|
26
|
-
// import { ServerMiddleware } from '../ServerMiddleware.js'
|
|
27
|
-
// import { portError } from '../portError.js'
|
|
28
|
-
// import { initStores } from '../initStores.js'
|
|
29
|
-
// import { TungstenServerHono } from './TungstenServerHono.jsx'
|
|
30
|
-
export {};
|
|
31
|
-
// function debug(...texts: any[]) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
32
|
-
// // console.log(...texts)
|
|
33
|
-
// }
|
|
34
|
-
// export class ProdServerHono extends TungstenServerHono {
|
|
35
|
-
// framework: Framework
|
|
36
|
-
// config: FrameworkConfigComplete
|
|
37
|
-
// compilationInfo: CompilationInfo
|
|
38
|
-
// appRoutes: AppRoutes
|
|
39
|
-
// RootComponentOrNull: AnyComponentType | null
|
|
40
|
-
// location: string | null = null
|
|
41
|
-
// app: Hono
|
|
42
|
-
// apiRoutesPromise?: Promise<ApiRoutes>
|
|
43
|
-
// apiRoutes?: ApiRoutes
|
|
44
|
-
// server?: ServerType
|
|
45
|
-
// constructor(
|
|
46
|
-
// framework: Framework,
|
|
47
|
-
// config: FrameworkConfigComplete,
|
|
48
|
-
// compilationInfo: CompilationInfo,
|
|
49
|
-
// appRoutes: AppRoutes,
|
|
50
|
-
// RootComponentOrNull: AnyComponentType | null,
|
|
51
|
-
// serverMiddleware: ServerMiddleware | null
|
|
52
|
-
// ) {
|
|
53
|
-
// super()
|
|
54
|
-
// this.framework = framework
|
|
55
|
-
// this.config = config
|
|
56
|
-
// this.compilationInfo = compilationInfo
|
|
57
|
-
// this.appRoutes = appRoutes
|
|
58
|
-
// this.RootComponentOrNull = RootComponentOrNull
|
|
59
|
-
// this.app = new Hono()
|
|
60
|
-
// if (tungstenPrivateEnv.DEBUG === true) {
|
|
61
|
-
// let reqId = 0
|
|
62
|
-
// this.app.use(async (c, next) => {
|
|
63
|
-
// reqId++
|
|
64
|
-
// cliDebug(`Received request [${reqId}] for ${c.req.url}`)
|
|
65
|
-
// await next()
|
|
66
|
-
// })
|
|
67
|
-
// }
|
|
68
|
-
// const requestLog = (tungstenPrivateEnv.DEBUG === true)
|
|
69
|
-
// const originMismatchWarning = (this.config.suppressOriginMismatchWarning !== true)
|
|
70
|
-
// if (requestLog || originMismatchWarning) {
|
|
71
|
-
// this.app.use(async (c, next) => {
|
|
72
|
-
// const urlObj = new URL(c.req.url)
|
|
73
|
-
// const target = urlObj.origin + c.req.url
|
|
74
|
-
// const origin = c.req.header('origin')
|
|
75
|
-
// if (requestLog) {
|
|
76
|
-
// let message = 'Received request at ' + target
|
|
77
|
-
// if (origin !== undefined) {
|
|
78
|
-
// message += ' from ' + String(c.req.header('origin'))
|
|
79
|
-
// }
|
|
80
|
-
// cliOut(message)
|
|
81
|
-
// }
|
|
82
|
-
// if (originMismatchWarning) {
|
|
83
|
-
// if (origin !== undefined && origin === this.location && origin !== target) {
|
|
84
|
-
// cliWarn(
|
|
85
|
-
// `Received a request from the frontend, but it's origin`
|
|
86
|
-
// + ` is not the same as the request origin.`
|
|
87
|
-
// + ` This may indicate a misconfiguration, and may prevent`
|
|
88
|
-
// + ` the passing of cookies to the tungsten server.`
|
|
89
|
-
// )
|
|
90
|
-
// }
|
|
91
|
-
// }
|
|
92
|
-
// await next()
|
|
93
|
-
// })
|
|
94
|
-
// }
|
|
95
|
-
// // serverMiddleware isn't ported to Hono yet - it's a list of Express RequestHandlers,
|
|
96
|
-
// // which Hono's middleware signature can't run directly.
|
|
97
|
-
// if (serverMiddleware) {
|
|
98
|
-
// cliWarn('ProdServerHono: serverMiddleware is not yet supported on the Hono server')
|
|
99
|
-
// }
|
|
100
|
-
// if (this.compilationInfo.bundleLocation === undefined) {
|
|
101
|
-
// throwError('ProdServerHono', 'compilationInfo.bundleLocation is unset/undefined')
|
|
102
|
-
// }
|
|
103
|
-
// this.app.use('/bundle/*', serveStatic({ root: this.compilationInfo.bundleLocation }))
|
|
104
|
-
// const publicLocation = join(this.compilationInfo.location, publicFolder)
|
|
105
|
-
// if (existsSync(publicLocation)) this.app.use(serveStatic({ root: publicLocation })) // files from public folder
|
|
106
|
-
// this.app.use(serveStatic({ root: join(this.compilationInfo.location, staticFolder) }))
|
|
107
|
-
// if (this.config.assetsDir !== undefined) {
|
|
108
|
-
// this.app.use('/assets/*', serveStatic({ root: join(this.compilationInfo.location, assetsFolder) }))
|
|
109
|
-
// }
|
|
110
|
-
// this.app.use(serveStatic({ root: this.compilationInfo.location }))
|
|
111
|
-
// if (typeof config.apiRoutes === 'string' && config.apiRoutes !== '') {
|
|
112
|
-
// const apiPath = standardizeWebPath(this.config.apiPath)
|
|
113
|
-
// cliOut(`API listening at ${apiPath}`)
|
|
114
|
-
// this.app.use(apiPath, this.handleRequestApi)
|
|
115
|
-
// }
|
|
116
|
-
// this.app.use(this.handleRequest)
|
|
117
|
-
// }
|
|
118
|
-
// private handleRequestApi = async (c: Context): Promise<Response> => { // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
119
|
-
// //this.apiRoutes = await this.apiRoutesPromise
|
|
120
|
-
// throw new TungstenError(`handleRequestApi incomplete in dev server - add to get the API in the build step`)
|
|
121
|
-
// }
|
|
122
|
-
// handleRequest = async (c: Context): Promise<Response> => {
|
|
123
|
-
// const { req } = c
|
|
124
|
-
// if (/\.(css|scss|sass|js|jsx|png|jpg|jpeg|svg|ico|txt)$/.test(req.path)) {
|
|
125
|
-
// cliLog(`Requested asset file ${req.url} was not found`)
|
|
126
|
-
// return c.notFound()
|
|
127
|
-
// }
|
|
128
|
-
// try {
|
|
129
|
-
// const location = req.url
|
|
130
|
-
// const instanceConfig = makeInstanceConfigFromFrameworkConfig(this.config)
|
|
131
|
-
// if (this.framework.frameworkModules === undefined) {
|
|
132
|
-
// throwError('ProdServerHono.handleRequest()',
|
|
133
|
-
// 'framework.frameworkModules is undefined'
|
|
134
|
-
// )
|
|
135
|
-
// }
|
|
136
|
-
// if (this.framework.clientImportAliases === undefined) {
|
|
137
|
-
// throwError('ProdServerHono.handleRequest()',
|
|
138
|
-
// 'framework.clientImportAliases is undefined'
|
|
139
|
-
// )
|
|
140
|
-
// }
|
|
141
|
-
// const { compilationInfo, config, appRoutes, RootComponentOrNull } = this
|
|
142
|
-
// // ReqRes is Express-shaped ({req, res}) and Hono's Context isn't - this cast is a
|
|
143
|
-
// // type-only bridge so the (Express-only) Instance/initStores/routing plumbing below
|
|
144
|
-
// // still compiles. Not behaviorally correct; fine since this prod server isn't wired
|
|
145
|
-
// // up anywhere live.
|
|
146
|
-
// // eslint-disable-next-line no-type-assertion/no-type-assertion -- see comment above
|
|
147
|
-
// const reqRes = c as unknown as ReqRes
|
|
148
|
-
// const serverDataLoading: ServerDataLoading = { value: false }
|
|
149
|
-
// const routes = (typeof appRoutes === 'function') ? appRoutes(reqRes) : appRoutes
|
|
150
|
-
// const [globalData, matchedRouteInfo] = await Promise.all([
|
|
151
|
-
// (globalDataFunc.value !== undefined) ? globalDataFunc.value(reqRes) : {},
|
|
152
|
-
// routing(location, routes, serverDataLoading)
|
|
153
|
-
// ])
|
|
154
|
-
// const redirected = this.handleRedirects(c, matchedRouteInfo)
|
|
155
|
-
// if (redirected !== false) return redirected // end early
|
|
156
|
-
// const { internalStore, stores, storeSubscriptions }
|
|
157
|
-
// = initStores(location, reqRes, globalData, matchedRouteInfo, serverDataLoading)
|
|
158
|
-
// const instance = new Instance(
|
|
159
|
-
// location, instanceConfig, reqRes, appRoutes, routes, internalStore,
|
|
160
|
-
// stores, storeSubscriptions, globalData, matchedRouteInfo
|
|
161
|
-
// )
|
|
162
|
-
// let html: string
|
|
163
|
-
// if (RootComponentOrNull !== null) {
|
|
164
|
-
// html = await renderRootToHtml(
|
|
165
|
-
// this.compilationInfo, this.framework.clientImportAliases,
|
|
166
|
-
// RootComponentOrNull, instance, config, this.config.siteBasePath
|
|
167
|
-
// )
|
|
168
|
-
// } else {
|
|
169
|
-
// const { params, data } = matchedRouteInfo
|
|
170
|
-
// let { content } = matchedRouteInfo
|
|
171
|
-
// if (typeof content === 'function') {
|
|
172
|
-
// content = content(data, params, {} /* props */, globalData, location)
|
|
173
|
-
// }
|
|
174
|
-
// html = await renderContentToHtml(
|
|
175
|
-
// this.compilationInfo, this.framework.clientImportAliases,
|
|
176
|
-
// content, instance, config, this.config.siteBasePath
|
|
177
|
-
// )
|
|
178
|
-
// }
|
|
179
|
-
// return c.html(html, (instance.matchedRouteInfo.key === '404') ? 404 : 200)
|
|
180
|
-
// } catch(e) {
|
|
181
|
-
// cliLog('handleRequest() error', e)
|
|
182
|
-
// return c.html(this.errorPage(), 500)
|
|
183
|
-
// }
|
|
184
|
-
// }
|
|
185
|
-
// errorPage = () => {
|
|
186
|
-
// return `<!DOCTYPE html>
|
|
187
|
-
// </html>
|
|
188
|
-
// <head><title>Error</title></head>
|
|
189
|
-
// <body>
|
|
190
|
-
// <h1>Internal error</h1>
|
|
191
|
-
// <p>Something went wrong. Please contact the site owner for help.</p>
|
|
192
|
-
// </body>
|
|
193
|
-
// </html>`
|
|
194
|
-
// }
|
|
195
|
-
// // I don't think we ever override the port, not sure why
|
|
196
|
-
// start(portOverride?: number | null, mute = false): Promise<string> {
|
|
197
|
-
// return new Promise( (resolve) => {
|
|
198
|
-
// const proto = tungstenPublicEnv.FRONTEND_PROTO ?? 'http'
|
|
199
|
-
// const host = tungstenPublicEnv.FRONTEND_HOST ?? 'localhost'
|
|
200
|
-
// let port: number | null
|
|
201
|
-
// if (portOverride !== undefined) {
|
|
202
|
-
// port = portOverride
|
|
203
|
-
// } else {
|
|
204
|
-
// const _port = tungstenPrivateEnv.TUNGSTEN_SERVER_PORT ?? 3000
|
|
205
|
-
// if (isNaN(_port) || _port === 0) throwError('ProdServerHono', portError(_port))
|
|
206
|
-
// port = _port
|
|
207
|
-
// }
|
|
208
|
-
// if (port === null) throwError('ProdServerHono', portError(NaN))
|
|
209
|
-
// if (isNaN(port) || port === 0) throwError('ProdServerHono', portError(port))
|
|
210
|
-
// this.server = serve({ fetch: this.app.fetch, port }, info => {
|
|
211
|
-
// this.location = `${proto}://${host}:${info.port}`
|
|
212
|
-
// if (!mute) cliNews(`${packageNameCapitalized} prod server ready at ${this.location}`)
|
|
213
|
-
// resolve(this.location)
|
|
214
|
-
// })
|
|
215
|
-
// })
|
|
216
|
-
// }
|
|
217
|
-
// stop() {
|
|
218
|
-
// if (this.server !== undefined) this.server.close()
|
|
219
|
-
// }
|
|
220
|
-
// }
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { MatchedRouteInfo } from '../MatchedRouteInfo.js';
|
|
2
|
-
import type { Context } from 'hono';
|
|
3
|
-
export declare class TungstenServerHono {
|
|
4
|
-
protected handleRedirects(c: Context, matchedRouteInfo: MatchedRouteInfo): Response | false;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=TungstenServerHono.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TungstenServerHono.d.ts","sourceRoot":"","sources":["../../../src/Servers/hono/TungstenServerHono.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAUnC,qBAAa,kBAAkB;IAI3B,SAAS,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,EAAY,gBAAgB,EAAE,gBAAgB,GAAG,QAAQ,GAAG,KAAK;CAoCxG"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ContentNodeIsClassComponent } from "../../ContentNode.js";
|
|
2
|
-
import { RoutingRedirect } from "../../routing/RoutingRedirect.js";
|
|
3
|
-
import { cliTodo } from "../../cliOutput.js";
|
|
4
|
-
import { RouteRedirectComponent } from "../../components/RouteRedirectComponent.js";
|
|
5
|
-
import { WebRedirectComponent } from "../../components/WebRedirectComponent.js";
|
|
6
|
-
import { $props, $type } from "../../contentNodeSymbols.js";
|
|
7
|
-
import { WebRedirect } from "../../routing/WebRedirect.js";
|
|
8
|
-
export class TungstenServerHono {
|
|
9
|
-
// Hono's c.redirect() builds a Response but doesn't send it - unlike Express's res.redirect()
|
|
10
|
-
// (which sends immediately), the caller here must return the Response itself for Hono to
|
|
11
|
-
// actually deliver it. Returns false when there's no redirect to make.
|
|
12
|
-
handleRedirects(c /* any */, matchedRouteInfo) {
|
|
13
|
-
// handle any redirect issued during routing
|
|
14
|
-
if (matchedRouteInfo.data instanceof RoutingRedirect) {
|
|
15
|
-
const redirect = matchedRouteInfo.data;
|
|
16
|
-
return c.redirect(redirect.to, redirect.code);
|
|
17
|
-
} else if (matchedRouteInfo.data instanceof WebRedirect) {
|
|
18
|
-
const redirect = matchedRouteInfo.data;
|
|
19
|
-
return c.redirect(redirect.to, redirect.code);
|
|
20
|
-
}
|
|
21
|
-
if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)) {
|
|
22
|
-
if (matchedRouteInfo.content[$type] === RouteRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof RouteRedirectComponent) {
|
|
23
|
-
cliTodo('consider type of RedirectComponent props');
|
|
24
|
-
const code = matchedRouteInfo.content[$props].code || 302;
|
|
25
|
-
const to = matchedRouteInfo.content[$props].to;
|
|
26
|
-
return c.redirect(to, code);
|
|
27
|
-
} else if (matchedRouteInfo.content[$type] === WebRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof WebRedirectComponent) {
|
|
28
|
-
cliTodo('consider type of RedirectComponent props');
|
|
29
|
-
const code = matchedRouteInfo.content[$props].code || 302;
|
|
30
|
-
const to = matchedRouteInfo.content[$props].to;
|
|
31
|
-
return c.redirect(to, code);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiEndpointHono.d.ts","sourceRoot":"","sources":["../../src/api/ApiEndpointHono.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAEzC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiRouteHono.d.ts","sourceRoot":"","sources":["../../src/api/ApiRouteHono.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,MAAM,YAAY,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,eAAe,CAAA;CAC5B,CAAA"}
|
package/dist/api/ApiRouteHono.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiRoutesHono.d.ts","sourceRoot":"","sources":["../../src/api/ApiRoutesHono.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAC9B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Mode } from '../Mode.js';
|
|
2
|
-
import type { ApiRoutesHono } from './ApiRoutesHono.js';
|
|
3
|
-
import type { CompilationInfo } from '../build/CompilationInfo.js';
|
|
4
|
-
import { FrameworkConfig } from '../FrameworkConfig.js';
|
|
5
|
-
export declare function getApiRoutesHono(config: FrameworkConfig, compilationInfo: CompilationInfo, mode: Mode): Promise<ApiRoutesHono>;
|
|
6
|
-
//# sourceMappingURL=getApiRoutesHono.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getApiRoutesHono.d.ts","sourceRoot":"","sources":["../../src/api/getApiRoutesHono.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAC,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAMvD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,0BAe3G"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { join } from 'path';
|
|
2
|
-
import { TungstenError } from "../TungstenError.js";
|
|
3
|
-
import { getExportDev } from "./getExportDev.js";
|
|
4
|
-
import { getExport } from "./getExport.js";
|
|
5
|
-
export async function getApiRoutesHono(config, compilationInfo, mode) {
|
|
6
|
-
if (typeof config.apiRoutes !== 'string') {
|
|
7
|
-
throw new TungstenError(`getApiRoutes() error - config.apiRoutes is not valid`);
|
|
8
|
-
}
|
|
9
|
-
const apiRoutesFileFull = join(compilationInfo.buildCodeLocation, config.apiRoutes);
|
|
10
|
-
//console.log('rootComponentFileFull', 'xxx', 'config.rootComponent', config.rootComponent)
|
|
11
|
-
//console.log('rootComponentFileFull', apiRoutesFileFull, 'config.rootComponent', config.apiRoutes)
|
|
12
|
-
const apiRoutes = mode === 'dev' ? await getExportDev(apiRoutesFileFull, config.apiRoutes) : await getExport(apiRoutesFileFull, config.apiRoutes);
|
|
13
|
-
return apiRoutes;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compilePackages.d.ts","sourceRoot":"","sources":["../../src/build/compilePackages.ts"],"names":[],"mappings":""}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// import dependencyTree from 'sxy-dependency-tree'
|
|
2
|
-
// import { globby } from 'globby'
|
|
3
|
-
// import slash from 'slash'
|
|
4
|
-
// import { existsSync, promises as fsPromises } from 'fs'
|
|
5
|
-
// import { join } from 'path'
|
|
6
|
-
// import { createRequire } from 'module'
|
|
7
|
-
export {};
|
|
8
|
-
// import type { ProcessPackageResults } from './ProcessPackageResults.js'
|
|
9
|
-
// import type { PackagesCacheInfo } from './PackagesCacheInfo.js'
|
|
10
|
-
// import { processPackage } from './processPackage.js'
|
|
11
|
-
// import {
|
|
12
|
-
// packagesCacheFolder, packagesCacheInfoName, assetsFolder, componentCssFolder, packagesFolder, staticFolder
|
|
13
|
-
// } from '../settings.js'
|
|
14
|
-
// import { cliError } from '../cliOutput.js'
|
|
15
|
-
// const require = createRequire(import.meta.url)
|
|
16
|
-
// type CompilePackagesResult = {
|
|
17
|
-
// packages: ProcessPackageResults
|
|
18
|
-
// }
|
|
19
|
-
// //// UNUSED
|
|
20
|
-
// export function compilePackages(projectDir: string, buildLocation: string): Promise<CompilePackagesResult> {
|
|
21
|
-
// return new Promise( (resolve, reject) => {
|
|
22
|
-
// console.log('start compiling packages')
|
|
23
|
-
// // should we clear out the packages folders, to remove any packages that are no longer used?
|
|
24
|
-
// //or should we check at the end, removing any excess?
|
|
25
|
-
// projectDir = slash(projectDir) // convert backslashes on windows to forward slashes
|
|
26
|
-
// // create a .packages folder if it doesn't already exist??
|
|
27
|
-
// const packagesLocation = `${buildLocation}/${packagesFolder}`
|
|
28
|
-
// if ( ! existsSync(packagesLocation) ) fsPromises.mkdir(packagesLocation)
|
|
29
|
-
// // get info about the packages cache
|
|
30
|
-
// const packagesCacheInfoLocation = join(projectDir, packagesCacheFolder, packagesCacheInfoName)
|
|
31
|
-
// let packagesCacheInfo: PackagesCacheInfo
|
|
32
|
-
// try {
|
|
33
|
-
// packagesCacheInfo = require(packagesCacheInfoLocation)
|
|
34
|
-
// } catch (e) {
|
|
35
|
-
// cliError('error loading package cache info', e)
|
|
36
|
-
// packagesCacheInfo = {}
|
|
37
|
-
// }
|
|
38
|
-
// buildLocation = slash(buildLocation) // convert backslashes on windows to forward slashes
|
|
39
|
-
// const glob = [
|
|
40
|
-
// `${buildLocation}/**/*.js`,
|
|
41
|
-
// `!${buildLocation}/${assetsFolder}/**/*`, // these folders are already ignored unless dot is set to true
|
|
42
|
-
// `!${buildLocation}/${componentCssFolder}/**/*`, //
|
|
43
|
-
// `!${buildLocation}/${packagesFolder}/**/*`, //
|
|
44
|
-
// `!${buildLocation}/${staticFolder}/**/*` //
|
|
45
|
-
// ]
|
|
46
|
-
// //console.log('searching in ', glob)
|
|
47
|
-
// globby(glob, { dot: true }).then( async (matches) => {
|
|
48
|
-
// const projectNodeModulesLocation = `${projectDir}/node_modules/`
|
|
49
|
-
// const projectNodeModulesLocationLength = projectNodeModulesLocation.length
|
|
50
|
-
// const packageDependencies: string[] = []
|
|
51
|
-
// for ( const file of matches ) {
|
|
52
|
-
// const nonExistent: string[] = []
|
|
53
|
-
// const dependencies = dependencyTree.toList({
|
|
54
|
-
// filename: file,
|
|
55
|
-
// directory: projectDir,
|
|
56
|
-
// nonExistent,
|
|
57
|
-
// })
|
|
58
|
-
// for ( let dependency of dependencies ) {
|
|
59
|
-
// dependency = slash(dependency) // convert backslashes on windows to forward slashes
|
|
60
|
-
// if (dependency.startsWith(projectNodeModulesLocation)) {
|
|
61
|
-
// if ( ! packageDependencies.includes(dependency) ) {
|
|
62
|
-
// packageDependencies.push(dependency)
|
|
63
|
-
// }
|
|
64
|
-
// }
|
|
65
|
-
// }
|
|
66
|
-
// }
|
|
67
|
-
// const packages: string[] = []
|
|
68
|
-
// for ( const pDependency of packageDependencies) {
|
|
69
|
-
// const endPart = pDependency.slice(projectNodeModulesLocationLength)
|
|
70
|
-
// const packageName = endPart.split('/')[0]!
|
|
71
|
-
// if (packageName === 'tungsten') continue
|
|
72
|
-
// if ( ! packages.includes(packageName) ) {
|
|
73
|
-
// packages.push(packageName)
|
|
74
|
-
// }
|
|
75
|
-
// }
|
|
76
|
-
// const results: ProcessPackageResults = []
|
|
77
|
-
// for (const p of packages) {
|
|
78
|
-
// results.push( await processPackage(projectDir, packagesCacheInfo, p, buildLocation) )
|
|
79
|
-
// }
|
|
80
|
-
// const packagesLocation = `${buildLocation}/${packagesFolder}`
|
|
81
|
-
// fsPromises.writeFile(join(packagesLocation, '.sxy-packages-stats'), JSON.stringify(results))
|
|
82
|
-
// fsPromises.writeFile(packagesCacheInfoLocation, JSON.stringify(packagesCacheInfo))
|
|
83
|
-
// console.log('finishing compiling packages')
|
|
84
|
-
// resolve( {
|
|
85
|
-
// packages: results
|
|
86
|
-
// } )
|
|
87
|
-
// } )
|
|
88
|
-
// })
|
|
89
|
-
// }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"findRequiredUserModule.d.ts","sourceRoot":"","sources":["../../src/build/findRequiredUserModule.ts"],"names":[],"mappings":"AAIA,wBAAsB,uBAAuB,CAAC,mBAAmB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAkCjG"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { join } from 'path';
|
|
2
|
-
import dependencyTree from 'sxy-dependency-tree';
|
|
3
|
-
export async function findRequiredUserModules(compilationLocation, rootFilePathRel) {
|
|
4
|
-
const rootFilePathFull = join(compilationLocation, rootFilePathRel);
|
|
5
|
-
const projectLocation = process.cwd();
|
|
6
|
-
//const frameworkLocation = findProjectDir(import.meta.url)
|
|
7
|
-
//console.log('frameworkLocation', frameworkLocation)
|
|
8
|
-
const nonExistent = [];
|
|
9
|
-
const dependencies = dependencyTree.toList({
|
|
10
|
-
filename: rootFilePathFull,
|
|
11
|
-
//isListForm: true,
|
|
12
|
-
//directory: dirname(frameworkLocation),
|
|
13
|
-
directory: projectLocation,
|
|
14
|
-
//directory: join(process.cwd(), devBuildFolder),
|
|
15
|
-
nonExistent
|
|
16
|
-
});
|
|
17
|
-
//for ( const dependency of dependencies ) {
|
|
18
|
-
//console.log('dependency', dependency.slice(this.compilationInfo.location.length+1))
|
|
19
|
-
//}
|
|
20
|
-
// won't work because we also need to resolve their deps
|
|
21
|
-
// could do recursion using dependency-tree
|
|
22
|
-
// but rather fix the core issue
|
|
23
|
-
// for ( const unresolvedModule of nonExistent ) {
|
|
24
|
-
// // dependency tree fails on imports to modules using export mapping
|
|
25
|
-
// // so we will check these failures and try to resolve the ourself
|
|
26
|
-
// console.log('unresolved module:', unresolvedModule)
|
|
27
|
-
// if ( ! unresolvedModule.startsWith('.') ) { // only check files that are not relative, as they won't suffer from this issue
|
|
28
|
-
// const targetProjectRoot = findProjectDir(unresolvedModule)
|
|
29
|
-
// console.log('target project root', targetProjectRoot)
|
|
30
|
-
// const location = await esmResolve(unresolvedModule, 'file://' + targetProjectRoot + '/')
|
|
31
|
-
// console.log('resolved location: ', location)
|
|
32
|
-
// if (location) dependencies.push(location)
|
|
33
|
-
// }
|
|
34
|
-
// }
|
|
35
|
-
return dependencies.map(d => d.slice(compilationLocation.length + 1));
|
|
36
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { PackagesCacheInfo } from './PackagesCacheInfo.js';
|
|
2
|
-
import { ProcessPackageResult } from './ProcessPackageResult.js';
|
|
3
|
-
export declare function processPackage(projectDir: string, packagesCacheInfo: PackagesCacheInfo, packageName: string, buildLocation: string): Promise<ProcessPackageResult>;
|
|
4
|
-
//# sourceMappingURL=processPackage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processPackage.d.ts","sourceRoot":"","sources":["../../src/build/processPackage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,EAAE,oBAAoB,EAA4D,MAAM,2BAA2B,CAAA;AAwB1H,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoGxK"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { transform } from 'cjstoesm';
|
|
2
|
-
import { promises as fsPromises } from 'fs';
|
|
3
|
-
import fsExtra from 'fs-extra';
|
|
4
|
-
import { packagesCacheFolder, packagesFolder } from "../settings.js";
|
|
5
|
-
import { removeRecursive } from "../removeRecursive.js";
|
|
6
|
-
import { cliLog } from "../cliOutput.js";
|
|
7
|
-
//import { getFrameworkDir } from '../getFrameworkDir.js'
|
|
8
|
-
//// Don't think we are using this
|
|
9
|
-
function getEntry(packageJson) {
|
|
10
|
-
let entry = packageJson.exports ? 'import' in packageJson.exports['.'] ? packageJson.exports['.'].import : packageJson.exports['.'].default : /*json.browser ||*/packageJson.main || 'index.js'; // I need to research how browser works, then add it
|
|
11
|
-
//console.log('entry 1', entry)
|
|
12
|
-
entry = entry.startsWith('./') ? entry.slice(2) : entry;
|
|
13
|
-
return entry;
|
|
14
|
-
}
|
|
15
|
-
function copyPackageFromCache(packageName, cacheLocation, targetLocation) {
|
|
16
|
-
//console.log('copying package from', cacheLocation, 'to', targetLocation)
|
|
17
|
-
fsExtra.copy(cacheLocation, targetLocation);
|
|
18
|
-
}
|
|
19
|
-
export async function processPackage(projectDir, packagesCacheInfo, packageName, buildLocation) {
|
|
20
|
-
//console.log(`Processing ${packageName}`)
|
|
21
|
-
const projectNodeModulesLocation = `${projectDir}/node_modules`;
|
|
22
|
-
const sourceLocation = `${projectNodeModulesLocation}/${packageName}`;
|
|
23
|
-
const compiledNodeModulesLocation = `${buildLocation}/${packagesFolder}`;
|
|
24
|
-
const targetLocation = `${compiledNodeModulesLocation}/${packageName}`;
|
|
25
|
-
const data = await fsPromises.readFile(new URL(`file://${sourceLocation}/package.json`, import.meta.url), 'utf8');
|
|
26
|
-
const packageJson = JSON.parse(data);
|
|
27
|
-
const {
|
|
28
|
-
version
|
|
29
|
-
} = packageJson;
|
|
30
|
-
const entry = getEntry(packageJson);
|
|
31
|
-
const packageAndVersion = `${packageName}@${version}`;
|
|
32
|
-
const cacheLocation = `${packagesCacheFolder}/${packageAndVersion}`;
|
|
33
|
-
if (packageAndVersion in packagesCacheInfo) {
|
|
34
|
-
console.log(`Found ${packageAndVersion} in pacakges caching - re-using this`);
|
|
35
|
-
copyPackageFromCache(packageName, cacheLocation, targetLocation);
|
|
36
|
-
return {
|
|
37
|
-
packageName,
|
|
38
|
-
success: true,
|
|
39
|
-
version: version,
|
|
40
|
-
entry
|
|
41
|
-
};
|
|
42
|
-
} else {
|
|
43
|
-
console.log(`Didn't find ${packageAndVersion} in packages cached - proceeding`);
|
|
44
|
-
//
|
|
45
|
-
// check if package is esm or cjs?
|
|
46
|
-
await removeRecursive(targetLocation);
|
|
47
|
-
await fsPromises.mkdir(targetLocation);
|
|
48
|
-
//console.log('json for ', packageName, json)
|
|
49
|
-
if (packageJson.type === undefined && packageJson.type !== 'module') {
|
|
50
|
-
cliLog(`${packageName} appears not to be an ES6 package.` + ` Trying to convert from CommonJS to ES6`);
|
|
51
|
-
try {
|
|
52
|
-
const input = `${sourceLocation}/**/*`;
|
|
53
|
-
/// change to cache loc
|
|
54
|
-
//const outDir = targetLocation
|
|
55
|
-
await removeRecursive(cacheLocation);
|
|
56
|
-
await fsPromises.mkdir(cacheLocation);
|
|
57
|
-
await transform({
|
|
58
|
-
input: input,
|
|
59
|
-
outDir: cacheLocation
|
|
60
|
-
});
|
|
61
|
-
packagesCacheInfo[packageAndVersion] = cacheLocation;
|
|
62
|
-
// then copy to targetLocation
|
|
63
|
-
copyPackageFromCache(packageName, cacheLocation, targetLocation);
|
|
64
|
-
//fsExtra.copy(cacheLocation, targetLocation)
|
|
65
|
-
} catch (e) {
|
|
66
|
-
console.log(`Error transforming ${packageName}:`, e);
|
|
67
|
-
return {
|
|
68
|
-
packageName,
|
|
69
|
-
success: false,
|
|
70
|
-
reason: e
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
console.log(`${packageName} transformed`);
|
|
74
|
-
return {
|
|
75
|
-
packageName,
|
|
76
|
-
success: true,
|
|
77
|
-
version: version,
|
|
78
|
-
entry
|
|
79
|
-
};
|
|
80
|
-
} else {
|
|
81
|
-
console.log(`${packageName} appears to be an ES6 package. Copying`);
|
|
82
|
-
fsExtra.copy(sourceLocation, targetLocation);
|
|
83
|
-
return {
|
|
84
|
-
packageName,
|
|
85
|
-
success: true,
|
|
86
|
-
version: packageJson.version,
|
|
87
|
-
entry
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tallyBabelPlugins.d.ts","sourceRoot":"","sources":["../../src/build/tallyBabelPlugins.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AA+DxD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,EAAE,CAUxF"}
|