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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevServerHono.d.ts","sourceRoot":"","sources":["../../../src/Servers/hono/DevServerHono.ts"],"names":[],"mappings":""}
|
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
// Status/known gaps: see ./README.md
|
|
2
|
-
// import { Context, Hono } from 'hono'
|
|
3
|
-
// import type { BlankEnv, BlankSchema, Handler, Next } from 'hono/types'
|
|
4
|
-
// import { serve, type ServerType } from '@hono/node-server'
|
|
5
|
-
// import { serveStatic } from '@hono/node-server/serve-static'
|
|
6
|
-
// import { join } from 'path'
|
|
7
|
-
// import { allObj as promiseAllObj } from 'sxy-lib/promises.js'
|
|
8
|
-
// import type { FrameworkConfigComplete, ServerMiddlewareInfo } from '../../FrameworkConfig.js'
|
|
9
|
-
// import type { CompilationInfo } from '../../build/CompilationInfo.js'
|
|
10
|
-
// import type { ApiRoutes } from '../../api/ApiRoutes.js'
|
|
11
|
-
// import {
|
|
12
|
-
// staticFolder, assetsFolder, publicFolder, packagesFolder, clientFolder, componentCssFolder
|
|
13
|
-
// } from '../../settings.js'
|
|
14
|
-
// import { rootToHtmlDev as renderRootToHtmlDev } from '../../render/rootToHtmlDev.js'
|
|
15
|
-
// import { contentToHtmlDev as renderContentToHtmlDev } from '../../render/contentToHtmlDev.js'
|
|
16
|
-
// import { Instance } from '../../Instance/Instance.js'
|
|
17
|
-
// import { Framework } from '../../Framework.js'
|
|
18
|
-
// import { TungstenError } from '../../TungstenError.js'
|
|
19
|
-
// import { makeInstanceConfigFromFrameworkConfig } from '../../makeInstanceConfigFromFrameworkConfig.js'
|
|
20
|
-
// import { cliNews, cliOut, cliWarn, cliLog, cliDebug, cliTodo, cliAlert } from '../../cliOutput.js' // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
21
|
-
// import { existsSync } from 'fs'
|
|
22
|
-
// import { getApiRoutes } from '../../api/getApiRoutes.js'
|
|
23
|
-
// import { getApiRoutesHono } from '../../api/getApiRoutesHono.js'
|
|
24
|
-
// import { standardizeWebPath } from '../../standardizeWebPath.js'
|
|
25
|
-
// import { log } from '../../appOutput.js'
|
|
26
|
-
// import { throwError } from '../../throwError.js'
|
|
27
|
-
// import { getRoutesDev } from '../../getRoutesDevs.js'
|
|
28
|
-
// import { getComponentDev } from '../../getComponentDev.js'
|
|
29
|
-
// import { ReqRes } from '../../ReqRes.js'
|
|
30
|
-
// import sxyLoaderConfig from '../../../sxy-loader.config.js'
|
|
31
|
-
// import { createLoad } from 'sxy-loader'
|
|
32
|
-
// import { routing } from '../routing.jsx'
|
|
33
|
-
// import { GlobalData, globalDataFunc } from '../../routing/registerGlobalData.js'
|
|
34
|
-
// import { ServerDataLoading } from '../../Store/ServerDataLoading.js'
|
|
35
|
-
// import { TungstenServer } from '../TungstenServer.jsx'
|
|
36
|
-
// import { Routes } from '../../routing/Routes.js'
|
|
37
|
-
// import { portError } from '../portError.js'
|
|
38
|
-
// import { loadEnvsDev } from '../loadEnvsDev.js'
|
|
39
|
-
// import { initStores } from '../initStores.js'
|
|
40
|
-
// import { AppRoutes } from '../../routing/AppRoutes.js'
|
|
41
|
-
// import { AnyComponentType } from '../../AnyComponentType.js'
|
|
42
|
-
// import { MatchedRouteInfo } from '../MatchedRouteInfo.js'
|
|
43
|
-
// import { MatchedRoute } from '../../routing/MatchedRoute.js'
|
|
44
|
-
// import { ContentNodeIsClassComponent } from '../../ContentNode.js'
|
|
45
|
-
// import { $props, $type } from '../../contentNodeSymbols.js'
|
|
46
|
-
// import { Path } from '../../routing/RouteTypes.js'
|
|
47
|
-
// import type { ApiRoutesHono } from '../../api/ApiRoutesHono.js'
|
|
48
|
-
// import { TungstenServerHono } from './TungstenServerHono.jsx'
|
|
49
|
-
export {};
|
|
50
|
-
// //import cookieParser from 'cookie-parser'
|
|
51
|
-
// function debug(...texts: any[]) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
52
|
-
// // console.log(...texts)
|
|
53
|
-
// }
|
|
54
|
-
// export class DevServerHono extends TungstenServerHono {
|
|
55
|
-
// framework: Framework
|
|
56
|
-
// config: FrameworkConfigComplete
|
|
57
|
-
// compilationInfo: CompilationInfo
|
|
58
|
-
// port: number
|
|
59
|
-
// location: string | null = null
|
|
60
|
-
// initialProcessEnv: Record<string, string>
|
|
61
|
-
// app: Hono<BlankEnv, BlankSchema, '/'>
|
|
62
|
-
// apiRoutes?: ApiRoutesHono
|
|
63
|
-
// apiPath?: string
|
|
64
|
-
// server?: ServerType
|
|
65
|
-
// reqId: number
|
|
66
|
-
// firstRender: boolean = true
|
|
67
|
-
// iterationCount: number = 0
|
|
68
|
-
// constructor(
|
|
69
|
-
// framework: Framework, config: FrameworkConfigComplete, compilationInfo: CompilationInfo,
|
|
70
|
-
// initialProcessEnv: Record<string, string> = {}/* FIX ME */
|
|
71
|
-
// ) {
|
|
72
|
-
// super()
|
|
73
|
-
// try {
|
|
74
|
-
// this.framework = framework
|
|
75
|
-
// this.config = config
|
|
76
|
-
// this.compilationInfo = compilationInfo
|
|
77
|
-
// // if (tungstenPrivateEnv.TUNGSTEN_SERVER_PORT === -999) {
|
|
78
|
-
// // throwError(
|
|
79
|
-
// // 'DevServer',
|
|
80
|
-
// // 'TUNGSTEN_SERVER_PORT environment variable has not been set,'
|
|
81
|
-
// // + '\n Ensure that you have an env schema with this field, and a matching env file'
|
|
82
|
-
// // )
|
|
83
|
-
// // }
|
|
84
|
-
// const proto = tungstenPublicEnv.FRONTEND_PROTO ?? 'http'
|
|
85
|
-
// const host = tungstenPublicEnv.FRONTEND_HOST ?? 'localhost'
|
|
86
|
-
// const port = tungstenPrivateEnv.TUNGSTEN_SERVER_PORT ?? 3000
|
|
87
|
-
// if (isNaN(port) || port === 0) throwError('DevServer', portError(port))
|
|
88
|
-
// this.port = port
|
|
89
|
-
// //this.port = _port
|
|
90
|
-
// this.location = `${proto}://${host}:${port}`
|
|
91
|
-
// this.initialProcessEnv = initialProcessEnv
|
|
92
|
-
// this.app = new Hono()
|
|
93
|
-
// this.reqId = 0
|
|
94
|
-
// //this.app.use(cookieParser)
|
|
95
|
-
// let reqId = 0
|
|
96
|
-
// this.app.use(async (c, next) => {
|
|
97
|
-
// reqId++
|
|
98
|
-
// await next()
|
|
99
|
-
// })
|
|
100
|
-
// //if (tungstenPrivateEnv.DEBUG === true) {
|
|
101
|
-
// this.app.use(async (c, next) => {
|
|
102
|
-
// const { req } = c
|
|
103
|
-
// const urlObj = new URL(c.req.url)
|
|
104
|
-
// //const targetOrigin = urlObj.protocol + '://' + String(req.header('host'))
|
|
105
|
-
// const targetOrigin = urlObj.origin
|
|
106
|
-
// const target = targetOrigin + req.url
|
|
107
|
-
// const origin = req.header('origin')
|
|
108
|
-
// // request log
|
|
109
|
-
// let message = 'Received request at ' + target
|
|
110
|
-
// if (origin !== undefined) {
|
|
111
|
-
// message += ' from ' + String(req.header('origin'))
|
|
112
|
-
// // should we use referrer as a backup option?
|
|
113
|
-
// // not sure what that is
|
|
114
|
-
// }
|
|
115
|
-
// cliOut(message)
|
|
116
|
-
// if ((this.config.suppressOriginMismatchWarning !== true)) {
|
|
117
|
-
// // origin-target mismatch warning
|
|
118
|
-
// if (origin !== undefined && origin === this.location && origin !== targetOrigin) {
|
|
119
|
-
// cliWarn(
|
|
120
|
-
// `Received a request from the frontend, but it's origin`
|
|
121
|
-
// + ` is not the same as the request origin.`
|
|
122
|
-
// + ` This may indicate a misconfiguration, and may prevent`
|
|
123
|
-
// + ` the passing of cookies to the tungsten server.`
|
|
124
|
-
// )
|
|
125
|
-
// cliWarn(`source: ${targetOrigin}`)
|
|
126
|
-
// cliWarn(`target: ${target}`)
|
|
127
|
-
// }
|
|
128
|
-
// }
|
|
129
|
-
// next()
|
|
130
|
-
// })
|
|
131
|
-
// // this.app.use((req, res, next) => {
|
|
132
|
-
// // cliDebug(`Received request [${res.locals.reqId}] for ${req.url}`)
|
|
133
|
-
// // next()
|
|
134
|
-
// // })
|
|
135
|
-
// //}
|
|
136
|
-
// if (config.serverMiddleware) { this.addServerMiddleware(config.serverMiddleware) }
|
|
137
|
-
// /// CHECK: Do we need to do this with hono?
|
|
138
|
-
// // can we set the mime type for .cjs files?
|
|
139
|
-
// //express.static.mime.define({'application/javascript': ['cjs']})
|
|
140
|
-
// this.app.use(
|
|
141
|
-
// `/.tungsten.config.js`,
|
|
142
|
-
// //express.static(join(this.compilationInfo.location, '.tungsten.config.js'))
|
|
143
|
-
// serveStatic({ root: join(this.compilationInfo.location, '.tungsten.config.js') })
|
|
144
|
-
// ) // config file
|
|
145
|
-
// this.app.use(
|
|
146
|
-
// `/${packagesFolder}/`,
|
|
147
|
-
// //express.static(join(this.compilationInfo.location, packagesFolder))
|
|
148
|
-
// serveStatic({ root: join(this.compilationInfo.location, packagesFolder) })
|
|
149
|
-
// ) // compiled packages
|
|
150
|
-
// this.app.use(
|
|
151
|
-
// `/${clientFolder}/`,
|
|
152
|
-
// //express.static(join(this.compilationInfo.location, clientFolder))
|
|
153
|
-
// serveStatic({ root: join(this.compilationInfo.location, clientFolder) })
|
|
154
|
-
// ) // ?
|
|
155
|
-
// this.app.use(
|
|
156
|
-
// `/${componentCssFolder}/`,
|
|
157
|
-
// //express.static(join(this.compilationInfo.location, componentCssFolder))
|
|
158
|
-
// serveStatic({ root: join(this.compilationInfo.location, componentCssFolder) })
|
|
159
|
-
// ) // app component css?/s
|
|
160
|
-
// this.app.use(
|
|
161
|
-
// //express.static(join(this.compilationInfo.location, staticFolder))
|
|
162
|
-
// serveStatic({ root: join(this.compilationInfo.location, staticFolder) })
|
|
163
|
-
// ) // compiled stylesheets? -- etag: false to disable caching (from express days...)
|
|
164
|
-
// const publicLocation = join(this.compilationInfo.location, publicFolder)
|
|
165
|
-
// if (existsSync(publicLocation)) {
|
|
166
|
-
// //this.app.use(express.static(publicLocation)) // files from public folder
|
|
167
|
-
// this.app.use(serveStatic({ root: publicLocation })) // files from public folder
|
|
168
|
-
// }
|
|
169
|
-
// //cliWarn(`assets dir:`, this.config.assetsDir)
|
|
170
|
-
// if (this.config.assetsDir !== undefined) {
|
|
171
|
-
// this.app.use(
|
|
172
|
-
// `/${this.config.assetsDir}`,
|
|
173
|
-
// //express.static(join(this.compilationInfo.location, assetsFolder))
|
|
174
|
-
// serveStatic({ root: join(this.compilationInfo.location, assetsFolder) })
|
|
175
|
-
// ) // files from assets folder
|
|
176
|
-
// }
|
|
177
|
-
// this.app.use(
|
|
178
|
-
// //express.static(this.compilationInfo.location, { dotfiles:'allow' })
|
|
179
|
-
// serveStatic({ root: this.compilationInfo.location })
|
|
180
|
-
// ) // serving the app files themselves
|
|
181
|
-
// //this.app.use('/__server_rpc__', this.handleRpc)
|
|
182
|
-
// // seems there was a plan to have API routes built into the main app
|
|
183
|
-
// // can't remember this much
|
|
184
|
-
// if (typeof config.apiRoutes === 'string' && config.apiRoutes !== '') {
|
|
185
|
-
// const apiPath = this.apiPath = standardizeWebPath(this.config.apiPath)
|
|
186
|
-
// cliOut(`API listening at ${this.apiPath}`)
|
|
187
|
-
// // should not be needed with hono
|
|
188
|
-
// // this.app.use(apiPath, express.json())
|
|
189
|
-
// //throwError('DevServerHono', 'Support for app apiRoutes not yet implemented')
|
|
190
|
-
// this.app.use(apiPath, this.handleRequestApi)
|
|
191
|
-
// }
|
|
192
|
-
// this.app.use(this.handleRequest)
|
|
193
|
-
// // !!! obsolete?
|
|
194
|
-
// // start hooking into require to rewrite react requires to tungsten
|
|
195
|
-
// //addRequireResolveHooks() // we need this for server side
|
|
196
|
-
// // we will need a server side import loader too
|
|
197
|
-
// } catch (e) {
|
|
198
|
-
// throw new TungstenError(`${this.constructor.name} construction error: ${e}`)
|
|
199
|
-
// }
|
|
200
|
-
// }
|
|
201
|
-
// private addServerMiddleware = (serverMiddleware: ServerMiddlewareInfo): void => {
|
|
202
|
-
// //console.log('addServerMiddleware')
|
|
203
|
-
// const [middlewareFile, middlewareExportName, middlewarePath] = serverMiddleware
|
|
204
|
-
// const path = middlewarePath.startsWith('/') ? middlewarePath : '/' + middlewarePath
|
|
205
|
-
// this.app.use(path, async (c) => {
|
|
206
|
-
// // this is going to reload the server application on each request
|
|
207
|
-
// // will cause trouble if anything depends on memory
|
|
208
|
-
// // but should be OK for an ordinary DB based system, including DB based sessions
|
|
209
|
-
// // [*] We could look into replacing this with a watcher + reload based system
|
|
210
|
-
// // we'd have to set up a watcher which triggers a reload of middleware to
|
|
211
|
-
// // a variable that can be accessed here. Probably in a promise format so
|
|
212
|
-
// // that a loading middleware can be awaited instead of running the outdated
|
|
213
|
-
// // code
|
|
214
|
-
// // [*] const middlewares = await middlewaresPromise
|
|
215
|
-
// const load = await createLoad(import.meta.url, sxyLoaderConfig)
|
|
216
|
-
// const fullFilePath = 'file://' + join(this.compilationInfo.codeLocation, middlewareFile)
|
|
217
|
-
// const middlewareModule = await load(fullFilePath)
|
|
218
|
-
// if ( ! (middlewareExportName in middlewareModule) ) {
|
|
219
|
-
// throwError(
|
|
220
|
-
// 'DevServer',
|
|
221
|
-
// `export ${middlewareExportName} not found in ${middlewareFile}`
|
|
222
|
-
// + ` when trying to load server middleware`
|
|
223
|
-
// )
|
|
224
|
-
// }
|
|
225
|
-
// const middlewares = middlewareModule[middlewareExportName] as Handler[] // eslint-disable-line no-type-assertion/no-type-assertion
|
|
226
|
-
// // TODO should we add a manual type check here?
|
|
227
|
-
// if (!Array.isArray(middlewares)) throwError('addServerMiddleware', `Expected middlewares to be an array`)
|
|
228
|
-
// if (!(0 in middlewares)) throwError('addServerMiddleware', `No middleware entry at index 0`)
|
|
229
|
-
// const firstMiddleware = middlewares[0]
|
|
230
|
-
// if (!(typeof firstMiddleware === 'function')) {
|
|
231
|
-
// throwError('addServerMiddleware', `Expected middleware to be a function`)
|
|
232
|
-
// }
|
|
233
|
-
// // mimicing hono here so we can modify behaviour on each run
|
|
234
|
-
// let i = 0
|
|
235
|
-
// const next: Next = async () => {
|
|
236
|
-
// i++
|
|
237
|
-
// const m = middlewares[i]
|
|
238
|
-
// if (m !== undefined) {
|
|
239
|
-
// m(c, next)
|
|
240
|
-
// }
|
|
241
|
-
// }
|
|
242
|
-
// firstMiddleware(c, next)
|
|
243
|
-
// })
|
|
244
|
-
// cliOut(`Server Middleware added to server at ${path}`)
|
|
245
|
-
// }
|
|
246
|
-
// // private handleRpc = async (req: Request, res: Response, next: NextFunction) => {
|
|
247
|
-
// // //
|
|
248
|
-
// // console.log('Server is handling server rpc')
|
|
249
|
-
// // }
|
|
250
|
-
// private handleRequestApi = async (c: Context, next: Next): Promise<Response> => {
|
|
251
|
-
// const { req } = c
|
|
252
|
-
// this.apiRoutes = await getApiRoutesHono(this.config, this.compilationInfo, 'dev')
|
|
253
|
-
// //const requestPath = standardizeWebPath(req.baseUrl + req.path)
|
|
254
|
-
// const subPath = standardizeWebPath(req.path)
|
|
255
|
-
// //console.log('received an API req', req.originalUrl, res.locals.reqId)
|
|
256
|
-
// for (const [path, route] of Object.entries(this.apiRoutes)) {
|
|
257
|
-
// if (route.method === req.method && standardizeWebPath(path) === subPath) {
|
|
258
|
-
// //console.log('API route matched', path)
|
|
259
|
-
// return await route.endpoint(c, next)
|
|
260
|
-
// }
|
|
261
|
-
// }
|
|
262
|
-
// // otherwise
|
|
263
|
-
// //res.sendStatus(404)
|
|
264
|
-
// return c.notFound()
|
|
265
|
-
// }
|
|
266
|
-
// private handleRequest = async (c: Context, next: Next): Promise<Response> => {
|
|
267
|
-
// const { req } = c
|
|
268
|
-
// if (/\.(css|scss|sass|js|jsx|png|jpg|jpeg|svg|ico)$/.test(req.path)) {
|
|
269
|
-
// // warn(
|
|
270
|
-
// // `Dev server received request ${req.url} which was not matched by a static file.`
|
|
271
|
-
// // + '\nBlocking request to prevent pointless app render'
|
|
272
|
-
// // )
|
|
273
|
-
// cliLog(`Requested asset file ${req.url} was not found`)
|
|
274
|
-
// return c.notFound()
|
|
275
|
-
// //res.status(404).end()
|
|
276
|
-
// //return
|
|
277
|
-
// }
|
|
278
|
-
// try {
|
|
279
|
-
// const _firstRender = this.firstRender
|
|
280
|
-
// this.firstRender = false
|
|
281
|
-
// //console.log('received a frontend req', req.originalUrl, res.locals.reqId)
|
|
282
|
-
// //// I think we need to pass req, (res?) to the app
|
|
283
|
-
// //// so that it can set response codes
|
|
284
|
-
// //// or
|
|
285
|
-
// //// the app has to return some data other than response string
|
|
286
|
-
// ////
|
|
287
|
-
// //// perhaps, set some return data in the instance
|
|
288
|
-
// //// then return html string + other data
|
|
289
|
-
// const location = req.url
|
|
290
|
-
// const instanceConfig = makeInstanceConfigFromFrameworkConfig(this.config, true)
|
|
291
|
-
// if (this.framework.frameworkModules === undefined) {
|
|
292
|
-
// throwError('DevServer.handleRequest()',
|
|
293
|
-
// 'framework.frameworkModules is undefined'
|
|
294
|
-
// )
|
|
295
|
-
// }
|
|
296
|
-
// if (this.framework.clientImportAliases === undefined) {
|
|
297
|
-
// throwError('DevServer.handleRequest()',
|
|
298
|
-
// 'framework.frameworkModules is undefined'
|
|
299
|
-
// )
|
|
300
|
-
// }
|
|
301
|
-
// globalDataFunc.value = undefined
|
|
302
|
-
// const iteration = this.iterationCount++
|
|
303
|
-
// await loadEnvsDev(this.config, iteration, this.initialProcessEnv, false)
|
|
304
|
-
// // ReqRes is Express-shaped ({req, res}) and Hono's Context isn't - this cast is a
|
|
305
|
-
// // type-only bridge so the (Express-only) Instance/initStores/routing plumbing below
|
|
306
|
-
// // still compiles. Not behaviorally correct; fine since this dev server isn't wired
|
|
307
|
-
// // up anywhere live (see Framework.createDevServer, which only builds DevServer).
|
|
308
|
-
// // eslint-disable-next-line no-type-assertion/no-type-assertion -- see comment above
|
|
309
|
-
// const reqRes = c as unknown as ReqRes
|
|
310
|
-
// // Save some state. I think this is a placeholder for later
|
|
311
|
-
// const serverDataLoading: ServerDataLoading = { value: false }
|
|
312
|
-
// const routingPromise = getRoutesDev(this.compilationInfo, this.config, iteration).then(
|
|
313
|
-
// async (appRoutes) => {
|
|
314
|
-
// const routes = (typeof appRoutes === 'function') ? appRoutes(reqRes) : appRoutes
|
|
315
|
-
// // load data, and do routing
|
|
316
|
-
// return promiseAllObj({
|
|
317
|
-
// appRoutes,
|
|
318
|
-
// routes,
|
|
319
|
-
// globalData: (globalDataFunc.value !== undefined) ? globalDataFunc.value(reqRes) : {},
|
|
320
|
-
// matchedRouteInfo: routing(location, routes, serverDataLoading)
|
|
321
|
-
// })
|
|
322
|
-
// }
|
|
323
|
-
// )
|
|
324
|
-
// let appRoutes: AppRoutes
|
|
325
|
-
// let routes: Routes
|
|
326
|
-
// let globalData: GlobalData
|
|
327
|
-
// let matchedRouteInfo: MatchedRouteInfo
|
|
328
|
-
// let RootComponentClass: AnyComponentType | null = null
|
|
329
|
-
// if (this.config.useRootComponent) {
|
|
330
|
-
// const rootComponentFileFull = join(this.compilationInfo.location, this.config.rootComponent)
|
|
331
|
-
// ;({ routing: { appRoutes, routes, globalData, matchedRouteInfo }, RootComponentClass }
|
|
332
|
-
// = await promiseAllObj({
|
|
333
|
-
// routing: routingPromise,
|
|
334
|
-
// RootComponentClass: getComponentDev(rootComponentFileFull, this.config.rootComponent, iteration)
|
|
335
|
-
// }))
|
|
336
|
-
// } else {
|
|
337
|
-
// ({ appRoutes, routes, globalData, matchedRouteInfo } = await routingPromise)
|
|
338
|
-
// //throwError('DevServer', 'useRootComponent = false not implemented yet')
|
|
339
|
-
// }
|
|
340
|
-
// // get routes (running the getRoutes function if needed)
|
|
341
|
-
// //const routes = (typeof appRoutes === 'function') ? appRoutes(reqRes) : appRoutes
|
|
342
|
-
// // load data, and do routing
|
|
343
|
-
// // const [globalData, matchedRouteInfo] = await Promise.all([
|
|
344
|
-
// // (globalDataFunc !== undefined) ? globalDataFunc(reqRes) : {},
|
|
345
|
-
// // routing(location, routes, serverDataLoading)
|
|
346
|
-
// // ])
|
|
347
|
-
// const redirected = this.handleRedirects(c, matchedRouteInfo)
|
|
348
|
-
// if (redirected !== false) return redirected // end early
|
|
349
|
-
// // make stores
|
|
350
|
-
// const { internalStore, stores, storeSubscriptions }
|
|
351
|
-
// = initStores(location, reqRes, globalData, matchedRouteInfo, serverDataLoading)
|
|
352
|
-
// // create the instance
|
|
353
|
-
// const instance = new Instance(
|
|
354
|
-
// location, instanceConfig, reqRes, appRoutes, routes, internalStore,
|
|
355
|
-
// stores, storeSubscriptions, globalData, matchedRouteInfo
|
|
356
|
-
// )
|
|
357
|
-
// let html: string
|
|
358
|
-
// if (RootComponentClass) {
|
|
359
|
-
// html = await renderRootToHtmlDev(
|
|
360
|
-
// this.compilationInfo, this.framework.clientImportAliases,
|
|
361
|
-
// RootComponentClass, instance, this.config, global.tungstenPublicEnv,
|
|
362
|
-
// '' // siteBasePathOverride
|
|
363
|
-
// )
|
|
364
|
-
// } else {
|
|
365
|
-
// html = await renderRootToHtmlDev(
|
|
366
|
-
// this.compilationInfo, this.framework.clientImportAliases,
|
|
367
|
-
// MatchedRoute, instance, this.config, global.tungstenPublicEnv,
|
|
368
|
-
// '' // siteBasePathOverride
|
|
369
|
-
// )
|
|
370
|
-
// // const { params, data } = matchedRouteInfo
|
|
371
|
-
// // let { content } = matchedRouteInfo
|
|
372
|
-
// // if (typeof content === 'function') {
|
|
373
|
-
// // content = content(data, params, {} /* props */, globalData, location)
|
|
374
|
-
// // //throwError('DevServer', 'route content is a function')
|
|
375
|
-
// // }
|
|
376
|
-
// // //console.log('content to render', content)
|
|
377
|
-
// // html = await renderContentToHtmlDev(
|
|
378
|
-
// // this.compilationInfo, this.framework.clientImportAliases,
|
|
379
|
-
// // content, instance, this.config, global.tungstenPublicEnv,
|
|
380
|
-
// // '' // siteBasePathOverride
|
|
381
|
-
// // )
|
|
382
|
-
// }
|
|
383
|
-
// return c.html(html, (instance.matchedRouteInfo.key === '404') ? 404 : 200)
|
|
384
|
-
// } catch(e) {
|
|
385
|
-
// cliLog('error', e)
|
|
386
|
-
// this.errorLog(e)
|
|
387
|
-
// return c.html(this.errorPage(e), 500)
|
|
388
|
-
// }
|
|
389
|
-
// }
|
|
390
|
-
// // private async handlePost(req: express.Request, res: express.Response): Promise<void> {
|
|
391
|
-
// // throw new TungstenError(`Err - Dev server received a post request. Not supported yet.`)
|
|
392
|
-
// // }
|
|
393
|
-
// errorLog = (error: unknown) => {
|
|
394
|
-
// log((typeof error === 'object' && error !== null && 'stack' in error) ? error.stack : error)
|
|
395
|
-
// }
|
|
396
|
-
// errorPage = (error: unknown) => {
|
|
397
|
-
// return `<!DOCTYPE html>
|
|
398
|
-
// </html>
|
|
399
|
-
// <head>
|
|
400
|
-
// <title>Error</title>
|
|
401
|
-
// <style>html { font-family: arial }</style>
|
|
402
|
-
// </head>
|
|
403
|
-
// <body>
|
|
404
|
-
// <h1>Application Error</h1>
|
|
405
|
-
// <section>
|
|
406
|
-
// <pre>${(typeof error === 'object' && error !== null && 'stack' in error) ? error.stack : error}</pre>
|
|
407
|
-
// </section>
|
|
408
|
-
// </body>
|
|
409
|
-
// </html>`
|
|
410
|
-
// }
|
|
411
|
-
// start = (): Promise<string> => {
|
|
412
|
-
// return new Promise( resolve => {
|
|
413
|
-
// this.server = serve({ fetch: this.app.fetch, port: this.port }, () => {
|
|
414
|
-
// cliNews(`Dev server ready at ${this.location}`)
|
|
415
|
-
// resolve(this.location ?? '')
|
|
416
|
-
// })
|
|
417
|
-
// })
|
|
418
|
-
// }
|
|
419
|
-
// stop = () => {
|
|
420
|
-
// if (this.server !== undefined) this.server.close()
|
|
421
|
-
// }
|
|
422
|
-
// //treeToHtml = treeToHtml
|
|
423
|
-
// }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProdServerHono.d.ts","sourceRoot":"","sources":["../../../src/Servers/hono/ProdServerHono.ts"],"names":[],"mappings":""}
|