tungsten 0.4.11 → 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.
Files changed (293) hide show
  1. package/dist/.build-complete +1 -1
  2. package/dist/AnyComponent.js +1 -1
  3. package/dist/Components.d.ts.map +1 -1
  4. package/dist/Components.js +15 -16
  5. package/dist/ContentNode.js +2 -2
  6. package/dist/DomRegion.js +1 -1
  7. package/dist/Framework.d.ts +2 -1
  8. package/dist/Framework.d.ts.map +1 -1
  9. package/dist/Framework.js +43 -34
  10. package/dist/FrameworkConfig.d.ts +16 -0
  11. package/dist/FrameworkConfig.d.ts.map +1 -1
  12. package/dist/FunctionComponentStandIn.js +8 -8
  13. package/dist/Instance/Instance.js +11 -11
  14. package/dist/RenderedContentNode.js +2 -2
  15. package/dist/RenderingNode.js +2 -2
  16. package/dist/Script.js +1 -1
  17. package/dist/Servers/DevServer.d.ts.map +1 -1
  18. package/dist/Servers/DevServer.js +29 -29
  19. package/dist/Servers/ProdServer.js +14 -14
  20. package/dist/Servers/StaticSiteServer.js +3 -3
  21. package/dist/Servers/TungstenServer.js +5 -5
  22. package/dist/Servers/devErrorPageAutoRetry.js +1 -1
  23. package/dist/Servers/hono/TungstenServerHono.js +5 -5
  24. package/dist/Servers/initStores.js +3 -3
  25. package/dist/Servers/loadEnvsDev.js +6 -6
  26. package/dist/Servers/routing.js +3 -3
  27. package/dist/Store/createStores.js +2 -2
  28. package/dist/Store/makeStore.js +2 -2
  29. package/dist/Store/registerStore.js +2 -2
  30. package/dist/TungstenApp.js +3 -3
  31. package/dist/TungstenStyleObject.js +1 -1
  32. package/dist/__deproxy.js +2 -2
  33. package/dist/_client/client.js +3 -3
  34. package/dist/alive.js +1 -1
  35. package/dist/api/getApiRoutes.js +3 -3
  36. package/dist/api/getApiRoutesHono.js +3 -3
  37. package/dist/api/getExport.js +4 -4
  38. package/dist/api/getExportDev.js +1 -1
  39. package/dist/appOutput.js +1 -1
  40. package/dist/auth/index.js +2 -2
  41. package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -1
  42. package/dist/babelPlugins/BabelAddDevCacheBust.js +4 -2
  43. package/dist/babelPlugins/BabelTransformBindDirect.js +2 -2
  44. package/dist/babelPlugins/BabelTransformBindVar.js +3 -3
  45. package/dist/babelPlugins/BabelTransformCjsToEsm.js +1 -1
  46. package/dist/babelPlugins/BabelTransformComponentState.js +2 -2
  47. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
  48. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
  49. package/dist/babelPlugins/BabelTransformComponentStyles.js +27 -11
  50. package/dist/babelPlugins/BabelTransformCssImports.js +1 -1
  51. package/dist/babelPlugins/BabelTransformDeproxyState.js +1 -1
  52. package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.d.ts.map +1 -1
  53. package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.js +6 -2
  54. package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
  55. package/dist/babelPlugins/BabelTransformPackageImports.js +66 -49
  56. package/dist/babelPlugins/BabelTransformReactive.js +1 -1
  57. package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.js +1 -1
  58. package/dist/babelPlugins/BabelTransformSxyFrameworkImports.js +1 -1
  59. package/dist/babelPlugins/BabelTransformUniqueComponents.js +1 -1
  60. package/dist/babelPlugins/fixImportsInSassErrorMessage.js +1 -1
  61. package/dist/babelPlugins/test.js +1 -1
  62. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +3 -3
  63. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +1 -1
  64. package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +2 -2
  65. package/dist/bin/args.js +1 -1
  66. package/dist/bin/commands/build.js +5 -5
  67. package/dist/bin/commands/buildHelp.js +1 -1
  68. package/dist/bin/commands/clean.js +4 -4
  69. package/dist/bin/commands/compile.d.ts.map +1 -1
  70. package/dist/bin/commands/compile.js +24 -17
  71. package/dist/bin/commands/compileSimplePackage.js +2 -2
  72. package/dist/bin/commands/dev.d.ts.map +1 -1
  73. package/dist/bin/commands/dev.js +16 -9
  74. package/dist/bin/commands/devmon.js +4 -4
  75. package/dist/bin/commands/help.js +2 -2
  76. package/dist/bin/commands/start.js +2 -2
  77. package/dist/bin/commands/static.js +3 -3
  78. package/dist/bin/index.js +13 -13
  79. package/dist/bin/moduleLoadAnalysis.js +2 -2
  80. package/dist/browserStorage.js +2 -2
  81. package/dist/build/babel.user.common.config.d.ts +7 -2
  82. package/dist/build/babel.user.common.config.d.ts.map +1 -1
  83. package/dist/build/babel.user.common.config.js +14 -15
  84. package/dist/build/bundle.d.ts +1 -1
  85. package/dist/build/bundle.d.ts.map +1 -1
  86. package/dist/build/bundle.js +15 -7
  87. package/dist/build/bundleBabelOptions.d.ts +6 -0
  88. package/dist/build/bundleBabelOptions.d.ts.map +1 -0
  89. package/dist/build/bundleBabelOptions.js +23 -0
  90. package/dist/build/combineComponentCss.js +2 -2
  91. package/dist/build/compileJavascript.d.ts +4 -0
  92. package/dist/build/compileJavascript.d.ts.map +1 -1
  93. package/dist/build/compileJavascript.js +148 -90
  94. package/dist/build/compileStyles.js +4 -4
  95. package/dist/build/compileUserApp.d.ts +1 -1
  96. package/dist/build/compileUserApp.d.ts.map +1 -1
  97. package/dist/build/compileUserApp.js +15 -12
  98. package/dist/build/componentStylesCache.d.ts +10 -0
  99. package/dist/build/componentStylesCache.d.ts.map +1 -0
  100. package/dist/build/componentStylesCache.js +54 -0
  101. package/dist/build/copyAssets.js +1 -1
  102. package/dist/build/copyPackageModulesToPackagesFolder.js +4 -4
  103. package/dist/build/copyPublicFiles.js +1 -1
  104. package/dist/build/createClientFiles.js +3 -3
  105. package/dist/build/createInstanceConfigFile.js +2 -2
  106. package/dist/build/createPackageVirtualFileSystems.js +1 -1
  107. package/dist/build/devBundle.js +5 -5
  108. package/dist/build/devBundle.rollup.config.d.ts.map +1 -1
  109. package/dist/build/devBundle.rollup.config.js +0 -1
  110. package/dist/build/frameworkDestLocation.d.ts +1 -0
  111. package/dist/build/frameworkDestLocation.d.ts.map +1 -1
  112. package/dist/build/frameworkDestLocation.js +8 -4
  113. package/dist/build/frameworkStylesheets.js +1 -1
  114. package/dist/build/getAllSxyClientModules.js +2 -2
  115. package/dist/build/getPackageDirForFile.js +1 -1
  116. package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
  117. package/dist/build/getSxyClientPackageAliases.js +4 -2
  118. package/dist/build/getTempDirForAppCompilation.js +1 -1
  119. package/dist/build/makeBabelRawConfig.d.ts +3 -0
  120. package/dist/build/makeBabelRawConfig.d.ts.map +1 -0
  121. package/dist/build/makeBabelRawConfig.js +12 -0
  122. package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
  123. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  124. package/dist/build/makeBabelUserDevConfig.js +11 -8
  125. package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
  126. package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
  127. package/dist/build/makeBabelUserProdConfig.js +10 -5
  128. package/dist/build/processPackage.js +3 -3
  129. package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
  130. package/dist/build/rollup.user.prod.config.js +13 -11
  131. package/dist/build/rollupExtractComponentStylesheets.js +2 -2
  132. package/dist/build/sassImportParser.js +2 -2
  133. package/dist/build/tallyBabelPlugins.d.ts.map +1 -1
  134. package/dist/build/tallyBabelPlugins.js +2 -7
  135. package/dist/calculateImportedStaticFileLocations.js +2 -2
  136. package/dist/calledFrom.js +2 -2
  137. package/dist/compat/forwardRef.js +1 -1
  138. package/dist/compat/index.js +1 -1
  139. package/dist/componentProxyHandlers.js +3 -3
  140. package/dist/components/Link.js +2 -2
  141. package/dist/components/PopMessages.js +3 -3
  142. package/dist/components/RawHtml.js +2 -2
  143. package/dist/components/Stylesheet.js +3 -3
  144. package/dist/components/bindable/BindableCheckbox.js +1 -1
  145. package/dist/components/bindable/BindableInput.js +1 -1
  146. package/dist/components/bindable/BindableInputNonString.js +1 -1
  147. package/dist/components/bindable/BindableInputString.js +1 -1
  148. package/dist/components/bindable/BindableInputTyped.js +1 -1
  149. package/dist/components/bindable/BindableInputTypedLegacy.js +1 -1
  150. package/dist/components/bindable/BindableRadio.js +1 -1
  151. package/dist/components/bindable/BindableSelect.js +1 -1
  152. package/dist/components/bindable/BindableTextarea.js +1 -1
  153. package/dist/components/library/RichTextEditor/RichTextEditor.js +8 -8
  154. package/dist/components/library/RichTextEditor/contentTree.js +4 -4
  155. package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +2 -2
  156. package/dist/components/library/__StatefulMessage/StatefulMessage.js +2 -2
  157. package/dist/components/library/index.js +2 -2
  158. package/dist/createElement.js +1 -1
  159. package/dist/defaultConfig.d.ts +0 -1
  160. package/dist/defaultConfig.d.ts.map +1 -1
  161. package/dist/defaultConfig.js +2 -2
  162. package/dist/deleteDirs.js +1 -1
  163. package/dist/env/addToEnv.js +1 -1
  164. package/dist/env/funcs.js +4 -4
  165. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  166. package/dist/env/getEnvSchemas.js +10 -6
  167. package/dist/env/privateEnv.js +2 -2
  168. package/dist/env/privateEnvOrThrow.js +1 -1
  169. package/dist/env/publicEnv.js +1 -1
  170. package/dist/env/publicEnvOrThrow.js +1 -1
  171. package/dist/filePathFromUrl.js +1 -1
  172. package/dist/findProjectDir.js +1 -1
  173. package/dist/findUserConfig.js +5 -5
  174. package/dist/fixExtension.d.ts.map +1 -1
  175. package/dist/fixExtension.js +5 -3
  176. package/dist/frameworkConfigSchema.d.ts +16 -0
  177. package/dist/frameworkConfigSchema.d.ts.map +1 -1
  178. package/dist/frameworkConfigSchema.js +12 -0
  179. package/dist/getComponent.js +5 -5
  180. package/dist/getComponentDev.js +1 -1
  181. package/dist/getFrameworkDir.js +1 -1
  182. package/dist/getRoutes.js +5 -5
  183. package/dist/getRoutesDevs.js +1 -1
  184. package/dist/getUserConfig.js +7 -7
  185. package/dist/hasValidKey.js +1 -1
  186. package/dist/helpers/index.js +2 -2
  187. package/dist/hmr/applyHmrModule.js +5 -5
  188. package/dist/hmr/componentIdentity.js +2 -2
  189. package/dist/hooks/clearCurrentComponent.js +1 -1
  190. package/dist/hooks/getCurrentComponent.js +3 -3
  191. package/dist/hooks/index.js +5 -5
  192. package/dist/hooks/setCurrentComponent.js +1 -1
  193. package/dist/hooks/useCallback.js +2 -2
  194. package/dist/hooks/useEffect.js +2 -2
  195. package/dist/hooks/useInstance.js +1 -1
  196. package/dist/hooks/useMemo.js +2 -2
  197. package/dist/hooks/useState.js +3 -3
  198. package/dist/hydrate/hydrate.js +31 -31
  199. package/dist/hydrate/reconcileHydratedAttributes.js +3 -3
  200. package/dist/index.js +2 -2
  201. package/dist/indexInner.d.ts +1 -1
  202. package/dist/indexInner.d.ts.map +1 -1
  203. package/dist/indexInner.js +45 -45
  204. package/dist/innerHtmlFromProps.js +1 -1
  205. package/dist/isBrowser.js +1 -1
  206. package/dist/isDev.js +1 -1
  207. package/dist/isProd.js +1 -1
  208. package/dist/isServer.js +1 -1
  209. package/dist/jsx-runtime.js +1 -1
  210. package/dist/jsxRuntime.d.ts.map +1 -1
  211. package/dist/jsxRuntime.js +12 -7
  212. package/dist/jsxRuntimeSignals.d.ts.map +1 -1
  213. package/dist/jsxRuntimeSignals.js +15 -8
  214. package/dist/makeFinalConfig.js +1 -1
  215. package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -1
  216. package/dist/makeServerRpc.js +3 -3
  217. package/dist/markOptionSelected.js +1 -1
  218. package/dist/nbsp.js +1 -1
  219. package/dist/output.js +1 -1
  220. package/dist/pop.js +2 -2
  221. package/dist/postcssPlugins/TransformCssNames.js +6 -6
  222. package/dist/postcssPlugins/parseSelectors.js +1 -1
  223. package/dist/postcssPlugins/parseSelectorsRich.js +1 -1
  224. package/dist/postcssPlugins/scopeAnimationValue.js +2 -2
  225. package/dist/propsAreEqual.js +3 -3
  226. package/dist/rawHtml/filterContentNode.js +4 -4
  227. package/dist/rawHtml/parseHtml.js +4 -4
  228. package/dist/rawHtml/sanitizeHtml.js +3 -3
  229. package/dist/rawHtml/tokenizeHtml.js +2 -2
  230. package/dist/render/addImportMap.js +2 -2
  231. package/dist/render/classComponentNodeToRenderingTree.js +4 -4
  232. package/dist/render/componentNodeToRenderingTree.js +7 -7
  233. package/dist/render/contentNodeToHtml.js +11 -11
  234. package/dist/render/contentToHtml.js +4 -4
  235. package/dist/render/contentToHtmlDev.js +1 -1
  236. package/dist/render/contentTreeToRenderingTree.js +7 -7
  237. package/dist/render/functionComponentNodeToRenderingTree.js +4 -4
  238. package/dist/render/getFunctionBodyAsString.js +1 -1
  239. package/dist/render/instantiateClassComponent.js +2 -2
  240. package/dist/render/instantiateComponent.js +3 -3
  241. package/dist/render/instantiateFunctionComponent.js +2 -2
  242. package/dist/render/printComponentNameInSource.js +1 -1
  243. package/dist/render/processHead.js +5 -5
  244. package/dist/render/processHtmlNode.js +1 -1
  245. package/dist/render/processProps.js +2 -2
  246. package/dist/render/processRenderingNodeHtml.js +6 -6
  247. package/dist/render/renderingTreeToHtml.js +16 -16
  248. package/dist/render/rootToHtml.js +2 -2
  249. package/dist/render/rootToHtmlDev.js +1 -1
  250. package/dist/requests/fetch/delete.js +2 -2
  251. package/dist/requests/fetch/get.js +3 -3
  252. package/dist/requests/fetch/patch.js +2 -2
  253. package/dist/requests/fetch/post.js +2 -2
  254. package/dist/requests/fetch/put.js +2 -2
  255. package/dist/requests/index.js +5 -5
  256. package/dist/routing/MatchedRoute.js +2 -2
  257. package/dist/routing/getPathPriority.js +1 -1
  258. package/dist/routing/matchPath.js +3 -3
  259. package/dist/routing/patternToRegex.js +1 -1
  260. package/dist/server.js +3 -3
  261. package/dist/serverModuleLocation.d.ts +3 -0
  262. package/dist/serverModuleLocation.d.ts.map +1 -0
  263. package/dist/serverModuleLocation.js +12 -0
  264. package/dist/settings.d.ts +4 -0
  265. package/dist/settings.d.ts.map +1 -1
  266. package/dist/settings.js +9 -0
  267. package/dist/standardSchema.js +1 -1
  268. package/dist/staticGen/getAppRoutes.js +3 -3
  269. package/dist/staticGen/staticGen.js +7 -7
  270. package/dist/style/jssToCss.js +3 -3
  271. package/dist/style/styleContent.js +1 -1
  272. package/dist/style/styleContentSxy.js +8 -8
  273. package/dist/style/unusedStyles.js +1 -1
  274. package/dist/sync/index.js +1 -1
  275. package/dist/syncServer/preload.js +1 -1
  276. package/dist/testing/host.js +1 -1
  277. package/dist/testing/hydrateTestApp.js +9 -9
  278. package/dist/testing/index.js +11 -11
  279. package/dist/testing/installTestStyleProcessors.js +1 -1
  280. package/dist/testing/loadEnv.js +3 -3
  281. package/dist/testing/loadEnvSetup.js +1 -1
  282. package/dist/testing/temp/componentPackageMock.js +2 -2
  283. package/dist/testing/temp/contentHtmlElements.js +2 -2
  284. package/dist/throwError.js +2 -2
  285. package/dist/timeProfiler.d.ts +1 -1
  286. package/dist/timeProfiler.d.ts.map +1 -1
  287. package/dist/timeProfiler.js +61 -25
  288. package/dist/update/integrateUpdateVdom.js +28 -28
  289. package/dist/validChildren.js +2 -2
  290. package/dist/warnOnFrameworkChange.js +2 -2
  291. package/dist/zones/react.js +3 -3
  292. package/package.json +18 -11
  293. 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 "../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";
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 "../standardizeWebPath.js";
16
- import { throwError } from "../throwError.js";
17
- import { serveStatic } from "./serveStatic.js";
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 "../routing/registerGlobalData.js";
19
+ import { globalDataFunc } from '../routing/registerGlobalData.js';
20
20
  import { TungstenServer } from "./TungstenServer.js";
