tungsten 0.4.11 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (449) hide show
  1. package/dist/.build-complete +1 -1
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/AnyComponent.d.ts.map +1 -1
  4. package/dist/AnyComponent.js +1 -1
  5. package/dist/Components.d.ts.map +1 -1
  6. package/dist/Components.js +25 -23
  7. package/dist/ContentNode.js +2 -2
  8. package/dist/DomPointer.js +1 -1
  9. package/dist/DomRegion.js +3 -3
  10. package/dist/Framework.d.ts +2 -1
  11. package/dist/Framework.d.ts.map +1 -1
  12. package/dist/Framework.js +44 -35
  13. package/dist/FrameworkConfig.d.ts +16 -0
  14. package/dist/FrameworkConfig.d.ts.map +1 -1
  15. package/dist/FunctionComponentStandIn.js +8 -8
  16. package/dist/Instance/Instance.js +12 -12
  17. package/dist/RenderedContentNode.d.ts.map +1 -1
  18. package/dist/RenderedContentNode.js +4 -3
  19. package/dist/RenderingNode.js +2 -2
  20. package/dist/Sass.d.ts.map +1 -1
  21. package/dist/Sass.js +1 -0
  22. package/dist/Script.js +1 -1
  23. package/dist/Servers/DevServer.d.ts.map +1 -1
  24. package/dist/Servers/DevServer.js +33 -32
  25. package/dist/Servers/ProdServer.js +15 -15
  26. package/dist/Servers/StaticSiteServer.js +4 -4
  27. package/dist/Servers/TungstenServer.js +5 -5
  28. package/dist/Servers/devErrorPageAutoRetry.js +1 -1
  29. package/dist/Servers/initStores.js +3 -3
  30. package/dist/Servers/loadEnvsDev.d.ts +1 -1
  31. package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
  32. package/dist/Servers/loadEnvsDev.js +10 -8
  33. package/dist/Servers/routing.d.ts.map +1 -1
  34. package/dist/Servers/routing.js +4 -4
  35. package/dist/Store/Store.js +1 -1
  36. package/dist/Store/TypeSafeStore.js +1 -1
  37. package/dist/Store/createStores.js +2 -2
  38. package/dist/Store/makeStore.js +3 -3
  39. package/dist/Store/registerStore.js +3 -3
  40. package/dist/TElement.js +1 -1
  41. package/dist/TungstenApp.js +9 -5
  42. package/dist/TungstenStyleObject.js +1 -1
  43. package/dist/__deproxy.js +2 -2
  44. package/dist/_client/client.js +3 -3
  45. package/dist/alive.js +1 -1
  46. package/dist/api/getApiRoutes.js +3 -3
  47. package/dist/api/getExport.d.ts.map +1 -1
  48. package/dist/api/getExport.js +5 -4
  49. package/dist/api/getExportDev.js +1 -1
  50. package/dist/appOutput.js +1 -1
  51. package/dist/auth/index.js +2 -2
  52. package/dist/babelPlugins/BabelAddDevCacheBust.d.ts.map +1 -1
  53. package/dist/babelPlugins/BabelAddDevCacheBust.js +4 -2
  54. package/dist/babelPlugins/BabelTransformBindDirect.js +4 -2
  55. package/dist/babelPlugins/BabelTransformBindVar.d.ts.map +1 -1
  56. package/dist/babelPlugins/BabelTransformBindVar.js +3 -3
  57. package/dist/babelPlugins/BabelTransformCjsToEsm.js +1 -1
  58. package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
  59. package/dist/babelPlugins/BabelTransformComponentState.js +2 -2
  60. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
  61. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
  62. package/dist/babelPlugins/BabelTransformComponentStyles.js +32 -15
  63. package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
  64. package/dist/babelPlugins/BabelTransformCssImports.js +3 -3
  65. package/dist/babelPlugins/BabelTransformDependencyImportsOld.js +1 -1
  66. package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
  67. package/dist/babelPlugins/BabelTransformDeproxyState.js +1 -1
  68. package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.d.ts.map +1 -1
  69. package/dist/babelPlugins/BabelTransformJsxExtensionsToJs.js +6 -2
  70. package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
  71. package/dist/babelPlugins/BabelTransformPackageImports.js +75 -53
  72. package/dist/babelPlugins/BabelTransformReactive.js +1 -1
  73. package/dist/babelPlugins/BabelTransformReactiveSvelteStyle.js +1 -1
  74. package/dist/babelPlugins/BabelTransformRemoveBlocks.d.ts.map +1 -1
  75. package/dist/babelPlugins/BabelTransformSxyFrameworkImports.js +1 -1
  76. package/dist/babelPlugins/BabelTransformUniqueComponents.js +1 -1
  77. package/dist/babelPlugins/fixImportsInSassErrorMessage.js +1 -1
  78. package/dist/babelPlugins/test.js +1 -1
  79. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
  80. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +5 -4
  81. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
  82. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +3 -2
  83. package/dist/babelPlugins/transformPackageImports/getWebLocationOfPackageFile.js +2 -2
  84. package/dist/bin/args.js +2 -2
  85. package/dist/bin/commands/build.js +6 -6
  86. package/dist/bin/commands/buildHelp.js +1 -1
  87. package/dist/bin/commands/clean.js +4 -4
  88. package/dist/bin/commands/compile.d.ts.map +1 -1
  89. package/dist/bin/commands/compile.js +24 -17
  90. package/dist/bin/commands/compileSimplePackage.js +3 -2
  91. package/dist/bin/commands/dev.d.ts.map +1 -1
  92. package/dist/bin/commands/dev.js +16 -9
  93. package/dist/bin/commands/devmon.js +4 -4
  94. package/dist/bin/commands/help.js +2 -2
  95. package/dist/bin/commands/start.js +2 -2
  96. package/dist/bin/commands/static.js +3 -3
  97. package/dist/bin/index.d.ts.map +1 -1
  98. package/dist/bin/index.js +24 -16
  99. package/dist/bin/moduleLoadAnalysis.js +2 -2
  100. package/dist/bin/vendorHook.d.ts +3 -0
  101. package/dist/bin/vendorHook.d.ts.map +1 -0
  102. package/dist/bin/vendorHook.js +34 -0
  103. package/dist/browserStorage.js +6 -4
  104. package/dist/build/babel.user.common.config.d.ts +9 -2
  105. package/dist/build/babel.user.common.config.d.ts.map +1 -1
  106. package/dist/build/babel.user.common.config.js +21 -16
  107. package/dist/build/bundle.d.ts +1 -1
  108. package/dist/build/bundle.d.ts.map +1 -1
  109. package/dist/build/bundle.js +15 -7
  110. package/dist/build/bundleBabelOptions.d.ts +6 -0
  111. package/dist/build/bundleBabelOptions.d.ts.map +1 -0
  112. package/dist/build/bundleBabelOptions.js +23 -0
  113. package/dist/build/combineComponentCss.js +2 -2
  114. package/dist/build/compileJavascript.d.ts +4 -0
  115. package/dist/build/compileJavascript.d.ts.map +1 -1
  116. package/dist/build/compileJavascript.js +174 -103
  117. package/dist/build/compileStyles.js +8 -8
  118. package/dist/build/compileUserApp.d.ts +1 -1
  119. package/dist/build/compileUserApp.d.ts.map +1 -1
  120. package/dist/build/compileUserApp.js +15 -12
  121. package/dist/build/componentStylesCache.d.ts +10 -0
  122. package/dist/build/componentStylesCache.d.ts.map +1 -0
  123. package/dist/build/componentStylesCache.js +54 -0
  124. package/dist/build/copyAssets.js +4 -4
  125. package/dist/build/copyPackageModulesToPackagesFolder.js +4 -4
  126. package/dist/build/copyPublicFiles.js +4 -4
  127. package/dist/build/createClientFiles.js +3 -3
  128. package/dist/build/createInstanceConfigFile.js +2 -2
  129. package/dist/build/createPackageVirtualFileSystems.js +1 -1
  130. package/dist/build/devBundle.js +5 -5
  131. package/dist/build/devBundle.rollup.config.d.ts.map +1 -1
  132. package/dist/build/devBundle.rollup.config.js +0 -1
  133. package/dist/build/frameworkDestLocation.d.ts +1 -0
  134. package/dist/build/frameworkDestLocation.d.ts.map +1 -1
  135. package/dist/build/frameworkDestLocation.js +8 -4
  136. package/dist/build/frameworkStylesheets.js +2 -2
  137. package/dist/build/getAllSxyClientModules.d.ts.map +1 -1
  138. package/dist/build/getAllSxyClientModules.js +4 -28
  139. package/dist/build/getPackageDirForFile.js +1 -1
  140. package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
  141. package/dist/build/getSxyClientPackageAliases.js +4 -2
  142. package/dist/build/getTempDirForAppCompilation.js +1 -1
  143. package/dist/build/makeBabelRawConfig.d.ts +3 -0
  144. package/dist/build/makeBabelRawConfig.d.ts.map +1 -0
  145. package/dist/build/makeBabelRawConfig.js +12 -0
  146. package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
  147. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  148. package/dist/build/makeBabelUserDevConfig.js +11 -8
  149. package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
  150. package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
  151. package/dist/build/makeBabelUserProdConfig.js +10 -5
  152. package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
  153. package/dist/build/rollup.user.prod.config.js +13 -11
  154. package/dist/build/rollupExtractComponentStylesheets.js +3 -3
  155. package/dist/build/sassImportParser.js +4 -4
  156. package/dist/build/tallyBabel.d.ts +3 -0
  157. package/dist/build/tallyBabel.d.ts.map +1 -0
  158. package/dist/build/tallyBabel.js +11 -0
  159. package/dist/calculateImportedStaticFileLocations.js +2 -2
  160. package/dist/calledFrom.js +2 -2
  161. package/dist/clone.js +4 -4
  162. package/dist/compat/context.d.ts.map +1 -1
  163. package/dist/compat/forwardRef.js +1 -1
  164. package/dist/compat/index.js +1 -1
  165. package/dist/compat/types.d.ts.map +1 -1
  166. package/dist/componentProxyHandlers.d.ts.map +1 -1
  167. package/dist/componentProxyHandlers.js +8 -12
  168. package/dist/components/Link.js +2 -2
  169. package/dist/components/PopMessages.js +3 -3
  170. package/dist/components/RawHtml.js +2 -2
  171. package/dist/components/Stylesheet.d.ts +1 -2
  172. package/dist/components/Stylesheet.d.ts.map +1 -1
  173. package/dist/components/Stylesheet.js +4 -4
  174. package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
  175. package/dist/components/bindable/BindableCheckbox.js +1 -1
  176. package/dist/components/bindable/BindableInput.d.ts.map +1 -1
  177. package/dist/components/bindable/BindableInput.js +1 -1
  178. package/dist/components/bindable/BindableInputNonString.js +1 -1
  179. package/dist/components/bindable/BindableInputString.js +1 -1
  180. package/dist/components/bindable/BindableInputTyped.js +1 -1
  181. package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
  182. package/dist/components/bindable/BindableInputTypedLegacy.js +1 -1
  183. package/dist/components/bindable/BindableRadio.d.ts.map +1 -1
  184. package/dist/components/bindable/BindableRadio.js +1 -1
  185. package/dist/components/bindable/BindableSelect.js +1 -1
  186. package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
  187. package/dist/components/bindable/BindableTextarea.js +1 -1
  188. package/dist/components/library/RichTextEditor/RichTextEditor.js +10 -10
  189. package/dist/components/library/RichTextEditor/contentTree.js +5 -5
  190. package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +2 -2
  191. package/dist/components/library/__StatefulMessage/StatefulMessage.js +2 -2
  192. package/dist/components/library/index.js +2 -2
  193. package/dist/concat.d.ts.map +1 -1
  194. package/dist/concat.js +2 -2
  195. package/dist/copy.d.ts.map +1 -1
  196. package/dist/createElement.js +1 -1
  197. package/dist/createRoutes.d.ts +1 -1
  198. package/dist/createRoutes.d.ts.map +1 -1
  199. package/dist/defaultConfig.d.ts +0 -1
  200. package/dist/defaultConfig.d.ts.map +1 -1
  201. package/dist/defaultConfig.js +2 -2
  202. package/dist/deleteDirs.js +1 -1
  203. package/dist/env/Env.js +2 -2
  204. package/dist/env/addToEnv.js +1 -1
  205. package/dist/env/funcs.js +4 -4
  206. package/dist/env/getEnvSchemas.d.ts +2 -2
  207. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  208. package/dist/env/getEnvSchemas.js +16 -10
  209. package/dist/env/privateEnv.js +2 -2
  210. package/dist/env/privateEnvOrThrow.js +1 -1
  211. package/dist/env/publicEnv.js +1 -1
  212. package/dist/env/publicEnvOrThrow.js +1 -1
  213. package/dist/env/windowGlobalEnvStatement.d.ts.map +1 -1
  214. package/dist/filePathFromUrl.js +1 -1
  215. package/dist/findProjectDir.d.ts.map +1 -1
  216. package/dist/findProjectDir.js +19 -5
  217. package/dist/findUserConfig.js +7 -7
  218. package/dist/fixExtension.d.ts.map +1 -1
  219. package/dist/fixExtension.js +5 -3
  220. package/dist/foreach.js +1 -0
  221. package/dist/frameworkConfigSchema.d.ts +16 -0
  222. package/dist/frameworkConfigSchema.d.ts.map +1 -1
  223. package/dist/frameworkConfigSchema.js +14 -2
  224. package/dist/getComponent.d.ts.map +1 -1
  225. package/dist/getComponent.js +5 -5
  226. package/dist/getComponentDev.d.ts.map +1 -1
  227. package/dist/getComponentDev.js +1 -1
  228. package/dist/getFrameworkDir.js +1 -1
  229. package/dist/getRoutes.d.ts.map +1 -1
  230. package/dist/getRoutes.js +18 -27
  231. package/dist/getRoutesDevs.d.ts.map +1 -1
  232. package/dist/getRoutesDevs.js +1 -1
  233. package/dist/getStackTrace.js +1 -1
  234. package/dist/getUserConfig.js +7 -7
  235. package/dist/glob.d.ts +5 -0
  236. package/dist/glob.d.ts.map +1 -0
  237. package/dist/glob.js +103 -0
  238. package/dist/hasValidKey.js +1 -1
  239. package/dist/helpers/getFetchCompatibleHeaders.js +2 -2
  240. package/dist/helpers/index.js +2 -2
  241. package/dist/hmr/applyHmrModule.js +10 -10
  242. package/dist/hmr/componentIdentity.js +3 -3
  243. package/dist/hmr/instanceRegistry.js +2 -2
  244. package/dist/hooks/clearCurrentComponent.js +1 -1
  245. package/dist/hooks/getCurrentComponent.js +3 -3
  246. package/dist/hooks/index.js +5 -5
  247. package/dist/hooks/setCurrentComponent.js +1 -1
  248. package/dist/hooks/useCallback.js +2 -2
  249. package/dist/hooks/useEffect.js +2 -2
  250. package/dist/hooks/useInstance.js +1 -1
  251. package/dist/hooks/useMemo.js +2 -2
  252. package/dist/hooks/useReducer.d.ts.map +1 -1
  253. package/dist/hooks/useState.d.ts.map +1 -1
  254. package/dist/hooks/useState.js +3 -9
  255. package/dist/hydrate/hydrate.d.ts +1 -1
  256. package/dist/hydrate/hydrate.d.ts.map +1 -1
  257. package/dist/hydrate/hydrate.js +56 -54
  258. package/dist/hydrate/reconcileHydratedAttributes.js +5 -5
  259. package/dist/index.js +2 -2
  260. package/dist/indexInner.d.ts +1 -1
  261. package/dist/indexInner.d.ts.map +1 -1
  262. package/dist/indexInner.js +45 -45
  263. package/dist/innerHtmlFromProps.js +1 -1
  264. package/dist/isBrowser.js +1 -1
  265. package/dist/isDev.js +1 -1
  266. package/dist/isProd.js +1 -1
  267. package/dist/isServer.js +1 -1
  268. package/dist/jsx-runtime.js +1 -1
  269. package/dist/jsxRuntime.d.ts.map +1 -1
  270. package/dist/jsxRuntime.js +12 -7
  271. package/dist/jsxRuntimeSignals.d.ts.map +1 -1
  272. package/dist/jsxRuntimeSignals.js +15 -8
  273. package/dist/makeFinalConfig.d.ts.map +1 -1
  274. package/dist/makeFinalConfig.js +3 -3
  275. package/dist/makeInstanceConfigFromFrameworkConfig.js +1 -1
  276. package/dist/makeServerRpc.js +3 -3
  277. package/dist/markOptionSelected.js +2 -2
  278. package/dist/mergeConfigs.d.ts.map +1 -1
  279. package/dist/mergeConfigs.js +11 -2
  280. package/dist/mutatingFunctions.js +3 -3
  281. package/dist/nbsp.js +1 -1
  282. package/dist/output.js +1 -1
  283. package/dist/pop.js +2 -2
  284. package/dist/postcssPlugins/TransformCssNames.js +8 -8
  285. package/dist/postcssPlugins/parseSelectors.js +1 -1
  286. package/dist/postcssPlugins/parseSelectorsRich.js +1 -1
  287. package/dist/postcssPlugins/scopeAnimationValue.js +2 -2
  288. package/dist/propsAreEqual.js +3 -3
  289. package/dist/rawHtml/filterContentNode.js +4 -4
  290. package/dist/rawHtml/parseHtml.js +5 -5
  291. package/dist/rawHtml/sanitizeHtml.js +3 -3
  292. package/dist/rawHtml/tokenizeHtml.js +2 -2
  293. package/dist/render/addImportMap.js +2 -2
  294. package/dist/render/classComponentNodeToRenderingTree.js +4 -4
  295. package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
  296. package/dist/render/componentNodeToRenderingTree.js +13 -24
  297. package/dist/render/contentNodeToHtml.js +11 -11
  298. package/dist/render/contentToHtml.d.ts.map +1 -1
  299. package/dist/render/contentToHtml.js +5 -5
  300. package/dist/render/contentToHtmlDev.js +1 -1
  301. package/dist/render/contentTreeToRenderingTree.js +7 -7
  302. package/dist/render/functionComponentNodeToRenderingTree.js +4 -4
  303. package/dist/render/getFunctionBodyAsString.d.ts.map +1 -1
  304. package/dist/render/getFunctionBodyAsString.js +3 -6
  305. package/dist/render/instantiateClassComponent.js +2 -2
  306. package/dist/render/instantiateComponent.js +3 -3
  307. package/dist/render/instantiateFunctionComponent.js +2 -2
  308. package/dist/render/printComponentNameInSource.js +1 -1
  309. package/dist/render/processHead.js +5 -5
  310. package/dist/render/processHtmlNode.js +1 -1
  311. package/dist/render/processProps.js +4 -4
  312. package/dist/render/processRenderingNodeHtml.js +6 -6
  313. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  314. package/dist/render/renderingTreeToHtml.js +16 -16
  315. package/dist/render/rootToHtml.d.ts.map +1 -1
  316. package/dist/render/rootToHtml.js +2 -2
  317. package/dist/render/rootToHtmlDev.js +1 -1
  318. package/dist/requests/fetch/delete.js +2 -2
  319. package/dist/requests/fetch/get.js +3 -3
  320. package/dist/requests/fetch/patch.js +2 -2
  321. package/dist/requests/fetch/post.js +2 -2
  322. package/dist/requests/fetch/put.js +2 -2
  323. package/dist/requests/index.js +5 -5
  324. package/dist/routing/MatchedRoute.js +2 -2
  325. package/dist/routing/Route.js +1 -1
  326. package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
  327. package/dist/routing/RoutesWithSafeParams.js +1 -1
  328. package/dist/routing/WebRedirect.d.ts.map +1 -1
  329. package/dist/routing/compareRequestToRegex.js +2 -2
  330. package/dist/routing/getPathPriority.js +2 -2
  331. package/dist/routing/matchPath.js +3 -3
  332. package/dist/routing/patternToRegex.js +1 -1
  333. package/dist/server.js +3 -3
  334. package/dist/serverModuleLocation.d.ts +3 -0
  335. package/dist/serverModuleLocation.d.ts.map +1 -0
  336. package/dist/serverModuleLocation.js +12 -0
  337. package/dist/serverRpc.d.ts.map +1 -1
  338. package/dist/settings.d.ts +4 -0
  339. package/dist/settings.d.ts.map +1 -1
  340. package/dist/settings.js +9 -0
  341. package/dist/slash.d.ts +2 -0
  342. package/dist/slash.d.ts.map +1 -0
  343. package/dist/slash.js +5 -0
  344. package/dist/spawnShellCommand.js +1 -1
  345. package/dist/standardSchema.js +1 -1
  346. package/dist/staticGen/getAppRoutes.js +3 -3
  347. package/dist/staticGen/staticGen.d.ts.map +1 -1
  348. package/dist/staticGen/staticGen.js +16 -14
  349. package/dist/staticGen/staticGenFunctions.js +1 -1
  350. package/dist/style/jssToCss.d.ts.map +1 -1
  351. package/dist/style/jssToCss.js +13 -11
  352. package/dist/style/styleContent.js +1 -1
  353. package/dist/style/styleContentSxy.js +8 -8
  354. package/dist/style/unusedStyles.d.ts.map +1 -1
  355. package/dist/style/unusedStyles.js +1 -1
  356. package/dist/sync/index.js +1 -1
  357. package/dist/syncServer/preload.js +1 -1
  358. package/dist/testing/host.js +12 -12
  359. package/dist/testing/hydrateTestApp.d.ts.map +1 -1
  360. package/dist/testing/hydrateTestApp.js +18 -18
  361. package/dist/testing/index.d.ts.map +1 -1
  362. package/dist/testing/index.js +11 -11
  363. package/dist/testing/installTestStyleProcessors.js +2 -2
  364. package/dist/testing/loadEnv.d.ts +4 -1
  365. package/dist/testing/loadEnv.d.ts.map +1 -1
  366. package/dist/testing/loadEnv.js +5 -5
  367. package/dist/testing/temp/componentPackageMock.js +5 -5
  368. package/dist/testing/temp/contentHtmlElements.js +2 -2
  369. package/dist/throwError.js +2 -2
  370. package/dist/timeProfiler.d.ts +5 -1
  371. package/dist/timeProfiler.d.ts.map +1 -1
  372. package/dist/timeProfiler.js +76 -24
  373. package/dist/todo.js +2 -1
  374. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  375. package/dist/update/integrateUpdateVdom.js +44 -41
  376. package/dist/update/integrateUpdateVdomPrebuild.js +5 -5
  377. package/dist/validChildren.js +2 -2
  378. package/dist/warnOnFrameworkChange.js +2 -2
  379. package/dist/watch.js +2 -2
  380. package/dist/zones/react.js +3 -3
  381. package/package.json +27 -39
  382. package/types/modules.d.ts +2 -1
  383. package/vendor/babel-core.js +26 -0
  384. package/vendor/babel-parser.js +9 -0
  385. package/vendor/babel-plugin-syntax-import-assertions.js +50 -0
  386. package/vendor/babel-preset-react.js +872 -0
  387. package/vendor/babel-preset-typescript.js +26 -0
  388. package/vendor/babel-types.js +9 -0
  389. package/vendor/chalk-extensions.js +1994 -0
  390. package/vendor/chalk.js +647 -0
  391. package/vendor/chokidar.js +6889 -0
  392. package/vendor/chunk-1TN2rK3j.js +1218 -0
  393. package/vendor/chunk-1UuLTU0U.js +34 -0
  394. package/vendor/chunk-B_NeooyV.js +86 -0
  395. package/vendor/chunk-C12hSZn7.js +88 -0
  396. package/vendor/chunk-C3YkUGz5.js +19 -0
  397. package/vendor/chunk-C3fcZDjl.js +41964 -0
  398. package/vendor/chunk-C9FSKeSx.js +14603 -0
  399. package/vendor/chunk-CPArXGxa.js +14623 -0
  400. package/vendor/cjs-module-lexer.js +6 -0
  401. package/vendor/dotenv.js +412 -0
  402. package/vendor/express.js +40577 -0
  403. package/vendor/import-meta-resolve.js +2201 -0
  404. package/vendor/manifest.json +29 -0
  405. package/vendor/postcss.js +8546 -0
  406. package/vendor/serialize-javascript.js +293 -0
  407. package/vendor/sxy-lib-arrays.js +113 -0
  408. package/vendor/sxy-lib-object-copy.js +1781 -0
  409. package/vendor/sxy-lib-objects.js +156 -0
  410. package/vendor/sxy-lib-promises.js +47 -0
  411. package/vendor/sxy-package-investigator.js +202 -0
  412. package/vendor/valibot.js +7664 -0
  413. package/dist/Servers/hono/DevServerHono.d.ts +0 -2
  414. package/dist/Servers/hono/DevServerHono.d.ts.map +0 -1
  415. package/dist/Servers/hono/DevServerHono.js +0 -423
  416. package/dist/Servers/hono/ProdServerHono.d.ts +0 -2
  417. package/dist/Servers/hono/ProdServerHono.d.ts.map +0 -1
  418. package/dist/Servers/hono/ProdServerHono.js +0 -220
  419. package/dist/Servers/hono/TungstenServerHono.d.ts +0 -6
  420. package/dist/Servers/hono/TungstenServerHono.d.ts.map +0 -1
  421. package/dist/Servers/hono/TungstenServerHono.js +0 -36
  422. package/dist/api/ApiEndpointHono.d.ts +0 -3
  423. package/dist/api/ApiEndpointHono.d.ts.map +0 -1
  424. package/dist/api/ApiEndpointHono.js +0 -1
  425. package/dist/api/ApiRouteHono.d.ts +0 -7
  426. package/dist/api/ApiRouteHono.d.ts.map +0 -1
  427. package/dist/api/ApiRouteHono.js +0 -1
  428. package/dist/api/ApiRoutesHono.d.ts +0 -5
  429. package/dist/api/ApiRoutesHono.d.ts.map +0 -1
  430. package/dist/api/ApiRoutesHono.js +0 -1
  431. package/dist/api/getApiRoutesHono.d.ts +0 -6
  432. package/dist/api/getApiRoutesHono.d.ts.map +0 -1
  433. package/dist/api/getApiRoutesHono.js +0 -14
  434. package/dist/build/compilePackages.d.ts +0 -2
  435. package/dist/build/compilePackages.d.ts.map +0 -1
  436. package/dist/build/compilePackages.js +0 -89
  437. package/dist/build/findRequiredUserModule.d.ts +0 -2
  438. package/dist/build/findRequiredUserModule.d.ts.map +0 -1
  439. package/dist/build/findRequiredUserModule.js +0 -36
  440. package/dist/build/processPackage.d.ts +0 -4
  441. package/dist/build/processPackage.d.ts.map +0 -1
  442. package/dist/build/processPackage.js +0 -91
  443. package/dist/build/tallyBabelPlugins.d.ts +0 -3
  444. package/dist/build/tallyBabelPlugins.d.ts.map +0 -1
  445. package/dist/build/tallyBabelPlugins.js +0 -68
  446. package/dist/testing/loadEnvSetup.d.ts +0 -2
  447. package/dist/testing/loadEnvSetup.d.ts.map +0 -1
  448. package/dist/testing/loadEnvSetup.js +0 -7
  449. package/sxy-loader.config.js +0 -7
