tungsten 0.3.1 → 0.3.3

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 (291) hide show
  1. package/dist/.build-complete +1 -0
  2. package/dist/Components.d.ts +2 -1
  3. package/dist/Components.d.ts.map +1 -1
  4. package/dist/Components.js +10 -1
  5. package/dist/DomRegion.js +1 -1
  6. package/dist/Framework.d.ts +2 -0
  7. package/dist/Framework.d.ts.map +1 -1
  8. package/dist/Framework.js +68 -57
  9. package/dist/FrameworkConfig.d.ts +6 -0
  10. package/dist/FrameworkConfig.d.ts.map +1 -1
  11. package/dist/FunctionComponentStandIn.d.ts +2 -0
  12. package/dist/FunctionComponentStandIn.d.ts.map +1 -1
  13. package/dist/FunctionComponentStandIn.js +10 -1
  14. package/dist/Instance/Instance.d.ts.map +1 -1
  15. package/dist/Instance/Instance.js +18 -1
  16. package/dist/Instance/InstanceConfig.d.ts +1 -0
  17. package/dist/Instance/InstanceConfig.d.ts.map +1 -1
  18. package/dist/PopMessage.type.d.ts +6 -0
  19. package/dist/PopMessage.type.d.ts.map +1 -0
  20. package/dist/PopMessage.type.js +1 -0
  21. package/dist/Servers/DevServer.d.ts +4 -0
  22. package/dist/Servers/DevServer.d.ts.map +1 -1
  23. package/dist/Servers/DevServer.js +116 -13
  24. package/dist/Servers/MatchedRouteInfo.d.ts +1 -1
  25. package/dist/Servers/MatchedRouteInfo.d.ts.map +1 -1
  26. package/dist/Servers/ProdServer.d.ts +1 -0
  27. package/dist/Servers/ProdServer.d.ts.map +1 -1
  28. package/dist/Servers/ProdServer.js +79 -5
  29. package/dist/Servers/devErrorPageAutoRetry.d.ts +4 -0
  30. package/dist/Servers/devErrorPageAutoRetry.d.ts.map +1 -0
  31. package/dist/Servers/devErrorPageAutoRetry.js +26 -0
  32. package/dist/Servers/hono/DevServerHono.js +25 -29
  33. package/dist/Servers/hono/ProdServerHono.js +49 -142
  34. package/dist/Servers/hono/TungstenServerHono.d.ts +1 -1
  35. package/dist/Servers/hono/TungstenServerHono.d.ts.map +1 -1
  36. package/dist/Servers/hono/TungstenServerHono.js +12 -29
  37. package/dist/Servers/routing.d.ts.map +1 -1
  38. package/dist/Servers/routing.js +10 -6
  39. package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts +0 -3
  40. package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts.map +1 -1
  41. package/dist/Servers/tungstenCorePrivateEnvSchema.js +3 -3
  42. package/dist/Servers/tungstenCorePublicEnvSchema.d.ts +8 -0
  43. package/dist/Servers/tungstenCorePublicEnvSchema.d.ts.map +1 -0
  44. package/dist/Servers/tungstenCorePublicEnvSchema.js +14 -0
  45. package/dist/Store/InternalStoreSchema.d.ts +2 -0
  46. package/dist/Store/InternalStoreSchema.d.ts.map +1 -1
  47. package/dist/Store/InternalStoreSchema.js +1 -0
  48. package/dist/api/Request.d.ts +1 -1
  49. package/dist/api/Request.d.ts.map +1 -1
  50. package/dist/api/Response.d.ts +1 -1
  51. package/dist/api/Response.d.ts.map +1 -1
  52. package/dist/api/getExport.d.ts.map +1 -1
  53. package/dist/api/getExport.js +2 -1
  54. package/dist/babelPlugins/BabelAddDevCacheBust.d.ts +11 -0
  55. package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -0
  56. package/dist/babelPlugins/BabelAddDevCacheBust.js +68 -0
  57. package/dist/babelPlugins/BabelTypes.d.ts +2 -2
  58. package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
  59. package/dist/babelPlugins/BabelTypes.js +0 -1
  60. package/dist/bin/commands/build.d.ts.map +1 -1
  61. package/dist/bin/commands/build.js +3 -0
  62. package/dist/bin/commands/dev.d.ts.map +1 -1
  63. package/dist/bin/commands/dev.js +16 -3
  64. package/dist/bin/commands/devmon.d.ts +2 -0
  65. package/dist/bin/commands/devmon.d.ts.map +1 -0
  66. package/dist/bin/commands/devmon.js +66 -0
  67. package/dist/bin/index.d.ts.map +1 -1
  68. package/dist/bin/index.js +6 -0
  69. package/dist/booleanAttributeValue.d.ts +21 -0
  70. package/dist/booleanAttributeValue.d.ts.map +1 -0
  71. package/dist/booleanAttributeValue.js +23 -0
  72. package/dist/build/compileJavascript.js +1 -1
  73. package/dist/build/compileUserApp.d.ts +2 -1
  74. package/dist/build/compileUserApp.d.ts.map +1 -1
  75. package/dist/build/compileUserApp.js +10 -9
  76. package/dist/build/createInstanceConfigFile.js +1 -1
  77. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  78. package/dist/build/makeBabelUserDevConfig.js +6 -1
  79. package/dist/compat/types.d.ts +1 -1
  80. package/dist/compat/types.d.ts.map +1 -1
  81. package/dist/components/PopMessages.d.ts +12 -0
  82. package/dist/components/PopMessages.d.ts.map +1 -0
  83. package/dist/components/PopMessages.js +45 -0
  84. package/dist/defaultConfig.d.ts +3 -0
  85. package/dist/defaultConfig.d.ts.map +1 -1
  86. package/dist/defaultConfig.js +4 -1
  87. package/dist/env/Interfaces.d.ts +2 -1
  88. package/dist/env/Interfaces.d.ts.map +1 -1
  89. package/dist/env/getEnvSchemas.d.ts +1 -1
  90. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  91. package/dist/env/getEnvSchemas.js +2 -1
  92. package/dist/env/publicEnv.d.ts.map +1 -1
  93. package/dist/env/publicEnv.js +4 -1
  94. package/dist/frameworkConfigSchema.d.ts +4 -0
  95. package/dist/frameworkConfigSchema.d.ts.map +1 -1
  96. package/dist/frameworkConfigSchema.js +2 -1
  97. package/dist/getComponent.d.ts.map +1 -1
  98. package/dist/getComponent.js +2 -1
  99. package/dist/getRoutes.d.ts.map +1 -1
  100. package/dist/getRoutes.js +2 -1
  101. package/dist/hmr/applyHmrModule.d.ts +11 -0
  102. package/dist/hmr/applyHmrModule.d.ts.map +1 -0
  103. package/dist/hmr/applyHmrModule.js +78 -0
  104. package/dist/hmr/componentIdentity.d.ts +9 -0
  105. package/dist/hmr/componentIdentity.d.ts.map +1 -0
  106. package/dist/hmr/componentIdentity.js +17 -0
  107. package/dist/hmr/instanceRegistry.d.ts +4 -0
  108. package/dist/hmr/instanceRegistry.d.ts.map +1 -0
  109. package/dist/hmr/instanceRegistry.js +6 -0
  110. package/dist/hmr/liveReloadHub.d.ts +10 -0
  111. package/dist/hmr/liveReloadHub.d.ts.map +1 -0
  112. package/dist/{dev → hmr}/liveReloadHub.js +8 -2
  113. package/dist/hmr/refreshStylesheets.d.ts +2 -0
  114. package/dist/hmr/refreshStylesheets.d.ts.map +1 -0
  115. package/dist/hmr/refreshStylesheets.js +26 -0
  116. package/dist/hooks/index.d.ts +1 -0
  117. package/dist/hooks/index.d.ts.map +1 -1
  118. package/dist/hooks/index.js +1 -0
  119. package/dist/hooks/useInstance.d.ts +3 -0
  120. package/dist/hooks/useInstance.d.ts.map +1 -0
  121. package/dist/hooks/useInstance.js +4 -0
  122. package/dist/hydrate/hydrate.d.ts +10 -0
  123. package/dist/hydrate/hydrate.d.ts.map +1 -1
  124. package/dist/hydrate/hydrate.js +81 -19
  125. package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
  126. package/dist/hydrate/reconcileHydratedAttributes.js +14 -5
  127. package/dist/hydrate/renderHydrationMismatchBanner.d.ts +7 -0
  128. package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -0
  129. package/dist/hydrate/renderHydrationMismatchBanner.js +69 -0
  130. package/dist/importDevModuleWithRetry.d.ts +3 -0
  131. package/dist/importDevModuleWithRetry.d.ts.map +1 -0
  132. package/dist/importDevModuleWithRetry.js +46 -0
  133. package/dist/indexInner.d.ts +8 -0
  134. package/dist/indexInner.d.ts.map +1 -1
  135. package/dist/indexInner.js +7 -1
  136. package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
  137. package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -1
  138. package/dist/pop.d.ts +10 -0
  139. package/dist/pop.d.ts.map +1 -0
  140. package/dist/pop.js +49 -0
  141. package/dist/rawHtml/filterContentNode.d.ts +20 -0
  142. package/dist/rawHtml/filterContentNode.d.ts.map +1 -0
  143. package/dist/rawHtml/filterContentNode.js +96 -0
  144. package/dist/rawHtml/parseHtml.d.ts +14 -0
  145. package/dist/rawHtml/parseHtml.d.ts.map +1 -1
  146. package/dist/rawHtml/parseHtml.js +4 -4
  147. package/dist/rawHtml/sanitizeHtml.d.ts +17 -0
  148. package/dist/rawHtml/sanitizeHtml.d.ts.map +1 -0
  149. package/dist/rawHtml/sanitizeHtml.js +19 -0
  150. package/dist/render/HeadData.d.ts +2 -0
  151. package/dist/render/HeadData.d.ts.map +1 -1
  152. package/dist/render/contentNodeToHtml.d.ts +18 -0
  153. package/dist/render/contentNodeToHtml.d.ts.map +1 -0
  154. package/dist/render/contentNodeToHtml.js +66 -0
  155. package/dist/render/contentToHtml.d.ts.map +1 -1
  156. package/dist/render/contentToHtml.js +3 -1
  157. package/dist/render/processHead.d.ts.map +1 -1
  158. package/dist/render/processHead.js +53 -6
  159. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  160. package/dist/render/renderingTreeToHtml.js +8 -1
  161. package/dist/routing/ErrorRouteType.d.ts +6 -0
  162. package/dist/routing/ErrorRouteType.d.ts.map +1 -0
  163. package/dist/routing/ErrorRouteType.js +1 -0
  164. package/dist/routing/RouteTypes.d.ts +2 -1
  165. package/dist/routing/RouteTypes.d.ts.map +1 -1
  166. package/dist/routing/Routes.d.ts +5 -0
  167. package/dist/routing/Routes.d.ts.map +1 -1
  168. package/dist/routing/TungstenErrorInfo.d.ts +6 -0
  169. package/dist/routing/TungstenErrorInfo.d.ts.map +1 -0
  170. package/dist/routing/TungstenErrorInfo.js +6 -0
  171. package/dist/style/styleContentSxy.js +21 -0
  172. package/dist/testing/hydrateTestApp.d.ts +38 -0
  173. package/dist/testing/hydrateTestApp.d.ts.map +1 -0
  174. package/dist/testing/hydrateTestApp.js +242 -0
  175. package/dist/testing/index.d.ts +4 -3
  176. package/dist/testing/index.d.ts.map +1 -1
  177. package/dist/testing/index.js +16 -2
  178. package/dist/timeProfiler.d.ts +6 -0
  179. package/dist/timeProfiler.d.ts.map +1 -0
  180. package/dist/timeProfiler.js +31 -0
  181. package/dist/update/integrateUpdateVdom.d.ts +16 -1
  182. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  183. package/dist/update/integrateUpdateVdom.js +116 -7
  184. package/dist/warnOnFrameworkChange.d.ts +2 -0
  185. package/dist/warnOnFrameworkChange.d.ts.map +1 -0
  186. package/dist/warnOnFrameworkChange.js +27 -0
  187. package/package.json +18 -16
  188. package/dist/Instance/gotoRedirect.sxyt.d.ts +0 -2
  189. package/dist/Instance/gotoRedirect.sxyt.d.ts.map +0 -1
  190. package/dist/Instance/gotoRedirect.sxyt.js +0 -148
  191. package/dist/Instance/runTrackedWork.sxyt.d.ts +0 -2
  192. package/dist/Instance/runTrackedWork.sxyt.d.ts.map +0 -1
  193. package/dist/Instance/runTrackedWork.sxyt.js +0 -35
  194. package/dist/_client/cjsHelpers.sxyt.d.ts +0 -2
  195. package/dist/_client/cjsHelpers.sxyt.d.ts.map +0 -1
  196. package/dist/_client/cjsHelpers.sxyt.js +0 -45
  197. package/dist/auth/passwordHashing.sxyt.d.ts +0 -2
  198. package/dist/auth/passwordHashing.sxyt.d.ts.map +0 -1
  199. package/dist/auth/passwordHashing.sxyt.js +0 -46
  200. package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts +0 -2
  201. package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts.map +0 -1
  202. package/dist/auth/ref/checkPasswordResetToken.sxyt.js +0 -40
  203. package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts +0 -2
  204. package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts.map +0 -1
  205. package/dist/auth/ref/createPasswordResetToken.sxyt.js +0 -10
  206. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts +0 -2
  207. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts.map +0 -1
  208. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.js +0 -108
  209. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts +0 -2
  210. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts.map +0 -1
  211. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.js +0 -104
  212. package/dist/bin/commands/compile.sxyt.d.ts +0 -2
  213. package/dist/bin/commands/compile.sxyt.d.ts.map +0 -1
  214. package/dist/bin/commands/compile.sxyt.js +0 -255
  215. package/dist/build/modifySassImports.sxyt.d.ts +0 -2
  216. package/dist/build/modifySassImports.sxyt.d.ts.map +0 -1
  217. package/dist/build/modifySassImports.sxyt.js +0 -55
  218. package/dist/build/sassImportParser.sxyt.d.ts +0 -2
  219. package/dist/build/sassImportParser.sxyt.d.ts.map +0 -1
  220. package/dist/build/sassImportParser.sxyt.js +0 -110
  221. package/dist/build/scssImportParserChatgpt.sxyt.d.ts +0 -2
  222. package/dist/build/scssImportParserChatgpt.sxyt.d.ts.map +0 -1
  223. package/dist/build/scssImportParserChatgpt.sxyt.js +0 -120
  224. package/dist/clone.sxyt.d.ts +0 -2
  225. package/dist/clone.sxyt.d.ts.map +0 -1
  226. package/dist/clone.sxyt.js +0 -24
  227. package/dist/componentProxyHandlers.sxyt.d.ts +0 -2
  228. package/dist/componentProxyHandlers.sxyt.d.ts.map +0 -1
  229. package/dist/componentProxyHandlers.sxyt.js +0 -130
  230. package/dist/components/RawHtml.sxyt.d.ts +0 -2
  231. package/dist/components/RawHtml.sxyt.d.ts.map +0 -1
  232. package/dist/components/RawHtml.sxyt.js +0 -104
  233. package/dist/components/bindable/BindableSelect.sxyt.d.ts +0 -2
  234. package/dist/components/bindable/BindableSelect.sxyt.d.ts.map +0 -1
  235. package/dist/components/bindable/BindableSelect.sxyt.js +0 -186
  236. package/dist/dev/liveReloadHub.d.ts +0 -6
  237. package/dist/dev/liveReloadHub.d.ts.map +0 -1
  238. package/dist/env/injectEnv.sxyt.d.ts +0 -2
  239. package/dist/env/injectEnv.sxyt.d.ts.map +0 -1
  240. package/dist/env/injectEnv.sxyt.js +0 -20
  241. package/dist/env/parseEnv.sxyt.d.ts +0 -2
  242. package/dist/env/parseEnv.sxyt.d.ts.map +0 -1
  243. package/dist/env/parseEnv.sxyt.js +0 -11
  244. package/dist/findProjectDir.sxyt.d.ts +0 -2
  245. package/dist/findProjectDir.sxyt.d.ts.map +0 -1
  246. package/dist/findProjectDir.sxyt.js +0 -82
  247. package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts +0 -2
  248. package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts.map +0 -1
  249. package/dist/hydrate/reconcileHydratedAttributes.sxyt.js +0 -173
  250. package/dist/innerHtmlFromProps.sxyt.d.ts +0 -2
  251. package/dist/innerHtmlFromProps.sxyt.d.ts.map +0 -1
  252. package/dist/innerHtmlFromProps.sxyt.js +0 -99
  253. package/dist/postcssPlugins/parseSelectors.sxyt.d.ts +0 -2
  254. package/dist/postcssPlugins/parseSelectors.sxyt.d.ts.map +0 -1
  255. package/dist/postcssPlugins/parseSelectors.sxyt.js +0 -62
  256. package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts +0 -2
  257. package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts.map +0 -1
  258. package/dist/postcssPlugins/parseSelectorsRich.sxyt.js +0 -155
  259. package/dist/rawHtml/parseHtml.sxyt.d.ts +0 -2
  260. package/dist/rawHtml/parseHtml.sxyt.d.ts.map +0 -1
  261. package/dist/rawHtml/parseHtml.sxyt.js +0 -239
  262. package/dist/render/getFunctionBodyAsString.sxyt.d.ts +0 -2
  263. package/dist/render/getFunctionBodyAsString.sxyt.d.ts.map +0 -1
  264. package/dist/render/getFunctionBodyAsString.sxyt.js +0 -37
  265. package/dist/render/processProps.sxyt.d.ts +0 -2
  266. package/dist/render/processProps.sxyt.d.ts.map +0 -1
  267. package/dist/render/processProps.sxyt.js +0 -90
  268. package/dist/routing/compareRequestToRegex.sxyt.d.ts +0 -2
  269. package/dist/routing/compareRequestToRegex.sxyt.d.ts.map +0 -1
  270. package/dist/routing/compareRequestToRegex.sxyt.js +0 -65
  271. package/dist/routing/getPathPriority.sxyt.d.ts +0 -2
  272. package/dist/routing/getPathPriority.sxyt.d.ts.map +0 -1
  273. package/dist/routing/getPathPriority.sxyt.js +0 -24
  274. package/dist/routing/matchPath.sxyt.d.ts +0 -2
  275. package/dist/routing/matchPath.sxyt.d.ts.map +0 -1
  276. package/dist/routing/matchPath.sxyt.js +0 -41
  277. package/dist/routing/patternToRegex.sxyt.d.ts +0 -2
  278. package/dist/routing/patternToRegex.sxyt.d.ts.map +0 -1
  279. package/dist/routing/patternToRegex.sxyt.js +0 -69
  280. package/dist/routing/splitRequest.sxyt.d.ts +0 -2
  281. package/dist/routing/splitRequest.sxyt.d.ts.map +0 -1
  282. package/dist/routing/splitRequest.sxyt.js +0 -47
  283. package/dist/style/jssToCss.sxyt.d.ts +0 -2
  284. package/dist/style/jssToCss.sxyt.d.ts.map +0 -1
  285. package/dist/style/jssToCss.sxyt.js +0 -17
  286. package/dist/testing/createTestApp.sxyt.d.ts +0 -2
  287. package/dist/testing/createTestApp.sxyt.d.ts.map +0 -1
  288. package/dist/testing/createTestApp.sxyt.js +0 -470
  289. package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts +0 -2
  290. package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts.map +0 -1
  291. package/dist/testing/ensureTestEnvLoaded.sxyt.js +0 -20