21
- import { portError } from "./portError.js";
22
- import { initStores } from "./initStores.js";
23
- import { makeTungstenErrorInfo } from "../routing/TungstenErrorInfo.js";
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 "./serveStatic.js";
5
+ import { serveStatic } from './serveStatic.js';
6
6
  import { join } from 'path';
7
- import { staticSiteFolder } from "../settings.js";
8
- import { cliNews } from "../cliOutput.js";
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 "../ContentNode.js";
2
- import { RoutingRedirect } from "../routing/RoutingRedirect.js";
3
- import { cliTodo } from "../cliOutput.js";
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 "../contentNodeSymbols.js";
7
- import { WebRedirect } from "../routing/WebRedirect.js";
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 "../importDevModuleWithRetry.js";
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 "../../ContentNode.js";
2
- import { RoutingRedirect } from "../../routing/RoutingRedirect.js";
3
- import { cliTodo } from "../../cliOutput.js";
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 "../../contentNodeSymbols.js";
7
- import { WebRedirect } from "../../routing/WebRedirect.js";
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 "../Store/InternalStoreSchema.js";
2
- import { makeStore } from "../Store/makeStore.js";
3
- import { createStores } from "../Store/createStores.js";
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 "../env/getEnvSchemas.js";
4
+ import { getEnvSchemasDev } from '../env/getEnvSchemas.js';
5
5
  import dotenv from 'dotenv';