@@ -1,220 +0,0 @@
1
- // Status/known gaps: see ./README.md
2
- // import { Context, Hono } from 'hono'
3
- // import { serve, type ServerType } from '@hono/node-server'
4
- // import { serveStatic } from '@hono/node-server/serve-static'
5
- // import { join } from 'path'
6
- // import { existsSync } from 'fs'
7
- // import type { FrameworkConfigComplete } from '../../FrameworkConfig.js'
8
- // import type { CompilationInfo } from '../../build/CompilationInfo.js'
9
- // import type { ApiRoutes } from '../../api/ApiRoutes.js'
10
- // import { staticFolder, assetsFolder, packageNameCapitalized, publicFolder } from '../../settings.js'
11
- // import { rootToHtml as renderRootToHtml } from '../../render/rootToHtml.js'
12
- // import { contentToHtml as renderContentToHtml } from '../../render/contentToHtml.js'
13
- // import { Instance } from '../../Instance/Instance.js'
14
- // import { cliOut, cliWarn, cliLog, cliNews, cliDebug, cliTodo } from '../../cliOutput.js' // eslint-disable-line @typescript-eslint/no-unused-vars
15
- // import { Framework } from '../../Framework.js'
16
- // import { TungstenError } from '../../TungstenError.js'
17
- // import { makeInstanceConfigFromFrameworkConfig } from '../../makeInstanceConfigFromFrameworkConfig.js'
18
- // import { standardizeWebPath } from '../../standardizeWebPath.js'
19
- // import { throwError } from '../../throwError.js'
20
- // import { AnyComponentType } from '../../AnyComponentType.js'
21
- // import { AppRoutes } from '../../routing/AppRoutes.js'
22
- // import { ReqRes } from '../../ReqRes.js'
23
- // import { routing } from '../routing.jsx'
24
- // import { globalDataFunc } from '../../routing/registerGlobalData.js'
25
- // import { ServerDataLoading } from '../../Store/ServerDataLoading.js'
26
- // import { ServerMiddleware } from '../ServerMiddleware.js'
27
- // import { portError } from '../portError.js'
28
- // import { initStores } from '../initStores.js'
29
- // import { TungstenServerHono } from './TungstenServerHono.jsx'
30
- export {};
31
- // function debug(...texts: any[]) { // eslint-disable-line @typescript-eslint/no-unused-vars
32
- // // console.log(...texts)
33
- // }
34
- // export class ProdServerHono extends TungstenServerHono {
35
- // framework: Framework
36
- // config: FrameworkConfigComplete
37
- // compilationInfo: CompilationInfo
38
- // appRoutes: AppRoutes
39
- // RootComponentOrNull: AnyComponentType | null
40
- // location: string | null = null
41
- // app: Hono
42
- // apiRoutesPromise?: Promise<ApiRoutes>
43
- // apiRoutes?: ApiRoutes
44
- // server?: ServerType
45
- // constructor(
46
- // framework: Framework,
47
- // config: FrameworkConfigComplete,
48
- // compilationInfo: CompilationInfo,
49
- // appRoutes: AppRoutes,
50
- // RootComponentOrNull: AnyComponentType | null,
51
- // serverMiddleware: ServerMiddleware | null
52
- // ) {
53
- // super()
54
- // this.framework = framework
55
- // this.config = config
56
- // this.compilationInfo = compilationInfo
57
- // this.appRoutes = appRoutes
58
- // this.RootComponentOrNull = RootComponentOrNull
59
- // this.app = new Hono()
60
- // if (tungstenPrivateEnv.DEBUG === true) {
61
- // let reqId = 0
62
- // this.app.use(async (c, next) => {
63
- // reqId++
64
- // cliDebug(`Received request [${reqId}] for ${c.req.url}`)
65
- // await next()
66
- // })
67
- // }
68
- // const requestLog = (tungstenPrivateEnv.DEBUG === true)
69
- // const originMismatchWarning = (this.config.suppressOriginMismatchWarning !== true)
70
- // if (requestLog || originMismatchWarning) {
71
- // this.app.use(async (c, next) => {
72
- // const urlObj = new URL(c.req.url)
73
- // const target = urlObj.origin + c.req.url
74
- // const origin = c.req.header('origin')
75
- // if (requestLog) {
76
- // let message = 'Received request at ' + target
77
- // if (origin !== undefined) {
78
- // message += ' from ' + String(c.req.header('origin'))
79
- // }
80
- // cliOut(message)
81
- // }
82
- // if (originMismatchWarning) {
83
- // if (origin !== undefined && origin === this.location && origin !== target) {
84
- // cliWarn(
85
- // `Received a request from the frontend, but it's origin`
86
- // + ` is not the same as the request origin.`
87
- // + ` This may indicate a misconfiguration, and may prevent`
88
- // + ` the passing of cookies to the tungsten server.`
89
- // )
90
- // }
91
- // }
92
- // await next()
93
- // })
94
- // }
95
- // // serverMiddleware isn't ported to Hono yet - it's a list of Express RequestHandlers,
96
- // // which Hono's middleware signature can't run directly.
97
- // if (serverMiddleware) {
98
- // cliWarn('ProdServerHono: serverMiddleware is not yet supported on the Hono server')
99
- // }
100
- // if (this.compilationInfo.bundleLocation === undefined) {
101
- // throwError('ProdServerHono', 'compilationInfo.bundleLocation is unset/undefined')
102
- // }
103
- // this.app.use('/bundle/*', serveStatic({ root: this.compilationInfo.bundleLocation }))
104
- // const publicLocation = join(this.compilationInfo.location, publicFolder)
105
- // if (existsSync(publicLocation)) this.app.use(serveStatic({ root: publicLocation })) // files from public folder
106
- // this.app.use(serveStatic({ root: join(this.compilationInfo.location, staticFolder) }))
107
- // if (this.config.assetsDir !== undefined) {
108
- // this.app.use('/assets/*', serveStatic({ root: join(this.compilationInfo.location, assetsFolder) }))
109
- // }
110
- // this.app.use(serveStatic({ root: this.compilationInfo.location }))
111
- // if (typeof config.apiRoutes === 'string' && config.apiRoutes !== '') {
112
- // const apiPath = standardizeWebPath(this.config.apiPath)
113
- // cliOut(`API listening at ${apiPath}`)
114
- // this.app.use(apiPath, this.handleRequestApi)
115
- // }
116
- // this.app.use(this.handleRequest)
117
- // }
118
- // private handleRequestApi = async (c: Context): Promise<Response> => { // eslint-disable-line @typescript-eslint/no-unused-vars
119
- // //this.apiRoutes = await this.apiRoutesPromise
120
- // throw new TungstenError(`handleRequestApi incomplete in dev server - add to get the API in the build step`)
121
- // }
122
- // handleRequest = async (c: Context): Promise<Response> => {
123
- // const { req } = c
124
- // if (/\.(css|scss|sass|js|jsx|png|jpg|jpeg|svg|ico|txt)$/.test(req.path)) {
125
- // cliLog(`Requested asset file ${req.url} was not found`)
126
- // return c.notFound()
127
- // }
128
- // try {
129
- // const location = req.url
130
- // const instanceConfig = makeInstanceConfigFromFrameworkConfig(this.config)
131
- // if (this.framework.frameworkModules === undefined) {
132
- // throwError('ProdServerHono.handleRequest()',
133
- // 'framework.frameworkModules is undefined'
134
- // )
135
- // }
136
- // if (this.framework.clientImportAliases === undefined) {
137
- // throwError('ProdServerHono.handleRequest()',
138
- // 'framework.clientImportAliases is undefined'
139
- // )
140
- // }
141
- // const { compilationInfo, config, appRoutes, RootComponentOrNull } = this
142
- // // ReqRes is Express-shaped ({req, res}) and Hono's Context isn't - this cast is a
143
- // // type-only bridge so the (Express-only) Instance/initStores/routing plumbing below
144
- // // still compiles. Not behaviorally correct; fine since this prod server isn't wired
145
- // // up anywhere live.
146
- // // eslint-disable-next-line no-type-assertion/no-type-assertion -- see comment above
147
- // const reqRes = c as unknown as ReqRes
148
- // const serverDataLoading: ServerDataLoading = { value: false }
149
- // const routes = (typeof appRoutes === 'function') ? appRoutes(reqRes) : appRoutes
150
- // const [globalData, matchedRouteInfo] = await Promise.all([
151
- // (globalDataFunc.value !== undefined) ? globalDataFunc.value(reqRes) : {},
152
- // routing(location, routes, serverDataLoading)
153
- // ])
154
- // const redirected = this.handleRedirects(c, matchedRouteInfo)
155
- // if (redirected !== false) return redirected // end early
156
- // const { internalStore, stores, storeSubscriptions }
157
- // = initStores(location, reqRes, globalData, matchedRouteInfo, serverDataLoading)
158
- // const instance = new Instance(
159
- // location, instanceConfig, reqRes, appRoutes, routes, internalStore,
160
- // stores, storeSubscriptions, globalData, matchedRouteInfo
161
- // )
162
- // let html: string
163
- // if (RootComponentOrNull !== null) {
164
- // html = await renderRootToHtml(
165
- // this.compilationInfo, this.framework.clientImportAliases,
166
- // RootComponentOrNull, instance, config, this.config.siteBasePath
167
- // )
168
- // } else {
169
- // const { params, data } = matchedRouteInfo
170
- // let { content } = matchedRouteInfo
171
- // if (typeof content === 'function') {
172
- // content = content(data, params, {} /* props */, globalData, location)
173
- // }
174
- // html = await renderContentToHtml(
175
- // this.compilationInfo, this.framework.clientImportAliases,
176
- // content, instance, config, this.config.siteBasePath
177
- // )
178
- // }
179
- // return c.html(html, (instance.matchedRouteInfo.key === '404') ? 404 : 200)
180
- // } catch(e) {
181
- // cliLog('handleRequest() error', e)
182
- // return c.html(this.errorPage(), 500)
183
- // }
184
- // }
185
- // errorPage = () => {
186
- // return `<!DOCTYPE html>
187
- // </html>
188
- // <head><title>Error</title></head>
189
- // <body>
190
- // <h1>Internal error</h1>
191
- // <p>Something went wrong. Please contact the site owner for help.</p>
192
- // </body>
193
- // </html>`
194
- // }
195
- // // I don't think we ever override the port, not sure why
196
- // start(portOverride?: number | null, mute = false): Promise<string> {
197
- // return new Promise( (resolve) => {
198
- // const proto = tungstenPublicEnv.FRONTEND_PROTO ?? 'http'
199
- // const host = tungstenPublicEnv.FRONTEND_HOST ?? 'localhost'
200
- // let port: number | null
201
- // if (portOverride !== undefined) {
202
- // port = portOverride
203
- // } else {
204
- // const _port = tungstenPrivateEnv.TUNGSTEN_SERVER_PORT ?? 3000
205
- // if (isNaN(_port) || _port === 0) throwError('ProdServerHono', portError(_port))
206
- // port = _port
207
- // }
208
- // if (port === null) throwError('ProdServerHono', portError(NaN))
209
- // if (isNaN(port) || port === 0) throwError('ProdServerHono', portError(port))
210
- // this.server = serve({ fetch: this.app.fetch, port }, info => {
211
- // this.location = `${proto}://${host}:${info.port}`
212
- // if (!mute) cliNews(`${packageNameCapitalized} prod server ready at ${this.location}`)
213
- // resolve(this.location)
214
- // })
215
- // })
216
- // }
217
- // stop() {
218
- // if (this.server !== undefined) this.server.close()
219
- // }
220
- // }
@@ -1,6 +0,0 @@
1
- import type { MatchedRouteInfo } from '../MatchedRouteInfo.js';
2
- import type { Context } from 'hono';
3
- export declare class TungstenServerHono {
4
- protected handleRedirects(c: Context, matchedRouteInfo: MatchedRouteInfo): Response | false;
5
- }
6
- //# sourceMappingURL=TungstenServerHono.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TungstenServerHono.d.ts","sourceRoot":"","sources":["../../../src/Servers/hono/TungstenServerHono.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAUnC,qBAAa,kBAAkB;IAI3B,SAAS,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,EAAY,gBAAgB,EAAE,gBAAgB,GAAG,QAAQ,GAAG,KAAK;CAoCxG"}
@@ -1,36 +0,0 @@
1
- import { ContentNodeIsClassComponent } from "../../ContentNode.js";
2
- import { RoutingRedirect } from "../../routing/RoutingRedirect.js";
3
- import { cliTodo } from "../../cliOutput.js";
4
- import { RouteRedirectComponent } from "../../components/RouteRedirectComponent.js";
5
- import { WebRedirectComponent } from "../../components/WebRedirectComponent.js";
6
- import { $props, $type } from "../../contentNodeSymbols.js";
7
- import { WebRedirect } from "../../routing/WebRedirect.js";
8
- export class TungstenServerHono {
9
- // Hono's c.redirect() builds a Response but doesn't send it - unlike Express's res.redirect()
10
- // (which sends immediately), the caller here must return the Response itself for Hono to
11
- // actually deliver it. Returns false when there's no redirect to make.
12
- handleRedirects(c /* any */, matchedRouteInfo) {
13
- // handle any redirect issued during routing
14
- if (matchedRouteInfo.data instanceof RoutingRedirect) {
15
- const redirect = matchedRouteInfo.data;
16
- return c.redirect(redirect.to, redirect.code);
17
- } else if (matchedRouteInfo.data instanceof WebRedirect) {
18
- const redirect = matchedRouteInfo.data;
19
- return c.redirect(redirect.to, redirect.code);
20
- }
21
- if (typeof matchedRouteInfo.content !== 'function' && ContentNodeIsClassComponent(matchedRouteInfo.content)) {
22
- if (matchedRouteInfo.content[$type] === RouteRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof RouteRedirectComponent) {
23
- cliTodo('consider type of RedirectComponent props');
24
- const code = matchedRouteInfo.content[$props].code || 302;
25
- const to = matchedRouteInfo.content[$props].to;
26
- return c.redirect(to, code);
27
- } else if (matchedRouteInfo.content[$type] === WebRedirectComponent || matchedRouteInfo.content[$type].prototype instanceof WebRedirectComponent) {
28
- cliTodo('consider type of RedirectComponent props');
29
- const code = matchedRouteInfo.content[$props].code || 302;
30
- const to = matchedRouteInfo.content[$props].to;
31
- return c.redirect(to, code);
32
- }
33
- }
34
- return false;
35
- }
36
- }
@@ -1,3 +0,0 @@
1
- import type { Context, Next } from 'hono';
2
- export type ApiEndpointHono = (c: Context, next: Next) => Response;
3
- //# sourceMappingURL=ApiEndpointHono.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApiEndpointHono.d.ts","sourceRoot":"","sources":["../../src/api/ApiEndpointHono.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAEzC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAA"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import type { ApiEndpointHono } from './ApiEndpointHono.js';
2
- import { Method } from './Method.js';
3
- export type ApiRouteHono = {
4
- method: Method;
5
- endpoint: ApiEndpointHono;
6
- };
7
- //# sourceMappingURL=ApiRouteHono.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApiRouteHono.d.ts","sourceRoot":"","sources":["../../src/api/ApiRouteHono.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,MAAM,YAAY,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,eAAe,CAAA;CAC5B,CAAA"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { ApiRouteHono } from './ApiRouteHono.js';
2
- export type ApiRoutesHono = {
3
- [key: string]: ApiRouteHono;
4
- };
5
- //# sourceMappingURL=ApiRoutesHono.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApiRoutesHono.d.ts","sourceRoot":"","sources":["../../src/api/ApiRoutesHono.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAC9B,CAAA"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { Mode } from '../Mode.js';
2
- import type { ApiRoutesHono } from './ApiRoutesHono.js';
3
- import type { CompilationInfo } from '../build/CompilationInfo.js';
4
- import { FrameworkConfig } from '../FrameworkConfig.js';
5
- export declare function getApiRoutesHono(config: FrameworkConfig, compilationInfo: CompilationInfo, mode: Mode): Promise<ApiRoutesHono>;
6
- //# sourceMappingURL=getApiRoutesHono.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getApiRoutesHono.d.ts","sourceRoot":"","sources":["../../src/api/getApiRoutesHono.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAC,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAMvD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,0BAe3G"}
@@ -1,14 +0,0 @@
1
- import { join } from 'path';
2
- import { TungstenError } from "../TungstenError.js";
3
- import { getExportDev } from "./getExportDev.js";
4
- import { getExport } from "./getExport.js";
5
- export async function getApiRoutesHono(config, compilationInfo, mode) {
6
- if (typeof config.apiRoutes !== 'string') {
7
- throw new TungstenError(`getApiRoutes() error - config.apiRoutes is not valid`);
8
- }
9
- const apiRoutesFileFull = join(compilationInfo.buildCodeLocation, config.apiRoutes);
10
- //console.log('rootComponentFileFull', 'xxx', 'config.rootComponent', config.rootComponent)
11
- //console.log('rootComponentFileFull', apiRoutesFileFull, 'config.rootComponent', config.apiRoutes)
12
- const apiRoutes = mode === 'dev' ? await getExportDev(apiRoutesFileFull, config.apiRoutes) : await getExport(apiRoutesFileFull, config.apiRoutes);
13
- return apiRoutes;
14
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=compilePackages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compilePackages.d.ts","sourceRoot":"","sources":["../../src/build/compilePackages.ts"],"names":[],"mappings":""}
@@ -1,89 +0,0 @@
1
- // import dependencyTree from 'sxy-dependency-tree'
2
- // import { globby } from 'globby'
3
- // import slash from 'slash'
4
- // import { existsSync, promises as fsPromises } from 'fs'
5
- // import { join } from 'path'
6
- // import { createRequire } from 'module'
7
- export {};
8
- // import type { ProcessPackageResults } from './ProcessPackageResults.js'
9
- // import type { PackagesCacheInfo } from './PackagesCacheInfo.js'
10
- // import { processPackage } from './processPackage.js'
11
- // import {
12
- // packagesCacheFolder, packagesCacheInfoName, assetsFolder, componentCssFolder, packagesFolder, staticFolder
13
- // } from '../settings.js'
14
- // import { cliError } from '../cliOutput.js'
15
- // const require = createRequire(import.meta.url)
16
- // type CompilePackagesResult = {
17
- // packages: ProcessPackageResults
18
- // }
19
- // //// UNUSED
20
- // export function compilePackages(projectDir: string, buildLocation: string): Promise<CompilePackagesResult> {
21
- // return new Promise( (resolve, reject) => {
22
- // console.log('start compiling packages')
23
- // // should we clear out the packages folders, to remove any packages that are no longer used?
24
- // //or should we check at the end, removing any excess?
25
- // projectDir = slash(projectDir) // convert backslashes on windows to forward slashes
26
- // // create a .packages folder if it doesn't already exist??
27
- // const packagesLocation = `${buildLocation}/${packagesFolder}`
28
- // if ( ! existsSync(packagesLocation) ) fsPromises.mkdir(packagesLocation)
29
- // // get info about the packages cache
30
- // const packagesCacheInfoLocation = join(projectDir, packagesCacheFolder, packagesCacheInfoName)
31
- // let packagesCacheInfo: PackagesCacheInfo
32
- // try {
33
- // packagesCacheInfo = require(packagesCacheInfoLocation)
34
- // } catch (e) {
35
- // cliError('error loading package cache info', e)
36
- // packagesCacheInfo = {}
37
- // }
38
- // buildLocation = slash(buildLocation) // convert backslashes on windows to forward slashes
39
- // const glob = [
40
- // `${buildLocation}/**/*.js`,
41
- // `!${buildLocation}/${assetsFolder}/**/*`, // these folders are already ignored unless dot is set to true
42
- // `!${buildLocation}/${componentCssFolder}/**/*`, //
43
- // `!${buildLocation}/${packagesFolder}/**/*`, //
44
- // `!${buildLocation}/${staticFolder}/**/*` //
45
- // ]
46
- // //console.log('searching in ', glob)
47
- // globby(glob, { dot: true }).then( async (matches) => {
48
- // const projectNodeModulesLocation = `${projectDir}/node_modules/`
49
- // const projectNodeModulesLocationLength = projectNodeModulesLocation.length
50
- // const packageDependencies: string[] = []
51
- // for ( const file of matches ) {
52
- // const nonExistent: string[] = []
53
- // const dependencies = dependencyTree.toList({
54
- // filename: file,
55
- // directory: projectDir,
56
- // nonExistent,
57
- // })
58
- // for ( let dependency of dependencies ) {
59
- // dependency = slash(dependency) // convert backslashes on windows to forward slashes
60
- // if (dependency.startsWith(projectNodeModulesLocation)) {
61
- // if ( ! packageDependencies.includes(dependency) ) {
62
- // packageDependencies.push(dependency)
63
- // }
64
- // }
65
- // }
66
- // }
67
- // const packages: string[] = []
68
- // for ( const pDependency of packageDependencies) {
69
- // const endPart = pDependency.slice(projectNodeModulesLocationLength)
70
- // const packageName = endPart.split('/')[0]!
71
- // if (packageName === 'tungsten') continue
72
- // if ( ! packages.includes(packageName) ) {
73
- // packages.push(packageName)
74
- // }
75
- // }
76
- // const results: ProcessPackageResults = []
77
- // for (const p of packages) {
78
- // results.push( await processPackage(projectDir, packagesCacheInfo, p, buildLocation) )
79
- // }
80
- // const packagesLocation = `${buildLocation}/${packagesFolder}`
81
- // fsPromises.writeFile(join(packagesLocation, '.sxy-packages-stats'), JSON.stringify(results))
82
- // fsPromises.writeFile(packagesCacheInfoLocation, JSON.stringify(packagesCacheInfo))
83
- // console.log('finishing compiling packages')
84
- // resolve( {
85
- // packages: results
86
- // } )
87
- // } )
88
- // })
89
- // }
@@ -1,2 +0,0 @@
1
- export declare function findRequiredUserModules(compilationLocation: string, rootFilePathRel: string): Promise<string[]>;
2
- //# sourceMappingURL=findRequiredUserModule.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findRequiredUserModule.d.ts","sourceRoot":"","sources":["../../src/build/findRequiredUserModule.ts"],"names":[],"mappings":"AAIA,wBAAsB,uBAAuB,CAAC,mBAAmB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAkCjG"}
@@ -1,36 +0,0 @@
1
- import { join } from 'path';
2
- import dependencyTree from 'sxy-dependency-tree';
3
- export async function findRequiredUserModules(compilationLocation, rootFilePathRel) {
4
- const rootFilePathFull = join(compilationLocation, rootFilePathRel);
5
- const projectLocation = process.cwd();
6
- //const frameworkLocation = findProjectDir(import.meta.url)
7
- //console.log('frameworkLocation', frameworkLocation)
8
- const nonExistent = [];
9
- const dependencies = dependencyTree.toList({
10
- filename: rootFilePathFull,
11
- //isListForm: true,
12
- //directory: dirname(frameworkLocation),
13
- directory: projectLocation,
14
- //directory: join(process.cwd(), devBuildFolder),
15
- nonExistent
16
- });
17
- //for ( const dependency of dependencies ) {
18
- //console.log('dependency', dependency.slice(this.compilationInfo.location.length+1))
19
- //}
20
- // won't work because we also need to resolve their deps
21
- // could do recursion using dependency-tree
22
- // but rather fix the core issue
23
- // for ( const unresolvedModule of nonExistent ) {
24
- // // dependency tree fails on imports to modules using export mapping
25
- // // so we will check these failures and try to resolve the ourself
26
- // console.log('unresolved module:', unresolvedModule)
27
- // if ( ! unresolvedModule.startsWith('.') ) { // only check files that are not relative, as they won't suffer from this issue
28
- // const targetProjectRoot = findProjectDir(unresolvedModule)
29
- // console.log('target project root', targetProjectRoot)
30
- // const location = await esmResolve(unresolvedModule, 'file://' + targetProjectRoot + '/')
31
- // console.log('resolved location: ', location)
32
- // if (location) dependencies.push(location)
33
- // }
34
- // }
35
- return dependencies.map(d => d.slice(compilationLocation.length + 1));
36
- }
@@ -1,4 +0,0 @@
1
- import type { PackagesCacheInfo } from './PackagesCacheInfo.js';
2
- import { ProcessPackageResult } from './ProcessPackageResult.js';
3
- export declare function processPackage(projectDir: string, packagesCacheInfo: PackagesCacheInfo, packageName: string, buildLocation: string): Promise<ProcessPackageResult>;
4
- //# sourceMappingURL=processPackage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processPackage.d.ts","sourceRoot":"","sources":["../../src/build/processPackage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,EAAE,oBAAoB,EAA4D,MAAM,2BAA2B,CAAA;AAwB1H,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoGxK"}
@@ -1,91 +0,0 @@
1
- import { transform } from 'cjstoesm';
2
- import { promises as fsPromises } from 'fs';
3
- import fsExtra from 'fs-extra';
4
- import { packagesCacheFolder, packagesFolder } from "../settings.js";
5
- import { removeRecursive } from "../removeRecursive.js";
6
- import { cliLog } from "../cliOutput.js";
7
- //import { getFrameworkDir } from '../getFrameworkDir.js'
8
- //// Don't think we are using this
9
- function getEntry(packageJson) {
10
- let entry = packageJson.exports ? 'import' in packageJson.exports['.'] ? packageJson.exports['.'].import : packageJson.exports['.'].default : /*json.browser ||*/packageJson.main || 'index.js'; // I need to research how browser works, then add it
11
- //console.log('entry 1', entry)
12
- entry = entry.startsWith('./') ? entry.slice(2) : entry;
13
- return entry;
14
- }
15
- function copyPackageFromCache(packageName, cacheLocation, targetLocation) {
16
- //console.log('copying package from', cacheLocation, 'to', targetLocation)
17
- fsExtra.copy(cacheLocation, targetLocation);
18
- }
19
- export async function processPackage(projectDir, packagesCacheInfo, packageName, buildLocation) {
20
- //console.log(`Processing ${packageName}`)
21
- const projectNodeModulesLocation = `${projectDir}/node_modules`;
22
- const sourceLocation = `${projectNodeModulesLocation}/${packageName}`;
23
- const compiledNodeModulesLocation = `${buildLocation}/${packagesFolder}`;
24
- const targetLocation = `${compiledNodeModulesLocation}/${packageName}`;
25
- const data = await fsPromises.readFile(new URL(`file://${sourceLocation}/package.json`, import.meta.url), 'utf8');
26
- const packageJson = JSON.parse(data);
27
- const {
28
- version
29
- } = packageJson;
30
- const entry = getEntry(packageJson);
31
- const packageAndVersion = `${packageName}@${version}`;
32
- const cacheLocation = `${packagesCacheFolder}/${packageAndVersion}`;
33
- if (packageAndVersion in packagesCacheInfo) {
34
- console.log(`Found ${packageAndVersion} in pacakges caching - re-using this`);
35
- copyPackageFromCache(packageName, cacheLocation, targetLocation);
36
- return {
37
- packageName,
38
- success: true,
39
- version: version,
40
- entry
41
- };
42
- } else {
43
- console.log(`Didn't find ${packageAndVersion} in packages cached - proceeding`);
44
- //
45
- // check if package is esm or cjs?
46
- await removeRecursive(targetLocation);
47
- await fsPromises.mkdir(targetLocation);
48
- //console.log('json for ', packageName, json)
49
- if (packageJson.type === undefined && packageJson.type !== 'module') {
50
- cliLog(`${packageName} appears not to be an ES6 package.` + ` Trying to convert from CommonJS to ES6`);
51
- try {
52
- const input = `${sourceLocation}/**/*`;
53
- /// change to cache loc
54
- //const outDir = targetLocation
55
- await removeRecursive(cacheLocation);
56
- await fsPromises.mkdir(cacheLocation);
57
- await transform({
58
- input: input,
59
- outDir: cacheLocation
60
- });
61
- packagesCacheInfo[packageAndVersion] = cacheLocation;
62
- // then copy to targetLocation
63
- copyPackageFromCache(packageName, cacheLocation, targetLocation);
64
- //fsExtra.copy(cacheLocation, targetLocation)
65
- } catch (e) {
66
- console.log(`Error transforming ${packageName}:`, e);
67
- return {
68
- packageName,
69
- success: false,
70
- reason: e
71
- };
72
- }
73
- console.log(`${packageName} transformed`);
74
- return {
75
- packageName,
76
- success: true,
77
- version: version,
78
- entry
79
- };
80
- } else {
81
- console.log(`${packageName} appears to be an ES6 package. Copying`);
82
- fsExtra.copy(sourceLocation, targetLocation);
83
- return {
84
- packageName,
85
- success: true,
86
- version: packageJson.version,
87
- entry
88
- };
89
- }
90
- }
91
- }
@@ -1,3 +0,0 @@
1
- import type { PluginItem } from '@babel/core';
2
- export declare function tallyBabelPlugins(plugins: PluginItem[] | null | undefined): PluginItem[];
3
- //# sourceMappingURL=tallyBabelPlugins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tallyBabelPlugins.d.ts","sourceRoot":"","sources":["../../src/build/tallyBabelPlugins.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AA+DxD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,EAAE,CAUxF"}