@@ -1,65 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { expect } from 'chai';
3
- import { objects } from 'sxy-lib';
4
- import { compareRequestToRegex } from "./compareRequestToRegex.js";
5
- import { patternToRegex } from "./patternToRegex.js";
6
- describe('routing/compareRequestToRegex()', ({
7
- it
8
- }) => {
9
- it(`/foo matches /foo no params`, () => {
10
- const pattern = '/foo';
11
- const request = '/foo';
12
- const {
13
- regex,
14
- keys
15
- } = patternToRegex(pattern);
16
- const {
17
- success,
18
- params
19
- } = compareRequestToRegex(request, regex, keys);
20
- success.should.equal(true);
21
- objects.count(params).should.equal(0);
22
- });
23
- it(`/foo does not match /foo/bar`, () => {
24
- const pattern = '/foo';
25
- const request = '/foo/bar';
26
- const {
27
- regex,
28
- keys
29
- } = patternToRegex(pattern);
30
- const {
31
- success,
32
- params
33
- } = compareRequestToRegex(request, regex, keys); // eslint-disable-line @typescript-eslint/no-unused-vars
34
- success.should.equal(false);
35
- });
36
- it(`/foo/:bar matches /foo/bing with the params { bar: 'bing' }"`, () => {
37
- const pattern = '/foo/:bar';
38
- const request = '/foo/bing';
39
- const {
40
- regex,
41
- keys
42
- } = patternToRegex(pattern);
43
- const c = compareRequestToRegex(request, regex, keys);
44
- const {
45
- success,
46
- params
47
- } = c;
48
- success.should.equal(true);
49
- objects.count(params).should.equal(1);
50
- expect(params.bar).to.equal('bing');
51
- });
52
- it(`/foo/:bar does not match /foo/"`, () => {
53
- const pattern = '/foo/:bar';
54
- const request = '/foo/';
55
- const {
56
- regex,
57
- keys
58
- } = patternToRegex(pattern);
59
- const {
60
- success,
61
- params
62
- } = compareRequestToRegex(request, regex, keys); // eslint-disable-line @typescript-eslint/no-unused-vars
63
- success.should.equal(false);
64
- });
65
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=getPathPriority.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getPathPriority.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/getPathPriority.sxyt.ts"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { getPathPriority } from "./getPathPriority.js";
3
- describe('routing/compareRequestToRegex()', ({
4
- it
5
- }) => {
6
- it(`/foo returns priority 2`, () => {
7
- const pattern = '/foo';
8
- const priority = getPathPriority(pattern);
9
- //console.log('priority', priority)
10
- priority.should.equal(2);
11
- });
12
- it(`/foo/:bar/foo returns priority 212`, () => {
13
- const pattern = '/foo/:bar/foo';
14
- const priority = getPathPriority(pattern);
15
- //console.log('priority', priority)
16
- priority.should.equal(212);
17
- });
18
- it(`/foo/:bar([^\\/])/foo returns priority 212`, () => {
19
- const pattern = '/foo/:bar([^\\/])/foo';
20
- const priority = getPathPriority(pattern);
21
- //console.log('priority', priority)
22
- priority.should.equal(212);
23
- });
24
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=matchPath.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"matchPath.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/matchPath.sxyt.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { expect } from 'chai';
3
- import { matchPath } from "./matchPath.js";
4
- describe('routing/matchPath()', ({
5
- it
6
- }) => {
7
- it(`returns null for /foo against /bar`, () => {
8
- expect(matchPath('/foo', '/bar')).to.equal(null);
9
- });
10
- it(`returns match object for /foo against /foo`, () => {
11
- const match = matchPath('/foo', '/foo');
12
- expect(match).not.to.equal(null);
13
- });
14
- it(`returns match object for /foo/ against /foo`, () => {
15
- const match = matchPath('/foo/', '/foo');
16
- expect(match).not.to.equal(null);
17
- });
18
- it(`matches /foo when the request has a query string`, () => {
19
- const match = matchPath('/foo', '/foo?bar=1');
20
- expect(match).not.to.equal(null);
21
- expect(match.query).to.deep.equal({
22
- bar: '1'
23
- });
24
- expect(match.pathname).to.equal('/foo');
25
- });
26
- it(`matches /foo when the request has a hash fragment`, () => {
27
- const match = matchPath('/foo', '/foo#section');
28
- expect(match).not.to.equal(null);
29
- expect(match.hash).to.equal('section');
30
- });
31
- it(`matches a dynamic route with a query string and captures the param`, () => {
32
- const match = matchPath('/leads/:id/details', '/leads/5/details?queue=1');
33
- expect(match).not.to.equal(null);
34
- expect(match.params).to.deep.equal({
35
- id: '5'
36
- });
37
- expect(match.query).to.deep.equal({
38
- queue: '1'
39
- });
40
- });
41
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=patternToRegex.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"patternToRegex.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/patternToRegex.sxyt.ts"],"names":[],"mappings":""}
@@ -1,69 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { patternToRegex } from "./patternToRegex.js";
3
- import { regexEquals } from "../_testing/regexEquals.js";
4
- describe('routing/patternToRegex()', ({
5
- it
6
- }) => {
7
- it(`Converts /foo to /^\\/foo\\/?$/ with no keys`, () => {
8
- const {
9
- regex,
10
- keys
11
- } = patternToRegex('/foo');
12
- regexEquals(regex, /^\/foo\/?$/).should.equal(true);
13
- keys.length.should.equal(0);
14
- });
15
- it(`Converts /foo/:bar to /^\\/foo\\/([^/]+)\\/?$/ and saves the key "bar"`, () => {
16
- const {
17
- regex,
18
- keys
19
- } = patternToRegex('/foo/:bar');
20
- regexEquals(regex, /^\/foo\/([^/]+)\/?$/).should.equal(true);
21
- keys.length.should.equal(1);
22
- keys[0].should.equal('bar');
23
- });
24
- it(`Converts /foo/:bar(\\d+) to /^\\/foo\\/(\\d+)\\/?$/, preserving the regex matcher, and saves the key "bar"`, () => {
25
- const {
26
- regex,
27
- keys
28
- } = patternToRegex('/foo/:bar(\\d+)');
29
- regexEquals(regex, /^\/foo\/(\d+)\/?$/).should.equal(true);
30
- keys.length.should.equal(1);
31
- keys[0].should.equal('bar');
32
- });
33
- it(`Converts /foo/:bar/baz to /^\\/foo\\/([^/]+)\\/baz/?$/ and saves the key "bar"`, () => {
34
- const {
35
- regex,
36
- keys
37
- } = patternToRegex('/foo/:bar/baz');
38
- regexEquals(regex, /^\/foo\/([^/]+)\/baz\/?$/).should.equal(true);
39
- keys.length.should.equal(1);
40
- keys[0].should.equal('bar');
41
- });
42
- it(`Converts /foo/:bar<digits> to /^\\/foo\\/(\\d+)\\/?$/ and saves the key "bar"`, () => {
43
- const {
44
- regex,
45
- keys
46
- } = patternToRegex('/foo/:bar<digits>');
47
- regexEquals(regex, /^\/foo\/(\d+)\/?$/).should.equal(true);
48
- keys.length.should.equal(1);
49
- keys[0].should.equal('bar');
50
- });
51
- it(`Converts /foo/:bar<int-ge1> to /^\\/foo\\/([1-9]\\d*)\\/?$/ and saves the key "bar"`, () => {
52
- const {
53
- regex,
54
- keys
55
- } = patternToRegex('/foo/:bar<int-ge1>');
56
- regexEquals(regex, /^\/foo\/([1-9]\d*)\/?$/).should.equal(true);
57
- keys.length.should.equal(1);
58
- keys[0].should.equal('bar');
59
- });
60
- it(`Converts /foo/:bar<1+> to /^\\/foo\\/([1-9]\\d*)\\/?$/ and saves the key "bar"`, () => {
61
- const {
62
- regex,
63
- keys
64
- } = patternToRegex('/foo/:bar<1+>');
65
- regexEquals(regex, /^\/foo\/([1-9]\d*)\/?$/).should.equal(true);
66
- keys.length.should.equal(1);
67
- keys[0].should.equal('bar');
68
- });
69
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=splitRequest.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitRequest.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/splitRequest.sxyt.ts"],"names":[],"mappings":""}
@@ -1,47 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { expect } from 'chai';
3
- import { splitRequest } from "./splitRequest.js";
4
- describe('routing/splitRequest()', ({
5
- it
6
- }) => {
7
- it(`returns the path unchanged when there is no query or hash`, () => {
8
- expect(splitRequest('/foo/bar')).to.deep.equal({
9
- pathname: '/foo/bar',
10
- query: {},
11
- hash: ''
12
- });
13
- });
14
- it(`splits off a query string and parses it`, () => {
15
- expect(splitRequest('/foo?a=1&b=2')).to.deep.equal({
16
- pathname: '/foo',
17
- query: {
18
- a: '1',
19
- b: '2'
20
- },
21
- hash: ''
22
- });
23
- });
24
- it(`splits off a hash fragment`, () => {
25
- expect(splitRequest('/foo#section')).to.deep.equal({
26
- pathname: '/foo',
27
- query: {},
28
- hash: 'section'
29
- });
30
- });
31
- it(`splits off both query and hash`, () => {
32
- expect(splitRequest('/foo?a=1#section')).to.deep.equal({
33
- pathname: '/foo',
34
- query: {
35
- a: '1'
36
- },
37
- hash: 'section'
38
- });
39
- });
40
- it(`does not treat a '?' inside the hash as a query delimiter`, () => {
41
- expect(splitRequest('/foo#a?b')).to.deep.equal({
42
- pathname: '/foo',
43
- query: {},
44
- hash: 'a?b'
45
- });
46
- });
47
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=jssToCss.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jssToCss.sxyt.d.ts","sourceRoot":"","sources":["../../src/style/jssToCss.sxyt.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- export {};
2
- /*
3
- describe('jssToCss()', ({it}: DescribeArg) => {
4
- it(`Converts color: red`, () => {
5
- // @ts-ignore
6
- jssToCss({ color: 'red'}).should.equal('color: red;')
7
- })
8
- it(`Converts border-color: red`, () => {
9
- // @ts-ignore
10
- jssToCss({ borderColor: 'red'}).should.equal('border-color: red;')
11
- })
12
- it(`Converts font-size: 14px`, () => {
13
- // @ts-ignore
14
- jssToCss({ fontSize: 14}).should.equal('font-size: 14px;')
15
- })
16
- })
17
- */
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=createTestApp.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createTestApp.sxyt.d.ts","sourceRoot":"","sources":["../../src/testing/createTestApp.sxyt.tsx"],"names":[],"mappings":""}