6
- import { cliLog, cliOut } from "../cliOutput.js";
7
- import { addToEnv } from "../env/addToEnv.js";
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 "./tungstenCorePrivateEnvSchema.js";
10
- import { tungstenCorePublicEnvSchema } from "./tungstenCorePublicEnvSchema.js";
11
- import { checkIsObject, validate } from "../standardSchema.js";
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) {
@@ -1,7 +1,7 @@
1
1
  import { Default404 } from "../routing/Default404.js";
2
- import { matchPath } from "../routing/matchPath.js";
3
- import { makeTungstenErrorInfo } from "../routing/TungstenErrorInfo.js";
4
- import { jsx as _jsx } from "tungsten/jsxRuntime.js";
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 "./makeStore.js";
2
- import { storeSchemas } from "./storeCreators.js";
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();
@@ -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 "../objectMap.js";
10
- import { isBrowser } from "../isBrowser.js";
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 "./storeCreators.js";
2
- import { Instance } from "../Instance/Instance.js";
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;
@@ -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 "./cliOutput.js";
6
- import { Framework } from "./Framework.js";
7
- import { throwError } from "./throwError.js";
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 "./CssNames.js";
1
+ export { CssNames as TungstenStyleObject } from './CssNames.js';
package/dist/__deproxy.js CHANGED
@@ -1,5 +1,5 @@
1
- import { $original } from "./componentProxyHandlers.js";
2
- import { NoDeproxy } from "./NoDeproxy.js";
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');
@@ -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 "../.tungsten.config.js";
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("./routes.js").then(mod => routes = mod.routes)];
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("./RootComponent.js").then(({
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
@@ -1,4 +1,4 @@
1
- import { NoDeproxy } from "./NoDeproxy.js";
1
+ import { NoDeproxy } from './NoDeproxy.js';
2
2
  export function alive(v) {
3
3
  return new NoDeproxy(v);
4
4
  }
@@ -1,7 +1,7 @@
1
1
  import { join } from 'path';
2
- import { TungstenError } from "../TungstenError.js";
3
- import { getExportDev } from "./getExportDev.js";
4
- import { getExport } from "./getExport.js";
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 "../TungstenError.js";
3
- import { getExportDev } from "./getExportDev.js";
4
- import { getExport } from "./getExport.js";
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`);
@@ -1,8 +1,8 @@
1
1
  import { basename } from 'path';
2
- import { fixExtension } from "../fixExtension.js";
3
- import { TungstenError } from "../TungstenError.js";
4
- import { iterationQueryString } from "../iterationQueryString.js";
5
- import { importDevModuleWithRetry } from "../importDevModuleWithRetry.js";
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') {
@@ -1,4 +1,4 @@
1
- import { getExport } from "./getExport.js";
1
+ import { getExport } from './getExport.js';
2
2
  export function getExportDev(filePathFull, relFile) {
3
3
  return getExport(filePathFull, relFile, 'dev');
4
4
  }
package/dist/appOutput.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-console */
2
- import { isClient } from "./isClient.js";
2
+ import { isClient } from './isClient.js';
3
3
  export function log(...texts) {
4
4
  console.log(...texts);
5
5
  }
@@ -1,2 +1,2 @@
1
- export * from "./hashPassword.js";
2
- export * from "./checkPassword.js";
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;AAuBnG,wBAAgB,wBAAwB;;eAKjB,SAAS;;gCAKQ,QAAQ,CAAC,iBAAiB,CAAC;qCAItB,QAAQ,CAAC,sBAAsB,CAAC;mCAIlC,QAAQ,CAAC,oBAAoB,CAAC;;EAOxE"}
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') ? [specifier, `${specifier.slice(0, -3)}.jsx`] : [];
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 "../TungstenError.js";
3
- import { throwError } from "../throwError.js";
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 "../TungstenError.js";
3
- import { bindableHtmlElements } from "../components/bindable/bindableHtmlElements.js";
4
- import { throwError } from "../throwError.js";
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 "../throwError.js";
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 "../mutatingFunctions.js";
7
- import { throwError } from "../throwError.js";
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;AA0QvD,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;CAClB,CAAA;AAID,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,IAAI,IAqMV,OAAO,KAAK;;;;6BAMjC,MAAM;;mBAIZ,MAAM;;;uCAkBkB,QAAQ,CAAC,wBAAwB,CAAC;sBAf3D,MAAM;kBACV;gBACF,IAAI;qCATS,MAAM;kBASL;aACjB;+BACkB,MAAM;;;EA4JpC"}
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 "../postcssPlugins/TransformCssNames.js";
14
- import { CssNames } from "../CssNames.js";
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 "../watch.js";
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 "./fixImportsInSassErrorMessage.js";
24
- import { throwError } from "../throwError.js";
25
- import { tally } from "../timeProfiler.js";
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
- const sassStart = performance.now();
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 "./isBareImport.js";
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 "../throwError.js";
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;;EAS7E"}
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 compiled
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;AAOrD,OAAO,EAGH,QAAQ,EACX,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AA+B5C,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAErE,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,QAAQ,CAAA;IACd,WAAW,EAAE,WAAW,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAA;AAEnD,MAAM,MAAM,WAAW,GAAG;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,WAAW,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;CACxB,CAAA;AAGD,MAAM,MAAM,WAAW,GAAG;IACtB,CAAC,GAAG,EAAC,MAAM,GAAG,WAAW,C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