tungsten 0.4.12 → 0.4.14

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 (275) hide show
  1. package/dist/.build-complete +1 -1
  2. package/dist/AnyComponent.d.ts.map +1 -1
  3. package/dist/Components.d.ts +40 -0
  4. package/dist/Components.d.ts.map +1 -1
  5. package/dist/Components.js +66 -77
  6. package/dist/DomPointer.js +1 -1
  7. package/dist/DomRegion.js +2 -2
  8. package/dist/Framework.js +1 -1
  9. package/dist/FrameworkConfig.d.ts.map +1 -1
  10. package/dist/Instance/Instance.js +1 -1
  11. package/dist/RenderedContentNode.d.ts.map +1 -1
  12. package/dist/RenderedContentNode.js +2 -1
  13. package/dist/Sass.d.ts.map +1 -1
  14. package/dist/Sass.js +1 -0
  15. package/dist/Servers/DevServer.d.ts.map +1 -1
  16. package/dist/Servers/DevServer.js +4 -3
  17. package/dist/Servers/ProdServer.js +1 -1
  18. package/dist/Servers/StaticSiteServer.js +1 -1
  19. package/dist/Servers/loadEnvsDev.d.ts +1 -1
  20. package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
  21. package/dist/Servers/loadEnvsDev.js +4 -2
  22. package/dist/Servers/routing.d.ts.map +1 -1
  23. package/dist/Servers/routing.js +1 -1
  24. package/dist/Store/Store.js +1 -1
  25. package/dist/Store/TypeSafeStore.js +1 -1
  26. package/dist/Store/makeStore.js +1 -1
  27. package/dist/Store/registerStore.js +1 -1
  28. package/dist/TElement.js +1 -1
  29. package/dist/TungstenApp.js +6 -2
  30. package/dist/_client/cjsHelpers.d.ts.map +1 -1
  31. package/dist/_client/cjsHelpers.js +4 -2
  32. package/dist/_client/client.js +0 -14
  33. package/dist/_client/hmr.d.ts +2 -0
  34. package/dist/_client/hmr.d.ts.map +1 -0
  35. package/dist/_client/hmr.js +65 -0
  36. package/dist/_client/liveReload.d.ts +2 -0
  37. package/dist/_client/liveReload.d.ts.map +1 -0
  38. package/dist/_client/liveReload.js +6 -0
  39. package/dist/_client/liveReloadSource.d.ts +3 -0
  40. package/dist/_client/liveReloadSource.d.ts.map +1 -0
  41. package/dist/_client/liveReloadSource.js +25 -0
  42. package/dist/api/getExport.d.ts.map +1 -1
  43. package/dist/api/getExport.js +1 -0
  44. package/dist/babelPlugins/BabelTransformBindDirect.js +2 -0
  45. package/dist/babelPlugins/BabelTransformBindVar.d.ts.map +1 -1
  46. package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
  47. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
  48. package/dist/babelPlugins/BabelTransformComponentStyles.js +5 -4
  49. package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
  50. package/dist/babelPlugins/BabelTransformCssImports.js +2 -2
  51. package/dist/babelPlugins/BabelTransformDependencyImportsOld.js +1 -1
  52. package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
  53. package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
  54. package/dist/babelPlugins/BabelTransformPackageImports.js +10 -5
  55. package/dist/babelPlugins/BabelTransformRemoveBlocks.d.ts.map +1 -1
  56. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
  57. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +2 -1
  58. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
  59. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +2 -1
  60. package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +1 -1
  61. package/dist/bin/args.js +1 -1
  62. package/dist/bin/commands/build.js +1 -1
  63. package/dist/bin/commands/compileSimplePackage.js +1 -0
  64. package/dist/bin/index.d.ts.map +1 -1
  65. package/dist/bin/index.js +11 -3
  66. package/dist/bin/vendorHook.d.ts +3 -0
  67. package/dist/bin/vendorHook.d.ts.map +1 -0
  68. package/dist/bin/vendorHook.js +34 -0
  69. package/dist/browserStorage.js +4 -2
  70. package/dist/build/babel.user.common.config.d.ts +2 -0
  71. package/dist/build/babel.user.common.config.d.ts.map +1 -1
  72. package/dist/build/babel.user.common.config.js +10 -4
  73. package/dist/build/bundle.d.ts.map +1 -1
  74. package/dist/build/bundle.js +10 -1
  75. package/dist/build/compileJavascript.d.ts.map +1 -1
  76. package/dist/build/compileJavascript.js +40 -27
  77. package/dist/build/compileStyles.js +4 -4
  78. package/dist/build/copyAssets.js +3 -3
  79. package/dist/build/copyPublicFiles.js +3 -3
  80. package/dist/build/createClientFiles.d.ts.map +1 -1
  81. package/dist/build/createClientFiles.js +4 -8
  82. package/dist/build/frameworkStylesheets.js +1 -1
  83. package/dist/build/getAllSxyClientModules.d.ts.map +1 -1
  84. package/dist/build/getAllSxyClientModules.js +4 -28
  85. package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
  86. package/dist/build/getSxyClientPackageAliases.js +3 -1
  87. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  88. package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
  89. package/dist/build/rollupExtractComponentStylesheets.js +1 -1
  90. package/dist/build/sassImportParser.js +2 -2
  91. package/dist/build/tallyBabel.d.ts +3 -0
  92. package/dist/build/tallyBabel.d.ts.map +1 -0
  93. package/dist/build/tallyBabel.js +11 -0
  94. package/dist/clone.js +4 -4
  95. package/dist/compat/context.d.ts.map +1 -1
  96. package/dist/compat/types.d.ts.map +1 -1
  97. package/dist/componentProxyHandlers.d.ts +20 -13
  98. package/dist/componentProxyHandlers.d.ts.map +1 -1
  99. package/dist/componentProxyHandlers.js +134 -94
  100. package/dist/components/Stylesheet.d.ts +1 -2
  101. package/dist/components/Stylesheet.d.ts.map +1 -1
  102. package/dist/components/Stylesheet.js +1 -1
  103. package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
  104. package/dist/components/bindable/BindableInput.d.ts.map +1 -1
  105. package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
  106. package/dist/components/bindable/BindableRadio.d.ts.map +1 -1
  107. package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
  108. package/dist/components/library/RichTextEditor/RichTextEditor.js +2 -2
  109. package/dist/components/library/RichTextEditor/contentTree.js +1 -1
  110. package/dist/concat.d.ts.map +1 -1
  111. package/dist/concat.js +2 -2
  112. package/dist/copy.d.ts.map +1 -1
  113. package/dist/createRoutes.d.ts +1 -1
  114. package/dist/createRoutes.d.ts.map +1 -1
  115. package/dist/env/Env.js +2 -2
  116. package/dist/env/getEnvSchemas.d.ts +2 -2
  117. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  118. package/dist/env/getEnvSchemas.js +7 -5
  119. package/dist/env/windowGlobalEnvStatement.d.ts.map +1 -1
  120. package/dist/findProjectDir.d.ts.map +1 -1
  121. package/dist/findProjectDir.js +18 -4
  122. package/dist/findUserConfig.js +2 -2
  123. package/dist/foreach.js +1 -0
  124. package/dist/frameworkConfigSchema.js +2 -2
  125. package/dist/getComponent.d.ts.map +1 -1
  126. package/dist/getComponentDev.d.ts.map +1 -1
  127. package/dist/getRoutes.d.ts.map +1 -1
  128. package/dist/getRoutes.js +13 -22
  129. package/dist/getRoutesDevs.d.ts.map +1 -1
  130. package/dist/getStackTrace.js +1 -1
  131. package/dist/glob.d.ts +5 -0
  132. package/dist/glob.d.ts.map +1 -0
  133. package/dist/glob.js +103 -0
  134. package/dist/helpers/getFetchCompatibleHeaders.js +2 -2
  135. package/dist/hmr/applyHmrModule.js +5 -5
  136. package/dist/hmr/componentIdentity.js +1 -1
  137. package/dist/hmr/instanceRegistry.js +2 -2
  138. package/dist/hooks/useReducer.d.ts.map +1 -1
  139. package/dist/hooks/useState.d.ts.map +1 -1
  140. package/dist/hooks/useState.js +2 -8
  141. package/dist/hydrate/hydrate.d.ts +1 -1
  142. package/dist/hydrate/hydrate.d.ts.map +1 -1
  143. package/dist/hydrate/hydrate.js +29 -25
  144. package/dist/hydrate/reconcileHydratedAttributes.js +2 -2
  145. package/dist/indexInner.d.ts +1 -1
  146. package/dist/indexInner.d.ts.map +1 -1
  147. package/dist/indexInner.js +1 -0
  148. package/dist/makeFinalConfig.d.ts.map +1 -1
  149. package/dist/makeFinalConfig.js +2 -2
  150. package/dist/markOptionSelected.js +1 -1
  151. package/dist/mergeConfigs.d.ts.map +1 -1
  152. package/dist/mergeConfigs.js +11 -2
  153. package/dist/mutatingFunctions.d.ts +2 -1
  154. package/dist/mutatingFunctions.d.ts.map +1 -1
  155. package/dist/mutatingFunctions.js +10 -4
  156. package/dist/postcssPlugins/TransformCssNames.js +2 -2
  157. package/dist/rawHtml/parseHtml.js +1 -1
  158. package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
  159. package/dist/render/componentNodeToRenderingTree.js +6 -17
  160. package/dist/render/contentToHtml.d.ts.map +1 -1
  161. package/dist/render/contentToHtml.js +1 -1
  162. package/dist/render/getFunctionBodyAsString.d.ts.map +1 -1
  163. package/dist/render/getFunctionBodyAsString.js +2 -5
  164. package/dist/render/processHead.d.ts.map +1 -1
  165. package/dist/render/processHead.js +5 -34
  166. package/dist/render/processProps.js +2 -2
  167. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  168. package/dist/render/rootToHtml.d.ts.map +1 -1
  169. package/dist/routing/Route.js +1 -1
  170. package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
  171. package/dist/routing/RoutesWithSafeParams.js +1 -1
  172. package/dist/routing/WebRedirect.d.ts.map +1 -1
  173. package/dist/routing/compareRequestToRegex.js +2 -2
  174. package/dist/routing/getPathPriority.js +1 -1
  175. package/dist/serverRpc.d.ts.map +1 -1
  176. package/dist/signals/tracking.d.ts +33 -0
  177. package/dist/signals/tracking.d.ts.map +1 -0
  178. package/dist/signals/tracking.js +87 -0
  179. package/dist/slash.d.ts +2 -0
  180. package/dist/slash.d.ts.map +1 -0
  181. package/dist/slash.js +5 -0
  182. package/dist/spawnShellCommand.js +1 -1
  183. package/dist/staticGen/staticGen.d.ts.map +1 -1
  184. package/dist/staticGen/staticGen.js +9 -7
  185. package/dist/staticGen/staticGenFunctions.js +1 -1
  186. package/dist/style/jssToCss.d.ts.map +1 -1
  187. package/dist/style/jssToCss.js +11 -9
  188. package/dist/style/unusedStyles.d.ts.map +1 -1
  189. package/dist/testing/host.js +11 -11
  190. package/dist/testing/hydrateTestApp.d.ts.map +1 -1
  191. package/dist/testing/hydrateTestApp.js +9 -9
  192. package/dist/testing/index.d.ts.map +1 -1
  193. package/dist/testing/installTestStyleProcessors.js +1 -1
  194. package/dist/testing/loadEnv.d.ts +4 -1
  195. package/dist/testing/loadEnv.d.ts.map +1 -1
  196. package/dist/testing/loadEnv.js +2 -2
  197. package/dist/testing/temp/componentPackageMock.js +3 -3
  198. package/dist/timeProfiler.d.ts +4 -0
  199. package/dist/timeProfiler.d.ts.map +1 -1
  200. package/dist/timeProfiler.js +16 -0
  201. package/dist/todo.js +2 -1
  202. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  203. package/dist/update/integrateUpdateVdom.js +17 -14
  204. package/dist/update/integrateUpdateVdomPrebuild.js +5 -5
  205. package/dist/warnOnFrameworkChange.js +1 -1
  206. package/dist/watch.js +2 -2
  207. package/package.json +14 -33
  208. package/types/modules.d.ts +0 -1
  209. package/vendor/babel-core.js +26 -0
  210. package/vendor/babel-parser.js +9 -0
  211. package/vendor/babel-plugin-syntax-import-assertions.js +50 -0
  212. package/vendor/babel-preset-react.js +872 -0
  213. package/vendor/babel-preset-typescript.js +26 -0
  214. package/vendor/babel-types.js +9 -0
  215. package/vendor/chalk-extensions.js +1994 -0
  216. package/vendor/chalk.js +647 -0
  217. package/vendor/chokidar.js +6889 -0
  218. package/vendor/chunk-1TN2rK3j.js +1218 -0
  219. package/vendor/chunk-1UuLTU0U.js +34 -0
  220. package/vendor/chunk-B_NeooyV.js +86 -0
  221. package/vendor/chunk-C12hSZn7.js +88 -0
  222. package/vendor/chunk-C3YkUGz5.js +19 -0
  223. package/vendor/chunk-C3fcZDjl.js +41964 -0
  224. package/vendor/chunk-C9FSKeSx.js +14603 -0
  225. package/vendor/chunk-CPArXGxa.js +14623 -0
  226. package/vendor/cjs-module-lexer.js +6 -0
  227. package/vendor/dotenv.js +412 -0
  228. package/vendor/express.js +40577 -0
  229. package/vendor/import-meta-resolve.js +2201 -0
  230. package/vendor/manifest.json +29 -0
  231. package/vendor/postcss.js +8546 -0
  232. package/vendor/serialize-javascript.js +293 -0
  233. package/vendor/sxy-lib-arrays.js +113 -0
  234. package/vendor/sxy-lib-object-copy.js +1781 -0
  235. package/vendor/sxy-lib-objects.js +156 -0
  236. package/vendor/sxy-lib-promises.js +47 -0
  237. package/vendor/sxy-package-investigator.js +202 -0
  238. package/vendor/valibot.js +7664 -0
  239. package/dist/Servers/hono/DevServerHono.d.ts +0 -2
  240. package/dist/Servers/hono/DevServerHono.d.ts.map +0 -1
  241. package/dist/Servers/hono/DevServerHono.js +0 -423
  242. package/dist/Servers/hono/ProdServerHono.d.ts +0 -2
  243. package/dist/Servers/hono/ProdServerHono.d.ts.map +0 -1
  244. package/dist/Servers/hono/ProdServerHono.js +0 -220
  245. package/dist/Servers/hono/TungstenServerHono.d.ts +0 -6
  246. package/dist/Servers/hono/TungstenServerHono.d.ts.map +0 -1
  247. package/dist/Servers/hono/TungstenServerHono.js +0 -36
  248. package/dist/api/ApiEndpointHono.d.ts +0 -3
  249. package/dist/api/ApiEndpointHono.d.ts.map +0 -1
  250. package/dist/api/ApiEndpointHono.js +0 -1
  251. package/dist/api/ApiRouteHono.d.ts +0 -7
  252. package/dist/api/ApiRouteHono.d.ts.map +0 -1
  253. package/dist/api/ApiRouteHono.js +0 -1
  254. package/dist/api/ApiRoutesHono.d.ts +0 -5
  255. package/dist/api/ApiRoutesHono.d.ts.map +0 -1
  256. package/dist/api/ApiRoutesHono.js +0 -1
  257. package/dist/api/getApiRoutesHono.d.ts +0 -6
  258. package/dist/api/getApiRoutesHono.d.ts.map +0 -1
  259. package/dist/api/getApiRoutesHono.js +0 -14
  260. package/dist/build/compilePackages.d.ts +0 -2
  261. package/dist/build/compilePackages.d.ts.map +0 -1
  262. package/dist/build/compilePackages.js +0 -89
  263. package/dist/build/findRequiredUserModule.d.ts +0 -2
  264. package/dist/build/findRequiredUserModule.d.ts.map +0 -1
  265. package/dist/build/findRequiredUserModule.js +0 -36
  266. package/dist/build/processPackage.d.ts +0 -4
  267. package/dist/build/processPackage.d.ts.map +0 -1
  268. package/dist/build/processPackage.js +0 -91
  269. package/dist/build/tallyBabelPlugins.d.ts +0 -3
  270. package/dist/build/tallyBabelPlugins.d.ts.map +0 -1
  271. package/dist/build/tallyBabelPlugins.js +0 -63
  272. package/dist/testing/loadEnvSetup.d.ts +0 -2
  273. package/dist/testing/loadEnvSetup.d.ts.map +0 -1
  274. package/dist/testing/loadEnvSetup.js +0 -7
  275. package/sxy-loader.config.js +0 -7
