tungsten 0.4.10 → 0.4.12
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/AnyComponent.js +1 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +15 -16
- package/dist/ContentNode.js +2 -2
- package/dist/DomRegion.js +1 -1
- package/dist/Framework.d.ts +2 -1
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +43 -34
- 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 +11 -11
- package/dist/RenderedContentNode.js +2 -2
- package/dist/RenderingNode.js +2 -2
- package/dist/Script.js +1 -1
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +29 -29
- package/dist/Servers/ProdServer.js +14 -14
- package/dist/Servers/StaticSiteServer.js +3 -3
- package/dist/Servers/TungstenServer.js +5 -5
- package/dist/Servers/devErrorPageAutoRetry.js +1 -1
- package/dist/Servers/hono/TungstenServerHono.js +5 -5
- package/dist/Servers/initStores.js +3 -3
- package/dist/Servers/loadEnvsDev.js +6 -6
- package/dist/Servers/routing.js +3 -3
- package/dist/Store/createStores.js +2 -2
- package/dist/Store/makeStore.js +2 -2
- package/dist/Store/registerStore.js +2 -2
- package/dist/TungstenApp.js +3 -3
- 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/getApiRoutesHono.js +3 -3
- package/dist/api/getExport.js +4 -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 +2 -2
- package/dist/babelPlugins/BabelTransformBindVar.js +3 -3
- package/dist/babelPlugins/BabelTransformCjsToEsm.js +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 +27 -11
- package/dist/babelPlugins/BabelTransformCssImports.js +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 +71 -49
- package/dist/babelPlugins/BabelTransformReactive.js +1 -1
- package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.js +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.js +3 -3
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +1 -1
- package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +2 -2
- package/dist/bin/args.js +1 -1
- package/dist/bin/commands/build.js +5 -5
- 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 +2 -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.js +13 -13
- package/dist/bin/moduleLoadAnalysis.js +2 -2
- package/dist/browserStorage.js +2 -2
- package/dist/build/babel.user.common.config.d.ts +7 -2
- package/dist/build/babel.user.common.config.d.ts.map +1 -1
- package/dist/build/babel.user.common.config.js +14 -15
- 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 +148 -90
- package/dist/build/compileStyles.js +4 -4
- 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 +1 -1
- package/dist/build/copyPackageModulesToPackagesFolder.js +4 -4
- package/dist/build/copyPublicFiles.js +1 -1
- 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 +1 -1
- package/dist/build/getAllSxyClientModules.js +2 -2
- 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/processPackage.js +3 -3
- 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 +2 -2
- package/dist/build/sassImportParser.js +2 -2
- package/dist/build/tallyBabelPlugins.d.ts.map +1 -1
- package/dist/build/tallyBabelPlugins.js +2 -7
- package/dist/calculateImportedStaticFileLocations.js +2 -2
- package/dist/calledFrom.js +2 -2
- package/dist/compat/forwardRef.js +1 -1
- package/dist/compat/index.js +1 -1
- package/dist/componentCss/tungsten.css +2 -2
- package/dist/componentProxyHandlers.js +3 -3
- 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.js +3 -3
- package/dist/components/bindable/BindableCheckbox.js +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.js +1 -1
- package/dist/components/bindable/BindableRadio.js +1 -1
- package/dist/components/bindable/BindableSelect.js +1 -1
- package/dist/components/bindable/BindableTextarea.js +1 -1
- package/dist/components/library/RichTextEditor/RichTextEditor.js +8 -8
- package/dist/components/library/RichTextEditor/contentTree.js +4 -4
- 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/createElement.js +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/addToEnv.js +1 -1
- package/dist/env/funcs.js +4 -4
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +10 -6
- 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/filePathFromUrl.js +1 -1
- package/dist/findProjectDir.js +1 -1
- package/dist/findUserConfig.js +5 -5
- package/dist/fixExtension.d.ts.map +1 -1
- package/dist/fixExtension.js +5 -3
- package/dist/frameworkConfigSchema.d.ts +16 -0
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +12 -0
- package/dist/getComponent.js +5 -5
- package/dist/getComponentDev.js +1 -1
- package/dist/getFrameworkDir.js +1 -1
- package/dist/getRoutes.js +5 -5
- package/dist/getRoutesDevs.js +1 -1
- package/dist/getUserConfig.js +7 -7
- package/dist/hasValidKey.js +1 -1
- package/dist/helpers/index.js +2 -2
- package/dist/hmr/applyHmrModule.js +5 -5
- package/dist/hmr/componentIdentity.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/useState.js +3 -3
- package/dist/hydrate/hydrate.js +31 -31
- package/dist/hydrate/reconcileHydratedAttributes.js +3 -3
- 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.js +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -1
- package/dist/makeServerRpc.js +3 -3
- package/dist/markOptionSelected.js +1 -1
- package/dist/nbsp.js +1 -1
- package/dist/output.js +1 -1
- package/dist/pop.js +2 -2
- package/dist/postcssPlugins/TransformCssNames.js +6 -6
- 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 +4 -4
- 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.js +7 -7
- package/dist/render/contentNodeToHtml.js +11 -11
- package/dist/render/contentToHtml.js +4 -4
- 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.js +1 -1
- 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 +2 -2
- package/dist/render/processRenderingNodeHtml.js +6 -6
- package/dist/render/renderingTreeToHtml.js +16 -16
- 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/getPathPriority.js +1 -1
- 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/settings.d.ts +4 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +9 -0
- package/dist/standardSchema.js +1 -1
- package/dist/staticGen/getAppRoutes.js +3 -3
- package/dist/staticGen/staticGen.js +7 -7
- package/dist/style/jssToCss.js +3 -3
- package/dist/style/styleContent.js +1 -1
- package/dist/style/styleContentSxy.js +8 -8
- 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 +1 -1
- package/dist/testing/hydrateTestApp.js +9 -9
- package/dist/testing/index.js +11 -11
- package/dist/testing/installTestStyleProcessors.js +1 -1
- package/dist/testing/loadEnv.js +3 -3
- package/dist/testing/loadEnvSetup.js +1 -1
- package/dist/testing/temp/componentPackageMock.js +2 -2
- package/dist/testing/temp/contentHtmlElements.js +2 -2
- package/dist/throwError.js +2 -2
- package/dist/timeProfiler.d.ts +1 -1
- package/dist/timeProfiler.d.ts.map +1 -1
- package/dist/timeProfiler.js +62 -26
- package/dist/update/integrateUpdateVdom.js +28 -28
- package/dist/validChildren.js +2 -2
- package/dist/warnOnFrameworkChange.js +2 -2
- package/dist/zones/react.js +3 -3
- package/package.json +18 -11
- package/types/modules.d.ts +2 -0
|
@@ -4,23 +4,23 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
4
4
|
import express from 'express';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
import { existsSync } from 'fs';
|
|
7
|
-
import { staticFolder, assetsFolder, packageNameCapitalized, publicFolder, componentCssFolder, frameworkCssFolder } from
|
|
8
|
-
import { rootToHtml as renderRootToHtml } from
|
|
9
|
-
import { contentToHtml as renderContentToHtml } from
|
|
10
|
-
import { Instance } from
|
|
11
|
-
import { cliOut, cliWarn, cliLog, cliNews, cliDebug } from
|
|
12
|
-
import { TungstenError } from
|
|
13
|
-
import { makeInstanceConfigFromFrameworkConfig } from
|
|
7
|
+
import { staticFolder, assetsFolder, packageNameCapitalized, publicFolder, componentCssFolder, frameworkCssFolder } from '../settings.js';
|
|
8
|
+
import { rootToHtml as renderRootToHtml } from '../render/rootToHtml.js';
|
|
9
|
+
import { contentToHtml as renderContentToHtml } from '../render/contentToHtml.js';
|
|
10
|
+
import { Instance } from '../Instance/Instance.js';
|
|
11
|
+
import { cliOut, cliWarn, cliLog, cliNews, cliDebug } from '../cliOutput.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
12
|
+
import { TungstenError } from '../TungstenError.js';
|
|
13
|
+
import { makeInstanceConfigFromFrameworkConfig } from '../makeInstanceConfigFromFrameworkConfig.js';
|
|
14
14
|
//import { addRequireResolveHooks } from '../reRouting/addRequireResolveHooks.js'
|
|
15
|
-
import { standardizeWebPath } from
|
|
16
|
-
import { throwError } from
|
|
17
|
-
import { serveStatic } from
|
|
15
|
+
import { standardizeWebPath } from '../standardizeWebPath.js';
|
|
16
|
+
import { throwError } from '../throwError.js';
|
|
17
|
+
import { serveStatic } from './serveStatic.js';
|
|
18
18
|
import { routing } from "./routing.js";
|
|
19
|
-
import { globalDataFunc } from
|
|
19
|
+
import { globalDataFunc } from '../routing/registerGlobalData.js';
|
|
20
20
|
import { TungstenServer } from "./TungstenServer.js";
|
|
21
|
-
import { portError } from
|
|
22
|
-
import { initStores } from
|
|
23
|
-
import { makeTungstenErrorInfo } from
|
|
21
|
+
import { portError } from './portError.js';
|
|
22
|
+
import { initStores } from './initStores.js';
|
|
23
|
+
import { makeTungstenErrorInfo } from '../routing/TungstenErrorInfo.js';
|
|
24
24
|
function debug(...texts) {
|
|
25
25
|
// console.log(...texts)
|
|
26
26
|
}
|
|
@@ -2,10 +2,10 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import express from 'express';
|
|
5
|
-
import { serveStatic } from
|
|
5
|
+
import { serveStatic } from './serveStatic.js';
|
|
6
6
|
import { join } from 'path';
|
|
7
|
-
import { staticSiteFolder } from
|
|
8
|
-
import { cliNews } from
|
|
7
|
+
import { staticSiteFolder } from '../settings.js';
|
|
8
|
+
import { cliNews } from '../cliOutput.js';
|
|
9
9
|
export class StaticSiteServer {
|
|
10
10
|
// to do
|
|
11
11
|
constructor(config) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ContentNodeIsClassComponent } from
|
|
2
|
-
import { RoutingRedirect } from
|
|
3
|
-
import { cliTodo } from
|
|
1
|
+
import { ContentNodeIsClassComponent } from '../ContentNode.js';
|
|
2
|
+
import { RoutingRedirect } from '../routing/RoutingRedirect.js';
|
|
3
|
+
import { cliTodo } from '../cliOutput.js';
|
|
4
4
|
import { RouteRedirectComponent } from "../components/RouteRedirectComponent.js";
|
|
5
5
|
import { WebRedirectComponent } from "../components/WebRedirectComponent.js";
|
|
6
|
-
import { $props, $type } from
|
|
7
|
-
import { WebRedirect } from
|
|
6
|
+
import { $props, $type } from '../contentNodeSymbols.js';
|
|
7
|
+
import { WebRedirect } from '../routing/WebRedirect.js';
|
|
8
8
|
function debug(...texts) {
|
|
9
9
|
// console.log(...texts)
|
|
10
10
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// still, in fact, a self-resolving situation. If the error that reached the error page still
|
|
9
9
|
// looks like that same transient shape, embed a tiny script that auto-reloads a few times before
|
|
10
10
|
// giving up - capped via sessionStorage so a genuine, permanent error doesn't loop forever.
|
|
11
|
-
import { isTransientDevModuleError } from
|
|
11
|
+
import { isTransientDevModuleError } from '../importDevModuleWithRetry.js';
|
|
12
12
|
const sessionStorageKey = 'tungstenDevErrorRetryCount';
|
|
13
13
|
export const maxAutoRetryAttempts = 8;
|
|
14
14
|
const retryDelayMs = 500;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ContentNodeIsClassComponent } from
|
|
2
|
-
import { RoutingRedirect } from
|
|
3
|
-
import { cliTodo } from
|
|
1
|
+
import { ContentNodeIsClassComponent } from '../../ContentNode.js';
|
|
2
|
+
import { RoutingRedirect } from '../../routing/RoutingRedirect.js';
|
|
3
|
+
import { cliTodo } from '../../cliOutput.js';
|
|
4
4
|
import { RouteRedirectComponent } from "../../components/RouteRedirectComponent.js";
|
|
5
5
|
import { WebRedirectComponent } from "../../components/WebRedirectComponent.js";
|
|
6
|
-
import { $props, $type } from
|
|
7
|
-
import { WebRedirect } from
|
|
6
|
+
import { $props, $type } from '../../contentNodeSymbols.js';
|
|
7
|
+
import { WebRedirect } from '../../routing/WebRedirect.js';
|
|
8
8
|
export class TungstenServerHono {
|
|
9
9
|
// Hono's c.redirect() builds a Response but doesn't send it - unlike Express's res.redirect()
|
|
10
10
|
// (which sends immediately), the caller here must return the Response itself for Hono to
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InternalStoreSchema } from
|
|
2
|
-
import { makeStore } from
|
|
3
|
-
import { createStores } from
|
|
1
|
+
import { InternalStoreSchema } from '../Store/InternalStoreSchema.js';
|
|
2
|
+
import { makeStore } from '../Store/makeStore.js';
|
|
3
|
+
import { createStores } from '../Store/createStores.js';
|
|
4
4
|
export function initStores(location, reqResOrNull, globalData, matchedRouteInfo, serverDataLoading = null) {
|
|
5
5
|
const storeSubscriptions = new Map();
|
|
6
6
|
const internalStoreSubscribedElements = new Map();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
2
|
import { readFile as readFilePromise, access as accessPromise } from 'fs/promises';
|
|
3
3
|
import { remap as objectRemap, filter as objectFilter } from 'sxy-lib/objects.js';
|
|
4
|
-
import { getEnvSchemasDev } from
|
|
4
|
+
import { getEnvSchemasDev } from '../env/getEnvSchemas.js';
|
|
5
5
|
import dotenv from 'dotenv';
|
|
6
|
-
import { cliLog, cliOut } from
|
|
7
|
-
import { addToEnv } from
|
|
6
|
+
import { cliLog, cliOut } from '../cliOutput.js';
|
|
7
|
+
import { addToEnv } from '../env/addToEnv.js';
|
|
8
8
|
import { throwError } from 'tungsten/throwError.js';
|
|
9
|
-
import { tungstenCorePrivateEnvSchema } from
|
|
10
|
-
import { tungstenCorePublicEnvSchema } from
|
|
11
|
-
import { checkIsObject, validate } from
|
|
9
|
+
import { tungstenCorePrivateEnvSchema } from './tungstenCorePrivateEnvSchema.js';
|
|
10
|
+
import { tungstenCorePublicEnvSchema } from './tungstenCorePublicEnvSchema.js';
|
|
11
|
+
import { checkIsObject, validate } from '../standardSchema.js';
|
|
12
12
|
export async function loadEnvsDev(config,
|
|
13
13
|
//load: Load,
|
|
14
14
|
iteration, initialProcessEnv, _firstLoad, useTestEnvFiles = false) {
|
package/dist/Servers/routing.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Default404 } from "../routing/Default404.js";
|
|
2
|
-
import { matchPath } from
|
|
3
|
-
import { makeTungstenErrorInfo } from
|
|
4
|
-
import { jsx as _jsx } from "tungsten/
|
|
2
|
+
import { matchPath } from '../routing/matchPath.js';
|
|
3
|
+
import { makeTungstenErrorInfo } from '../routing/TungstenErrorInfo.js';
|
|
4
|
+
import { jsx as _jsx } from "tungsten/jsx-runtime";
|
|
5
5
|
export async function routing(location, routes, serverDataLoading = null) {
|
|
6
6
|
let defaultRoute, _404Route, errorRoute;
|
|
7
7
|
// try the current path against each defined route
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { makeStore } from
|
|
2
|
-
import { storeSchemas } from
|
|
1
|
+
import { makeStore } from './makeStore.js';
|
|
2
|
+
import { storeSchemas } from './storeCreators.js';
|
|
3
3
|
export function createStores(reqRes, matchedRouteInfo, globalData, storeSubscriptionsMap, serverDataLoading = null) {
|
|
4
4
|
const stores = storeSchemas.map(Schema => {
|
|
5
5
|
const subscribedElements = new Map();
|
package/dist/Store/makeStore.js
CHANGED
|
@@ -6,8 +6,8 @@ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("C
|
|
|
6
6
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
7
7
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
8
8
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
9
|
-
import { objectMap } from
|
|
10
|
-
import { isBrowser } from
|
|
9
|
+
import { objectMap } from '../objectMap.js';
|
|
10
|
+
import { isBrowser } from '../isBrowser.js';
|
|
11
11
|
var _key = /*#__PURE__*/new WeakMap();
|
|
12
12
|
var _value = /*#__PURE__*/new WeakMap();
|
|
13
13
|
var _subscribedElements = /*#__PURE__*/new WeakMap();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { storeSchemas } from
|
|
2
|
-
import { Instance } from
|
|
1
|
+
import { storeSchemas } from './storeCreators.js';
|
|
2
|
+
import { Instance } from '../Instance/Instance.js';
|
|
3
3
|
export function registerStore(StoreSchema) {
|
|
4
4
|
//console.log('registering store', StoreSchema.name)
|
|
5
5
|
const position = 0;
|
package/dist/TungstenApp.js
CHANGED
|
@@ -2,9 +2,9 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
/// WIP
|
|
5
|
-
import { cliLog } from
|
|
6
|
-
import { Framework } from
|
|
7
|
-
import { throwError } from
|
|
5
|
+
import { cliLog } from './cliOutput.js';
|
|
6
|
+
import { Framework } from './Framework.js';
|
|
7
|
+
import { throwError } from './throwError.js';
|
|
8
8
|
export class TungstenApp {
|
|
9
9
|
constructor(options) {
|
|
10
10
|
_defineProperty(this, "rootComponent", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CssNames as TungstenStyleObject } from
|
|
1
|
+
export { CssNames as TungstenStyleObject } from './CssNames.js';
|
package/dist/__deproxy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $original } from
|
|
2
|
-
import { NoDeproxy } from
|
|
1
|
+
import { $original } from './componentProxyHandlers.js';
|
|
2
|
+
import { NoDeproxy } from './NoDeproxy.js';
|
|
3
3
|
// doesn't this need to be deep?
|
|
4
4
|
export function __deproxy(possibleProxy) {
|
|
5
5
|
console.log('__deproxy called, this function may not be adequate');
|
package/dist/_client/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//import { helpers } from './cjsHelpers.js'
|
|
2
2
|
import { hydrate } from 'tungsten';
|
|
3
3
|
// @ts-ignore -- ignore module not found, will be generated later
|
|
4
|
-
import instanceConfig from
|
|
4
|
+
import instanceConfig from '../.tungsten.config.js';
|
|
5
5
|
// wrap the async code in an async IIFE to help rollup
|
|
6
6
|
const clientPromise = (async () => {
|
|
7
7
|
//const isProd = window.__tungsten_prod__ = appConfig.prod
|
|
@@ -11,11 +11,11 @@ const clientPromise = (async () => {
|
|
|
11
11
|
// is this causing a slowdown?
|
|
12
12
|
// need to change this to static imports via build steps
|
|
13
13
|
let routes;
|
|
14
|
-
const promises = [import(
|
|
14
|
+
const promises = [import('./routes.js').then(mod => routes = mod.routes)];
|
|
15
15
|
let RootComponent = null;
|
|
16
16
|
if (instanceConfig.useRootComponent) {
|
|
17
17
|
// rollup is failing to handle this when useRootComponent is false
|
|
18
|
-
promises.push(import(
|
|
18
|
+
promises.push(import('./RootComponent.js').then(({
|
|
19
19
|
module,
|
|
20
20
|
filename
|
|
21
21
|
}) => RootComponent = 'default' in module ? module.default : module[filename]) // could probably do with better error handling/reporting
|
package/dist/alive.js
CHANGED
package/dist/api/getApiRoutes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
|
-
import { TungstenError } from
|
|
3
|
-
import { getExportDev } from
|
|
4
|
-
import { getExport } from
|
|
2
|
+
import { TungstenError } from '../TungstenError.js';
|
|
3
|
+
import { getExportDev } from './getExportDev.js';
|
|
4
|
+
import { getExport } from './getExport.js';
|
|
5
5
|
export async function getApiRoutes(config, compilationInfo, mode) {
|
|
6
6
|
if (typeof config.apiRoutes !== 'string') {
|
|
7
7
|
throw new TungstenError(`getApiRoutes() error - config.apiRoutes is not valid`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
|
-
import { TungstenError } from
|
|
3
|
-
import { getExportDev } from
|
|
4
|
-
import { getExport } from
|
|
2
|
+
import { TungstenError } from '../TungstenError.js';
|
|
3
|
+
import { getExportDev } from './getExportDev.js';
|
|
4
|
+
import { getExport } from './getExport.js';
|
|
5
5
|
export async function getApiRoutesHono(config, compilationInfo, mode) {
|
|
6
6
|
if (typeof config.apiRoutes !== 'string') {
|
|
7
7
|
throw new TungstenError(`getApiRoutes() error - config.apiRoutes is not valid`);
|
package/dist/api/getExport.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { basename } from 'path';
|
|
2
|
-
import { fixExtension } from
|
|
3
|
-
import { TungstenError } from
|
|
4
|
-
import { iterationQueryString } from
|
|
5
|
-
import { importDevModuleWithRetry } from
|
|
2
|
+
import { fixExtension } from '../fixExtension.js';
|
|
3
|
+
import { TungstenError } from '../TungstenError.js';
|
|
4
|
+
import { iterationQueryString } from '../iterationQueryString.js';
|
|
5
|
+
import { importDevModuleWithRetry } from '../importDevModuleWithRetry.js';
|
|
6
6
|
//let load //// !! future improvement
|
|
7
7
|
let exportIteration = 0;
|
|
8
8
|
export async function getExport(filePath, relFile, mode = 'prod') {
|
package/dist/api/getExportDev.js
CHANGED
package/dist/appOutput.js
CHANGED
package/dist/auth/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './hashPassword.js';
|
|
2
|
+
export * from './checkPassword.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelAddDevCacheBust.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelAddDevCacheBust.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"BabelAddDevCacheBust.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelAddDevCacheBust.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AA2BnG,wBAAgB,wBAAwB;;eAKjB,SAAS;;gCAKQ,QAAQ,CAAC,iBAAiB,CAAC;qCAItB,QAAQ,CAAC,sBAAsB,CAAC;mCAIlC,QAAQ,CAAC,oBAAoB,CAAC;;EAOxE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// RS: this is unsuitable for test
|
|
2
|
-
// and dubious during dev. Removing it for now
|
|
2
|
+
// and dubious during dev. Removing it from test for now
|
|
3
3
|
// will have to revisit HMR
|
|
4
4
|
// BabelAddDevCacheBust
|
|
5
5
|
// exports MakeBabelAddDevCacheBust (function)
|
|
@@ -29,9 +29,11 @@
|
|
|
29
29
|
// plugins actually end up running in.
|
|
30
30
|
import { dirname, join } from 'path';
|
|
31
31
|
import fs from 'fs';
|
|
32
|
+
// a `.js` specifier names the compiled file; on disk in codeLocation it may be .js, .jsx, or with
|
|
33
|
+
// typescript: true, .ts/.tsx
|
|
32
34
|
function resolveOnDiskMtime(fromDir, specifier) {
|
|
33
35
|
if (!specifier.startsWith('.')) return undefined;
|
|
34
|
-
const candidates = specifier.endsWith('.jsx') ? [specifier, specifier.slice(0, -1)] : specifier.endsWith('.js') ? [
|
|
36
|
+
const candidates = specifier.endsWith('.jsx') ? [specifier, specifier.slice(0, -1)] : specifier.endsWith('.js') ? ['.js', '.jsx', '.ts', '.tsx'].map(extension => `${specifier.slice(0, -3)}${extension}`) : specifier.endsWith('.ts') || specifier.endsWith('.tsx') ? [specifier] : [];
|
|
35
37
|
for (const candidate of candidates) {
|
|
36
38
|
const abs = join(fromDir, candidate);
|
|
37
39
|
if (fs.existsSync(abs)) return fs.statSync(abs).mtimeMs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//import { T } from '@babel/core'
|
|
2
|
-
import { TungstenError } from
|
|
3
|
-
import { throwError } from
|
|
2
|
+
import { TungstenError } from '../TungstenError.js';
|
|
3
|
+
import { throwError } from '../throwError.js';
|
|
4
4
|
// BabelTransformBind
|
|
5
5
|
// exports MakeBabelTransformBind (function)
|
|
6
6
|
//
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//import { T } from '@babel/core'
|
|
2
|
-
import { TungstenError } from
|
|
3
|
-
import { bindableHtmlElements } from
|
|
4
|
-
import { throwError } from
|
|
2
|
+
import { TungstenError } from '../TungstenError.js';
|
|
3
|
+
import { bindableHtmlElements } from '../components/bindable/bindableHtmlElements.js';
|
|
4
|
+
import { throwError } from '../throwError.js';
|
|
5
5
|
// BabelTransformBind
|
|
6
6
|
// exports MakeBabelTransformBind (function)
|
|
7
7
|
//
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { readFileSync } from 'fs';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import { init as lexerInit, parse as lexerParse } from 'cjs-module-lexer';
|
|
5
|
-
import { throwError } from
|
|
5
|
+
import { throwError } from '../throwError.js';
|
|
6
6
|
lexerInit();
|
|
7
7
|
const filenameAndDirnameCode = `import { fileURLToPath } from 'url';
|
|
8
8
|
import { dirname } from 'path';
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
// currently not used
|
|
5
5
|
// proxy and deproxy solution seems preferable
|
|
6
|
-
import { arrayMutatingFunctions } from
|
|
7
|
-
import { throwError } from
|
|
6
|
+
import { arrayMutatingFunctions } from '../mutatingFunctions.js';
|
|
7
|
+
import { throwError } from '../throwError.js';
|
|
8
8
|
export function MakeBabelTransformComponentState(/*opts: Opts*/
|
|
9
9
|
) {
|
|
10
10
|
return function BabelTransformComponentState(babel) {
|
|
@@ -10,6 +10,8 @@ type Opts = {
|
|
|
10
10
|
functionNames?: string[];
|
|
11
11
|
modulePrefix?: string;
|
|
12
12
|
watch?: boolean;
|
|
13
|
+
cacheDir?: string | undefined;
|
|
14
|
+
freshCache?: boolean;
|
|
13
15
|
};
|
|
14
16
|
export declare function MakeBabelTransformComponentStyles(opts: Opts): (babel: Babel) => {
|
|
15
17
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformComponentStyles.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformComponentStyles.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAc,MAAM,iBAAiB,CAAA;AAa7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"BabelTransformComponentStyles.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformComponentStyles.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAc,MAAM,iBAAiB,CAAA;AAa7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAiRvD,KAAK,IAAI,GAAG;IACR,iBAAiB,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,MAAM,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAKxB,YAAY,CAAC,EAAE,MAAM,CAAA;IAIrB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAE7B,UAAU,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAID,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,IAAI,IAsMV,OAAO,KAAK;;;;6BAMjC,MAAM;;mBAIZ,MAAM;;;uCAkBkB,QAAQ,CAAC,wBAAwB,CAAC;sBAf3D,MAAM;kBACV;gBACF,IAAI;qCATS,MAAM;kBASL;aACjB;+BACkB,MAAM;;;EAsKpC"}
|
|
@@ -9,20 +9,22 @@ import fs from 'fs';
|
|
|
9
9
|
import { join, dirname, basename, relative } from 'path';
|
|
10
10
|
import * as sass from 'sass';
|
|
11
11
|
import postcss from 'postcss';
|
|
12
|
+
import url from 'url';
|
|
12
13
|
import { mapToArray as objectMapToArray } from 'sxy-lib/objects.js';
|
|
13
|
-
import { TransformCssNames } from
|
|
14
|
-
import { CssNames } from
|
|
14
|
+
import { TransformCssNames } from '../postcssPlugins/TransformCssNames.js';
|
|
15
|
+
import { CssNames } from '../CssNames.js';
|
|
15
16
|
//const CSSModulesSync = require('postcss-modules-sync').default
|
|
16
|
-
import { watch } from
|
|
17
|
+
import { watch } from '../watch.js';
|
|
17
18
|
import slash from 'slash';
|
|
18
19
|
import { resolveSassImport } from 'tungsten/build/resolveSassScssImports.js';
|
|
19
20
|
import { sassImportParser } from 'tungsten/build/sassImportParser.js';
|
|
20
21
|
import { modifySassImports } from 'tungsten/build/modifySassImports.js';
|
|
21
22
|
import { scssImportParserChatgpt } from 'tungsten/build/scssImportParserChatgpt.js';
|
|
22
23
|
import { errorOut } from 'tungsten';
|
|
23
|
-
import { fixImportsInSassErrorMessage } from
|
|
24
|
-
import { throwError } from
|
|
25
|
-
import {
|
|
24
|
+
import { fixImportsInSassErrorMessage } from './fixImportsInSassErrorMessage.js';
|
|
25
|
+
import { throwError } from '../throwError.js';
|
|
26
|
+
import { tallied } from '../timeProfiler.js';
|
|
27
|
+
import { makeComponentStylesCache } from '../build/componentStylesCache.js';
|
|
26
28
|
class StyleAssistant {
|
|
27
29
|
static toCss(data, fullFile, fullSourceFile, importBase) {
|
|
28
30
|
return {
|
|
@@ -72,13 +74,14 @@ class Css extends StyleAssistant {
|
|
|
72
74
|
function sassScssToCss(data, fullFile, fullSourceFile, importBase, syntax) {
|
|
73
75
|
//console.log(`Component SCSS in ${fullSourceFile} to css`)
|
|
74
76
|
const dependencies = new Set();
|
|
77
|
+
// the parser only rewrites imports to tungsten's resolution; the dependencies come from what
|
|
78
|
+
// sass then actually loaded (below), which includes the partials' own imports
|
|
75
79
|
const imports = syntax === 'indented' ? sassImportParser(data) : scssImportParserChatgpt(data);
|
|
76
80
|
const importsMap = [];
|
|
77
81
|
//if (sassImportResolution === 'js') {
|
|
78
82
|
for (const i of imports) {
|
|
79
83
|
const resolved = resolveSassImport(i.target, fullSourceFile, importBase);
|
|
80
84
|
//console.log('relative', fullSourceFile, resolved, slash(relative(dirname(fullSourceFile), resolved)))
|
|
81
|
-
dependencies.add(resolved);
|
|
82
85
|
importsMap.push({
|
|
83
86
|
...i,
|
|
84
87
|
to: slash(relative(dirname(fullSourceFile), resolved)) // should we use absolute or relative?
|
|
@@ -96,9 +99,7 @@ function sassScssToCss(data, fullFile, fullSourceFile, importBase, syntax) {
|
|
|
96
99
|
};
|
|
97
100
|
let compileResult;
|
|
98
101
|
try {
|
|
99
|
-
|
|
100
|
-
compileResult = sass.compileString(data, compileOptions);
|
|
101
|
-
tally('component sass compile', performance.now() - sassStart);
|
|
102
|
+
compileResult = tallied('component sass compile', () => sass.compileString(data, compileOptions));
|
|
102
103
|
} catch (e) {
|
|
103
104
|
if (typeof e !== 'object' || e === null || !('message' in e) || typeof e.message !== 'string') {
|
|
104
105
|
throwError('BabelTransformComponentStyles', `the Sass compiler threw a value without a string message: ${String(e)}`);
|
|
@@ -114,6 +115,12 @@ function sassScssToCss(data, fullFile, fullSourceFile, importBase, syntax) {
|
|
|
114
115
|
const {
|
|
115
116
|
css
|
|
116
117
|
} = compileResult;
|
|
118
|
+
// loadedUrls lists the entry itself too
|
|
119
|
+
const entry = slash(fullSourceFile);
|
|
120
|
+
for (const loaded of compileResult.loadedUrls) {
|
|
121
|
+
const file = slash(url.fileURLToPath(loaded));
|
|
122
|
+
if (file !== entry) dependencies.add(file);
|
|
123
|
+
}
|
|
117
124
|
return {
|
|
118
125
|
// seem to accept a file location, which is needed for imports
|
|
119
126
|
css,
|
|
@@ -216,6 +223,7 @@ export function MakeBabelTransformComponentStyles(opts) {
|
|
|
216
223
|
fs.writeFileSync(opts.cssOutputFile, '');
|
|
217
224
|
}
|
|
218
225
|
const styleDependers = {};
|
|
226
|
+
const stylesCache = makeComponentStylesCache(opts.cacheDir, opts.freshCache === true);
|
|
219
227
|
// start watching for changes to sass files
|
|
220
228
|
if (watchStyles) {
|
|
221
229
|
watch({
|
|
@@ -375,10 +383,18 @@ export function MakeBabelTransformComponentStyles(opts) {
|
|
|
375
383
|
const moduleName = getModuleName(relFilePath, state.file.opts.stylesheetIndex);
|
|
376
384
|
//console.log('transforming to css')
|
|
377
385
|
// transform the CSS and find it's dependncies (if using a pre-processor)
|
|
386
|
+
// plain Css has no compile stage worth caching
|
|
387
|
+
const cached = tagName === 'Css' ? undefined : tallied('component styles cache lookup', () => stylesCache.lookup(moduleName, tagName, rawStyles));
|
|
378
388
|
const {
|
|
379
389
|
css,
|
|
380
390
|
dependencies
|
|
381
|
-
} = Assistant.toCss(rawStyles, fullFilePath, fullSourceFilePath, opts.projectAbsStyleImportDir);
|
|
391
|
+
} = cached ?? Assistant.toCss(rawStyles, fullFilePath, fullSourceFilePath, opts.projectAbsStyleImportDir);
|
|
392
|
+
if (cached === undefined && tagName !== 'Css') {
|
|
393
|
+
stylesCache.store(moduleName, tagName, rawStyles, {
|
|
394
|
+
css,
|
|
395
|
+
dependencies
|
|
396
|
+
});
|
|
397
|
+
}
|
|
382
398
|
//console.log('result,', css)
|
|
383
399
|
//////////////////// deps
|
|
384
400
|
//console.log(index, 'watchStyles', watchStyles)
|
|
@@ -14,7 +14,7 @@ import slash from 'slash';
|
|
|
14
14
|
import { cliError } from 'tungsten/cliOutput.js';
|
|
15
15
|
import { throwError } from 'tungsten/throwError.js';
|
|
16
16
|
import { existsSync } from 'fs';
|
|
17
|
-
import { isBareImport } from
|
|
17
|
+
import { isBareImport } from './isBareImport.js';
|
|
18
18
|
export function MakeBabelTransformCssImports(opts) {
|
|
19
19
|
return function BabelTransformCssImports(babel) {
|
|
20
20
|
const t = babel.types;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// without its proxy wrapper in certain situations -
|
|
6
6
|
// perhaps when passing the state to external functions,
|
|
7
7
|
// not sure
|
|
8
|
-
import { throwError } from
|
|
8
|
+
import { throwError } from '../throwError.js';
|
|
9
9
|
function ExpressionIsMemberExpression(expression) {
|
|
10
10
|
return expression.type === 'MemberExpression';
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformJsxExtensionsToJs.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformJsxExtensionsToJs.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAGrD,wBAAgB,mCAAmC;;;kCAMA,QAAQ,CAAC,iBAAiB,CAAC;;
|
|
1
|
+
{"version":3,"file":"BabelTransformJsxExtensionsToJs.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformJsxExtensionsToJs.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAGrD,wBAAgB,mCAAmC;;;kCAMA,QAAQ,CAAC,iBAAiB,CAAC;;EAa7E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// BabelTransformJsxExtensionsToJs
|
|
2
2
|
// exports MakeBabelTransformJsxExtensionsToJs (function)
|
|
3
3
|
//
|
|
4
|
-
// Converts any imports of .jsx files to .js, as our
|
|
5
|
-
// files will all be .js
|
|
4
|
+
// Converts any imports of .jsx (and, with typescript: true, .ts/.tsx) files to .js, as our
|
|
5
|
+
// compiled files will all be .js
|
|
6
6
|
export function MakeBabelTransformJsxExtensionsToJs(/*opts: Opts*/
|
|
7
7
|
) {
|
|
8
8
|
return function BabelTransformJsxExtensionsToJs(/*babel*/
|
|
@@ -15,6 +15,10 @@ export function MakeBabelTransformJsxExtensionsToJs(/*opts: Opts*/
|
|
|
15
15
|
const location = path.node.source.value;
|
|
16
16
|
if (location.endsWith('.jsx')) {
|
|
17
17
|
path.node.source.value = location.slice(0, -1);
|
|
18
|
+
} else if (location.endsWith('.tsx')) {
|
|
19
|
+
path.node.source.value = `${location.slice(0, -3)}js`;
|
|
20
|
+
} else if (location.endsWith('.ts')) {
|
|
21
|
+
path.node.source.value = `${location.slice(0, -2)}js`;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BabelTransformPackageImports.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformPackageImports.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"BabelTransformPackageImports.d.ts","sourceRoot":"","sources":["../../src/babelPlugins/BabelTransformPackageImports.ts"],"names":[],"mappings":"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"}
|