@@ -70,7 +70,7 @@ export function getPathPriority(path) {
70
70
  }
71
71
  case '/':
72
72
  {
73
- if (char === '/' && paramOpenBrackets === 0) {
73
+ if (paramOpenBrackets === 0) {
74
74
  mode = 'search';
75
75
  debug('mode: search');
76
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serverRpc.d.ts","sourceRoot":"","sources":["../src/serverRpc.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,kBAAkB,CAEtG"}
1
+ {"version":3,"file":"serverRpc.d.ts","sourceRoot":"","sources":["../src/serverRpc.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,kBAAkB,CAEtG"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Dependency tracking for signals components.
3
+ *
4
+ * Dependencies are keyed by (object identity, key) in a side table rather than by path, so a
5
+ * consumer is connected to whatever object it actually read, wherever that object sits in a
6
+ * state tree -- a child reading `props.item.name` subscribes to (item, 'name') directly.
7
+ * The state proxies call track() from their get traps and notify() from their write paths;
8
+ * an effect collects its dependencies while it runs and drops them all before each re-run.
9
+ *
10
+ * Only synchronous reads are tracked: the active effect is restored as soon as fn() returns,
11
+ * so reads after an `await` inside an async content() are not seen.
12
+ *
13
+ * No imports here on purpose -- the proxy handlers depend on this, so it must stay a leaf.
14
+ */
15
+ export type Effect = {
16
+ deps: Set<Set<Effect>>;
17
+ trigger: () => void;
18
+ };
19
+ export declare const ITERATE: unique symbol;
20
+ export declare function createEffect(trigger: () => void): Effect;
21
+ export declare function isTracking(): boolean;
22
+ /** called by the proxies on every read; a no-op unless an effect is running */
23
+ export declare function track(target: object, key: unknown): void;
24
+ /** wake every effect subscribed to any of the given keys, each at most once */
25
+ export declare function notify(target: object, ...keys: unknown[]): void;
26
+ /** wake every effect subscribed to anything on the target; for bulk mutations like splice */
27
+ export declare function notifyAll(target: object): void;
28
+ /** run fn with reads subscribing the effect; previous deps are dropped so they are re-collected */
29
+ export declare function runEffect<T>(effect: Effect, fn: () => T): T;
30
+ /** run fn without subscribing the current effect to anything it reads */
31
+ export declare function untracked<T>(fn: () => T): T;
32
+ export declare function disposeEffect(effect: Effect): void;
33
+ //# sourceMappingURL=tracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/signals/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,MAAM,GAAG;IAEjB,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACtB,OAAO,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAID,eAAO,MAAM,OAAO,eAAoB,CAAA;AAMxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,MAAM,CAExD;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAUxD;AAED,+EAA+E;AAC/E,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAS/D;AAED,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAM9C;AAOD,mGAAmG;AACnG,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAS3D;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQ3C;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAElD"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Dependency tracking for signals components.
3
+ *
4
+ * Dependencies are keyed by (object identity, key) in a side table rather than by path, so a
5
+ * consumer is connected to whatever object it actually read, wherever that object sits in a
6
+ * state tree -- a child reading `props.item.name` subscribes to (item, 'name') directly.
7
+ * The state proxies call track() from their get traps and notify() from their write paths;
8
+ * an effect collects its dependencies while it runs and drops them all before each re-run.
9
+ *
10
+ * Only synchronous reads are tracked: the active effect is restored as soon as fn() returns,
11
+ * so reads after an `await` inside an async content() are not seen.
12
+ *
13
+ * No imports here on purpose -- the proxy handlers depend on this, so it must stay a leaf.
14
+ */
15
+ // pseudo-key for reads that depend on the whole collection: Object.keys, for..in, Map/Set
16
+ // iteration and size. Array iteration reads 'length' and the indexes, so needs no pseudo-key.
17
+ export const ITERATE = Symbol('iterate');
18
+ const subscribers = new WeakMap();
19
+ let active = null;
20
+ export function createEffect(trigger) {
21
+ return {
22
+ deps: new Set(),
23
+ trigger
24
+ };
25
+ }
26
+ export function isTracking() {
27
+ return active !== null;
28
+ }
29
+ /** called by the proxies on every read; a no-op unless an effect is running */
30
+ export function track(target, key) {
31
+ if (active === null) return;
32
+ let keys = subscribers.get(target);
33
+ if (keys === undefined) subscribers.set(target, keys = new Map());
34
+ let subs = keys.get(key);
35
+ if (subs === undefined) keys.set(key, subs = new Set());
36
+ if (!subs.has(active)) {
37
+ subs.add(active);
38
+ active.deps.add(subs);
39
+ }
40
+ }
41
+ /** wake every effect subscribed to any of the given keys, each at most once */
42
+ export function notify(target, ...keys) {
43
+ const map = subscribers.get(target);
44
+ if (map === undefined) return;
45
+ const fired = new Set();
46
+ for (const key of keys) {
47
+ const subs = map.get(key);
48
+ if (subs !== undefined) for (const effect of subs) fired.add(effect);
49
+ }
50
+ for (const effect of fired) effect.trigger();
51
+ }
52
+ /** wake every effect subscribed to anything on the target; for bulk mutations like splice */
53
+ export function notifyAll(target) {
54
+ const map = subscribers.get(target);
55
+ if (map === undefined) return;
56
+ const fired = new Set();
57
+ for (const subs of map.values()) for (const effect of subs) fired.add(effect);
58
+ for (const effect of fired) effect.trigger();
59
+ }
60
+ function clearDeps(effect) {
61
+ for (const subs of effect.deps) subs.delete(effect);
62
+ effect.deps.clear();
63
+ }
64
+ /** run fn with reads subscribing the effect; previous deps are dropped so they are re-collected */
65
+ export function runEffect(effect, fn) {
66
+ clearDeps(effect);
67
+ const previous = active;
68
+ active = effect;
69
+ try {
70
+ return fn();
71
+ } finally {
72
+ active = previous;
73
+ }
74
+ }
75
+ /** run fn without subscribing the current effect to anything it reads */
76
+ export function untracked(fn) {
77
+ const previous = active;
78
+ active = null;
79
+ try {
80
+ return fn();
81
+ } finally {
82
+ active = previous;
83
+ }
84
+ }
85
+ export function disposeEffect(effect) {
86
+ clearDeps(effect);
87
+ }
@@ -0,0 +1,2 @@
1
+ export default function slash(path: string): string;
2
+ //# sourceMappingURL=slash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash.d.ts","sourceRoot":"","sources":["../src/slash.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGlD"}
package/dist/slash.js ADDED
@@ -0,0 +1,5 @@
1
+ // the `slash` package in-house: backslashes to forward slashes, extended-length paths left alone
2
+ export default function slash(path) {
3
+ if (path.startsWith('\\\\?\\')) return path;
4
+ return path.replaceAll('\\', '/');
5
+ }
@@ -13,7 +13,7 @@ export function spawnShellCommand(command, extras) {
13
13
  if (route === 'whole-command') {
14
14
  return spawn(command, options);
15
15
  } else {
16
- const parts = command.split(' '); // eslint-disable-line no-type-assertion/no-type-assertion -- split returns an array of length at least 1
16
+ const parts = command.split(' '); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- split returns an array of length at least 1
17
17
  // if (process.platform === 'win32') {
18
18
  // parts[0] += '.cmd'
19
19
  // }
@@ -1 +1 @@
1
- {"version":3,"file":"staticGen.d.ts","sourceRoot":"","sources":["../../src/staticGen/staticGen.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAiBhD,wBAAsB,SAAS,CAAC,SAAS,EAAE,SAAS,iBA+MnD"}
1
+ {"version":3,"file":"staticGen.d.ts","sourceRoot":"","sources":["../../src/staticGen/staticGen.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAiBhD,wBAAsB,SAAS,CAAC,SAAS,EAAE,SAAS,iBA+MnD"}
@@ -1,6 +1,8 @@
1
1
  import { existsSync, promises as fsPromises } from 'fs';
2
2
  import { join, dirname } from 'path';
3
- import fsExtra from 'fs-extra';
3
+ const copy = (from, to) => fsPromises.cp(from, to, {
4
+ recursive: true
5
+ });
4
6
  //import type { SxyFrameworkConfigComplete } from '../FrameworkConfig.js'
5
7
  import { staticSiteFolder, staticFolder, assetsFolder, publicFolder, bundleFolder, componentCssFolder, frameworkCssFolder } from '../settings.js';
6
8
  import { getAppRoutes } from './getAppRoutes.js';
@@ -147,17 +149,17 @@ export async function staticGen(framework) {
147
149
  await renderPath(path, siteBasePath);
148
150
  }
149
151
  if (!quiet) cliLog('rewriteMap', rewriteMap);
150
- const copyPromises = [fsExtra.copy(join(buildLocation, staticFolder), join(projectDir, staticSiteFolder)),
152
+ const copyPromises = [copy(join(buildLocation, staticFolder), join(projectDir, staticSiteFolder)),
151
153
  // assets folder
152
- existsSync(join(buildLocation, assetsFolder)) ? fsExtra.copy(join(buildLocation, assetsFolder), join(projectDir, staticSiteFolder, 'assets')) : null,
154
+ existsSync(join(buildLocation, assetsFolder)) ? copy(join(buildLocation, assetsFolder), join(projectDir, staticSiteFolder, 'assets')) : null,
153
155
  // public files
154
- existsSync(join(buildLocation, publicFolder)) ? fsExtra.copy(join(buildLocation, publicFolder), join(projectDir, staticSiteFolder)) : null,
156
+ existsSync(join(buildLocation, publicFolder)) ? copy(join(buildLocation, publicFolder), join(projectDir, staticSiteFolder)) : null,
155
157
  // copy in the bundle
156
- fsExtra.copy(join(projectDir, bundleFolder), join(projectDir, staticSiteFolder, 'bundle')),
158
+ copy(join(projectDir, bundleFolder), join(projectDir, staticSiteFolder, 'bundle')),
157
159
  // copy the client.js to clientWithEnv.js, because the framework looks for this file instead.
158
- //fsExtra.copy(join(projectDir, bundleFolder, 'client.js'), join(projectDir, bundleFolder, 'clientWithEnv.js')),
160
+ //copy(join(projectDir, bundleFolder, 'client.js'), join(projectDir, bundleFolder, 'clientWithEnv.js')),
159
161
  // copy in the css
160
- fsExtra.copy(join(buildLocation, componentCssFolder), join(projectDir, staticSiteFolder, componentCssFolder)), ...(existsSync(join(buildLocation, frameworkCssFolder)) ? [fsExtra.copy(join(buildLocation, frameworkCssFolder), join(projectDir, staticSiteFolder, frameworkCssFolder))] : [])];
162
+ copy(join(buildLocation, componentCssFolder), join(projectDir, staticSiteFolder, componentCssFolder)), ...(existsSync(join(buildLocation, frameworkCssFolder)) ? [copy(join(buildLocation, frameworkCssFolder), join(projectDir, staticSiteFolder, frameworkCssFolder))] : [])];
161
163
  await Promise.all(copyPromises);
162
164
  } finally {
163
165
  await server.stop();
@@ -12,7 +12,7 @@ export function pathToLink(path, siteBasePath) {
12
12
  }
13
13
  export function findLinks(content) {
14
14
  const matches = [...content.matchAll(/href="(.+?)"/g)].map(x => {
15
- return x[1]; // eslint-disable-line no-type-assertion/no-type-assertion -- the regex has a match group, so entry 1 will exist
15
+ return x[1]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- the regex has a match group, so entry 1 will exist
16
16
  });
17
17
  return matches;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jssToCss.d.ts","sourceRoot":"","sources":["../../src/style/jssToCss.ts"],"names":[],"mappings":"AAiBA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,UAiBpC"}
1
+ {"version":3,"file":"jssToCss.d.ts","sourceRoot":"","sources":["../../src/style/jssToCss.ts"],"names":[],"mappings":"AAoBA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,UAqBpC"}
@@ -1,11 +1,9 @@
1
- import decamelize from 'decamelize';
2
1
  import { IsIndexableObject } from '../IsIndexableObject.js';
3
- import { todo } from '../todo.js';
2
+ import { isDev } from '../isDev.js';
4
3
  import { throwError } from '../throwError.js';
4
+ // decamelize in-house: fontSize -> font-size, MozOsxFontSmoothing -> moz-osx-font-smoothing
5
5
  function kabab(string) {
6
- return decamelize(string, {
7
- separator: '-'
8
- });
6
+ return string.replace(/([\p{Ll}\d])(\p{Lu})/gu, '$1-$2').replace(/(\p{Lu}+)(\p{Lu}\p{Ll}+)/gu, '$1-$2').toLowerCase();
9
7
  }
10
8
  function value(key, value) {
11
9
  if (typeof value === 'number' && value !== 0 && !(key in unitlessNumber)) {
@@ -15,12 +13,16 @@ function value(key, value) {
15
13
  }
16
14
  export function jssToCss(jss) {
17
15
  if (IsIndexableObject(jss)) {
18
- if (jss === null) return '';
19
16
  let css = '';
20
- todo(`jssToCss() Add typesafety to jss object`);
21
17
  for (const key in jss) {
22
- css += `${kabab(key)}: ${value(key, jss[key])};`;
23
- //css += `${kabab(key)}: ${value(key, (jss as GenericObject)[key])};`
18
+ const raw = jss[key];
19
+ // a conditional style leaves undefined behind: no declaration, as in react
20
+ if (raw === undefined || raw === null) continue;
21
+ // the prop is typed CSSProperties; anything else here came through a spread or cast
22
+ if (isDev && typeof raw !== 'string' && typeof raw !== 'number') {
23
+ throwError('jssToCss()', `style.${key} is ${typeof raw}, expected a string or number`);
24
+ }
25
+ css += `${kabab(key)}: ${value(key, raw)};`;
24
26
  }
25
27
  return css;
26
28
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"unusedStyles.d.ts","sourceRoot":"","sources":["../../src/style/unusedStyles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAa9C,MAAM,MAAM,UAAU,GAAG;IACrB,MAAM,EAAE,QAAQ,CAAA;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAA;AAUD,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,cAQ7C;AA2BD,wBAAsB,kBAAkB,kBAgBvC"}
1
+ {"version":3,"file":"unusedStyles.d.ts","sourceRoot":"","sources":["../../src/style/unusedStyles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAY9C,MAAM,MAAM,UAAU,GAAG;IACrB,MAAM,EAAE,QAAQ,CAAA;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B,CAAA;AAUD,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,cAQ7C;AA2BD,wBAAsB,kBAAkB,kBAgBvC"}
@@ -25,7 +25,7 @@ export async function host(
25
25
  // reference, so a generic component's own type parameters survive - see the
26
26
  // longer note on createTestApp(), which uses the same shape.
27
27
  ComponentType, ...args) {
28
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- the conditional tuple isn't destructurable as written
28
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- the conditional tuple isn't destructurable as written
29
29
  const [props, options] = args;
30
30
  const pending = [];
31
31
  const failures = [];
@@ -53,7 +53,7 @@ ComponentType, ...args) {
53
53
  let title;
54
54
  const navigations = [];
55
55
  const component = new ComponentType(componentPackageMock(
56
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- an absent props object is only reachable when Props allows {}
56
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- an absent props object is only reachable when Props allows {}
57
57
  props ?? {}, {
58
58
  trackWork,
59
59
  // setState's work, run and awaited here rather than left to a timer
@@ -81,7 +81,7 @@ ComponentType, ...args) {
81
81
  environment: options.environment
82
82
  } : {})
83
83
  }));
84
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- state isn't on the base class, see StateOf
84
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- state isn't on the base class, see StateOf
85
85
  const stateful = component;
86
86
  const simple = component instanceof TungstenSimpleComponent;
87
87
  // Not awaited here: what the component's own content function returns is
@@ -91,10 +91,10 @@ ComponentType, ...args) {
91
91
  if (contentFunction === undefined) {
92
92
  throw new Error(`host(): ${ComponentType.name} has no content or render function.`);
93
93
  }
94
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- the base declares the stateful (props, state) shape for both
94
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- the base declares the stateful (props, state) shape for both
95
95
  const call = contentFunction;
96
96
  const result = simple ? call(component.props) : call(component.props, stateful.state);
97
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- ContentOf recovers the concrete component's own return type
97
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- ContentOf recovers the concrete component's own return type
98
98
  return result;
99
99
  };
100
100
  await component.__init();
@@ -107,7 +107,7 @@ ComponentType, ...args) {
107
107
  get props() {
108
108
  return component.props;
109
109
  },
110
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- as above
110
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- as above
111
111
  get state() {
112
112
  return stateful.state;
113
113
  },
@@ -123,7 +123,7 @@ ComponentType, ...args) {
123
123
  // content first, then the completion lifecycles - the order
124
124
  // __updateAndReturnContent() and its complete() callback run in.
125
125
  const rendered = await content();
126
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- see UpdateCompletion
126
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- see UpdateCompletion
127
127
  const completion = component;
128
128
  // the framework passes the props the render saw, not the previous
129
129
  // ones, despite componentDidUpdate's parameter name
@@ -135,11 +135,11 @@ ComponentType, ...args) {
135
135
  if (stateful.state === undefined) {
136
136
  throw new Error(`host(): ${ComponentType.name} has no state to update.`);
137
137
  }
138
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- as above
138
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- as above
139
139
  const next = setter(stateful.state);
140
140
  // a setter that mutated and returned nothing has already done the work
141
141
  if (next !== undefined) {
142
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- StateOf is the component's own state type
142
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- StateOf is the component's own state type
143
143
  stateful.state = next;
144
144
  }
145
145
  const rendered = await content();
@@ -147,7 +147,7 @@ ComponentType, ...args) {
147
147
  return rendered;
148
148
  }
149
149
  };
150
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- componentApi() collects exactly the members ComponentApi describes
150
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- componentApi() collects exactly the members ComponentApi describes
151
151
  return Object.assign(core, componentApi(component, core));
152
152
  }
153
153
  // The component's own function members, bound and ready to call. Framework
@@ -160,7 +160,7 @@ function componentApi(component, core) {
160
160
  if (name.startsWith('_') || frameworkMembers.has(name)) return;
161
161
  if (name in core || name in api) return;
162
162
  // class fields are already arrows; a prototype method needs binding
163
- api[name] = descriptor.value.bind(component); // eslint-disable-line no-type-assertion/no-type-assertion -- guarded by the typeof above
163
+ api[name] = descriptor.value.bind(component); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- guarded by the typeof above
164
164
  };
165
165
  for (const name of Object.getOwnPropertyNames(component)) {
166
166
  add(name, Object.getOwnPropertyDescriptor(component, name));
@@ -1 +1 @@
1
- {"version":3,"file":"hydrateTestApp.d.ts","sourceRoot":"","sources":["../../src/testing/hydrateTestApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC7B,MAAM,mBAAmB,CAAA;AAO1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAA;AAa1F,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,YAAY,CAAA;AAEnE,MAAM,MAAM,qBAAqB,CAAC,KAAK,SAAS,MAAM,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG;IAM9E,WAAW,CAAC,EAAE,KAAK,CAAA;IAEnB,GAAG,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,KAAK,kBAAkB,CAAC,KAAK,SAAS,MAAM,IAAI,MAAM,SAAS,KAAK,GAC9D,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC,GACxC,MAAM,KAAK,SAAS,KAAK,GACrB,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC,GACxC,CAAC,OAAO,EAAE,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,CAAA;AAEpE,MAAM,MAAM,cAAc,CAAC,SAAS,SAAS,qBAAqB,IAAI;IAClE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAA;IAC/B,QAAQ,CA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
26
  if (window === null) return;
27
- const globals = globalThis; // eslint-disable-line no-type-assertion/no-type-assertion -- bridging happy-dom's globals onto the global scope
27
+ const globals = globalThis; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- bridging happy-dom's globals onto the global scope
28
28
  globals.Node = window.Node;
29
29
  globals.Text = window.Text;
30
30
  globals.Comment = window.Comment;
@@ -109,8 +109,8 @@ class HydrateTestAppImplementation {
109
109
  */
110
110
  export async function hydrateTestApp(RootComponent, ...args) {
111
111
  await waitForEnvIfLoading();
112
- const options = args[0]; // eslint-disable-line no-type-assertion/no-type-assertion
113
- const suppliedDocument = options?.document ?? globalThis.document; // eslint-disable-line no-type-assertion/no-type-assertion
112
+ const options = args[0]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
113
+ const suppliedDocument = options?.document ?? globalThis.document; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
114
114
  if (suppliedDocument === undefined) {
115
115
  // eslint-disable-line @typescript-eslint/no-unnecessary-condition
116
116
  throw new Error('hydrateTestApp() requires options.document when no global document is available.');
@@ -131,10 +131,10 @@ export async function hydrateTestApp(RootComponent, ...args) {
131
131
  }
132
132
  document.body.appendChild(container);
133
133
  }
134
- const clientProps = options?.props ?? {}; // eslint-disable-line no-type-assertion/no-type-assertion
134
+ const clientProps = options?.props ?? {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
135
135
  const serverProps = options?.serverProps ?? clientProps;
136
136
  const location = options?.location ?? '/';
137
- const globalData = options?.globalData ?? {}; // eslint-disable-line no-type-assertion/no-type-assertion
137
+ const globalData = options?.globalData ?? {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
138
138
  const matchedRouteInfo = {
139
139
  key: null,
140
140
  params: options?.routeParams ?? {},
@@ -151,8 +151,8 @@ export async function hydrateTestApp(RootComponent, ...args) {
151
151
  staticSite: false,
152
152
  csr: options?.csr ?? false
153
153
  };
154
- const emptyRoutes = {}; // eslint-disable-line no-type-assertion/no-type-assertion -- not exercised by hydration tests
155
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- rootToHtml.ts builds a root content node the same way
154
+ const emptyRoutes = {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- not exercised by hydration tests
155
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- rootToHtml.ts builds a root content node the same way
156
156
  const componentNode = {
157
157
  [$type]: RootComponent,
158
158
  [$props]: serverProps
@@ -168,7 +168,7 @@ export async function hydrateTestApp(RootComponent, ...args) {
168
168
  storeSubscriptions
169
169
  } = initStores(location, null, globalData, matchedRouteInfo);
170
170
  const ssrInstance = new Instance(location, instanceConfig, null, emptyRoutes, emptyRoutes,
171
- // eslint-disable-line no-type-assertion/no-type-assertion
171
+ // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
172
172
  internalStore, stores, storeSubscriptions, globalData, matchedRouteInfo, {
173
173
  document,
174
174
  window: document.defaultView,
@@ -214,7 +214,7 @@ export async function hydrateTestApp(RootComponent, ...args) {
214
214
  navigation: false
215
215
  };
216
216
  const instance = new Instance(location, instanceConfig, null, emptyRoutes, emptyRoutes,
217
- // eslint-disable-line no-type-assertion/no-type-assertion
217
+ // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
218
218
  internalStore, stores, storeSubscriptions, globalData, matchedRouteInfo, runtimeContext);
219
219
  try {
220
220
  for (const override of options?.stores ?? []) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC7B,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CA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AAC,IAAI,CAAC,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,MAAM,IAAI,MAAM,SAAS,KAAK,GACpE,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,GACjC,MAAM,KAAK,SAAS,KAAK,GACrB,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,GACjC,CAAC,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,CAAA;AAqE7D,wBAAsB,aAAa,CAC/B,KAAK,SAAS,0BAA0B,EACxC,SAAS,SAAS,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EACjD,SAAS,GAAG,SAAS,EAarB,aAAa,EAAE,KAAK,GAAG,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,SAAS,EAClF,GAAG,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAClC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAqH7B"}
@@ -1,5 +1,5 @@
1
1
  import { CssNames } from '../CssNames.js';
2
- // The style processors are compiled away by babel-plugin-css-to-js in an app
2
+ // The style processors are compiled away by BabelTransformComponentStyles in an app
3
3
  // build. Tungsten's own build deliberately leaves them alone — transforming
4
4
  // here would emit the stylesheet into the framework's output instead of the
5
5
  // consuming app's — so the globals are absent when tungsten tests its own
@@ -1,3 +1,6 @@
1
- export declare function loadEnv(): Promise<void>;
1
+ export type LoadEnvOptions = {
2
+ buildLocation?: string;
3
+ };
4
+ export declare function loadEnv(options?: LoadEnvOptions): Promise<void>;
2
5
  export declare function waitForEnvIfLoading(): Promise<void>;
3
6
  //# sourceMappingURL=loadEnv.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadEnv.d.ts","sourceRoot":"","sources":["../../src/testing/loadEnv.ts"],"names":[],"mappings":"AAaA,wBAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAWvC;AAID,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnD"}
1
+ {"version":3,"file":"loadEnv.d.ts","sourceRoot":"","sources":["../../src/testing/loadEnv.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,cAAc,GAAG;IAGzB,aAAa,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AASD,wBAAgB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAcnE;AAID,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnD"}
@@ -9,14 +9,14 @@ let loadPromise;
9
9
  // TUNGSTEN_TEST_ENV chooses which env files: set it to prefer .env.test* over the base files.
10
10
  // A missing or invalid env schemas file is a hard error - an app that asked for env and did not
11
11
  // get it must not run its tests regardless.
12
- export function loadEnv() {
12
+ export function loadEnv(options = {}) {
13
13
  if (loadPromise === undefined) {
14
14
  loadPromise = (async () => {
15
15
  const config = await getUserConfig({}, 'silent');
16
16
  const useTestEnvFiles = testEnvIsRequested(process.env[testEnvVariableName]);
17
17
  // iteration 0: schemas are stable within a test run.
18
18
  // _firstLoad = false: suppress the CLI boot output.
19
- await loadEnvsDev(config, 0, process.env, false, useTestEnvFiles);
19
+ await loadEnvsDev(config, 0, process.env, false, useTestEnvFiles, options.buildLocation);
20
20
  })();
21
21
  }
22
22
  return loadPromise;
@@ -50,14 +50,14 @@ export const componentPackageMock = (props, options = {}) => ({
50
50
  // read. `satisfies Partial<Instance>` checks those we do supply against
51
51
  // the real Instance types (catching drift), while the assertion backfills
52
52
  // the rest.
53
- // eslint-disable-next-line no-type-assertion/no-type-assertion
53
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
54
54
  instance: {
55
55
  //stores: options.stores ?? [],
56
- // eslint-disable-next-line no-type-assertion/no-type-assertion -- the mock supplies store keys, not the store machinery behind them
56
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- the mock supplies store keys, not the store machinery behind them
57
57
  internalStore: internalStore(options.internalStore ?? {}),
58
58
  // Route passthrough: tests supply loosely-typed route maps, narrowed
59
59
  // to Routes here (assertion confined to this boundary).
60
- // eslint-disable-next-line no-type-assertion/no-type-assertion
60
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
61
61
  getRoutes: () => options.routes ?? {},
62
62
  // the instance's own copies of what the store holds - one source, as
63
63
  // updateLocation() keeps them in the real thing
@@ -6,6 +6,10 @@ export declare function isProfiling(): boolean;
6
6
  export declare function beginStartupProfiling(profiling: boolean): void;
7
7
  export declare function reportStartupPhase(name: string): void;
8
8
  export declare function tallied<T>(name: string, work: () => T): T;
9
+ export declare function findTally(name: string): {
10
+ calls: number;
11
+ ms: number;
12
+ } | undefined;
9
13
  export declare function addEndOfRunReport(report: () => void): void;
10
14
  export declare function reportRunTotal(name: string): void;
11
15
  export declare function createTimeProfiler(profiling?: boolean): TimeProfiler;
@@ -1 +1 @@
1
- {"version":3,"file":"timeProfiler.d.ts","sourceRoot":"","sources":["../src/timeProfiler.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,YAAY,GAAG;IACvB,WAAW,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IAClD,gBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;CAChF,CAAA;AAgND,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAGD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAG9D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAKrD;AA0BD,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAA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AAY,CAoCjE"}
@@ -225,6 +225,22 @@ export function tallied(name, work) {
225
225
  tallyStack.pop();
226
226
  }
227
227
  }
228
+ // a tally's totals wherever it sits in the tree, for tests of instrumentation
229
+ export function findTally(name) {
230
+ const search = nodes => {
231
+ for (const node of nodes.values()) {
232
+ if (node.name === name) return node;
233
+ const found = search(node.children);
234
+ if (found !== undefined) return found;
235
+ }
236
+ return undefined;
237
+ };
238
+ const node = search(rootTallies);
239
+ return node === undefined ? undefined : {
240
+ calls: node.calls,
241
+ ms: node.ms
242
+ };
243
+ }
228
244
  function reportTallies() {
229
245
  if (rootTallies.size === 0) return;
230
246
  cliOut('');
package/dist/todo.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { warn } from './output.js';
1
2
  export function todo(task) {
2
- //warn('Todo: ' + task)
3
+ warn('Todo: ' + task);
3
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"integrateUpdateVdom.d.ts","sourceRoot":"","sources":["../../src/update/integrateUpdateVdom.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EACH,WAAW,EAAwC,eAAe,EAElE,uBAAuB,EAG1B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,OAAO,EAAE,YAAY,EAAgB,MAAM,eAAe,CAAA;AAE1D,OAAO,EACe,mBAAmB,EAIT,4BAA4B,EAI3D,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAahD,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,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