@emailmaker/emailmaker 1.0.107-dev.3 → 1.0.107-dev.5

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 (325) hide show
  1. package/README.md +1 -1
  2. package/cli/dist/lib/cli/project.js +2 -16
  3. package/cli/dist/lib/config.js +20 -29
  4. package/cli/dist/lib/local-test.js +3 -19
  5. package/cli/dist/lib/paths.js +11 -0
  6. package/cli/dist/lib/resolveNpmSpawn.d.ts +20 -0
  7. package/cli/dist/lib/resolveNpmSpawn.js +71 -0
  8. package/cli/dist/lib/template-engine/context/pluginPackageJsonData.js +21 -19
  9. package/cli/dist/lib/template-engine/context/standVitePackageJsonData.js +7 -8
  10. package/cli/dist/lib/template-engine/resolveVariantDir.d.ts +5 -1
  11. package/cli/dist/lib/template-engine/resolveVariantDir.js +22 -0
  12. package/cli/dist/lib/templates/shared/i18n.js +2 -2
  13. package/cli/dist/lib/templates/shared/paths.js +3 -4
  14. package/cli/dist/lib/types/package-config.d.ts +1 -0
  15. package/cli/lib/cli/project.ts +2 -18
  16. package/cli/lib/config.ts +19 -30
  17. package/cli/lib/local-test.ts +3 -22
  18. package/cli/lib/paths.ts +15 -0
  19. package/cli/lib/resolveNpmSpawn.ts +72 -0
  20. package/cli/lib/template-engine/buildStandIndexHtml.test.ts +1 -0
  21. package/cli/lib/template-engine/context/pluginPackageJsonData.ts +23 -23
  22. package/cli/lib/template-engine/context/standVitePackageJsonData.ts +7 -12
  23. package/cli/lib/template-engine/pluginEtaParity.test.ts +1 -0
  24. package/cli/lib/template-engine/resolveVariantDir.ts +22 -0
  25. package/cli/lib/template-engine/standAdvancedViteDevHostEta.test.ts +4 -3
  26. package/cli/lib/template-engine/standWebpackDevHostEta.test.ts +7 -6
  27. package/cli/lib/templates/shared/i18n.ts +2 -2
  28. package/cli/lib/templates/shared/paths.ts +3 -4
  29. package/cli/lib/types/package-config.ts +1 -0
  30. package/cli/package.json +1 -1
  31. package/cli/project-templates/plugin/assets/vite/{plugin-build.config.mjs → plugin-build.config.ts} +7 -5
  32. package/cli/project-templates/plugin/assets/vite/{sandbox-build.config.mjs → sandbox-build.config.ts} +7 -5
  33. package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.module.cjs → plugin-build.legacy.module.ts} +20 -7
  34. package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.umd.cjs → plugin-build.legacy.umd.ts} +20 -7
  35. package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.module.cjs → plugin-build.modern.module.ts} +9 -4
  36. package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.umd.cjs → plugin-build.modern.umd.ts} +9 -4
  37. package/cli/project-templates/plugin/assets/webpack/{sandbox-build.config.cjs → sandbox-build.config.ts} +13 -3
  38. package/cli/project-templates/plugin/bundler-vite/release.html.eta +1 -0
  39. package/cli/project-templates/plugin/bundler-webpack/public/release.html.eta +1 -0
  40. package/cli/project-templates/plugin/shared-base/public/demo/product-1.svg +10 -0
  41. package/cli/project-templates/plugin/shared-base/public/demo/product-2.svg +10 -0
  42. package/cli/project-templates/plugin/shared-base/scripts/build-runner.ts +22 -0
  43. package/cli/project-templates/plugin/shared-base/scripts/build-types.ts +17 -0
  44. package/cli/project-templates/plugin/shared-base/scripts/clean.ts +16 -0
  45. package/cli/project-templates/plugin/shared-base/scripts/dev-runner.ts +52 -0
  46. package/cli/project-templates/plugin/shared-base/scripts/npmRun.ts +61 -0
  47. package/cli/project-templates/plugin/shared-base/scripts/release-runner.ts +18 -0
  48. package/cli/project-templates/plugin/shared-base/scripts/scriptRuntime.ts +10 -0
  49. package/cli/project-templates/plugin/shared-base/src/dev/hostApp.tsx.eta +1 -0
  50. package/cli/project-templates/plugin/shared-base/src/dev-release.tsx.eta +1 -0
  51. package/cli/project-templates/plugin/shared-base/src/dev.tsx.eta +1 -1
  52. package/cli/project-templates/shared/partials/plugin-dev-host-app-advanced.eta +93 -0
  53. package/cli/project-templates/shared/partials/plugin-dev-host-app-minimal.eta +54 -0
  54. package/cli/project-templates/shared/partials/plugin-dev-tsx-advanced.eta +3 -2
  55. package/cli/project-templates/shared/partials/plugin-dev-tsx-debug.eta +18 -0
  56. package/cli/project-templates/shared/partials/plugin-dev-tsx-release.eta +33 -0
  57. package/cli/project-templates/shared/partials/plugin-dev-tsx-runtime-helpers.eta +8 -8
  58. package/cli/project-templates/shared/partials/plugin-index-ts.eta +0 -1
  59. package/cli/project-templates/shared/partials/plugin-vite-dev-host.eta +9 -5
  60. package/cli/project-templates/shared/partials/plugin-vite-plugin-build.eta +7 -5
  61. package/cli/project-templates/shared/partials/plugin-vite-release-html.eta +12 -0
  62. package/cli/project-templates/shared/partials/plugin-vite-sandbox-build.eta +7 -5
  63. package/cli/project-templates/shared/partials/plugin-webpack-dev-host-legacy.eta +12 -5
  64. package/cli/project-templates/shared/partials/plugin-webpack-dev-host-modern.eta +13 -6
  65. package/cli/project-templates/shared/partials/plugin-webpack-release-html.eta +12 -0
  66. package/cli/project-templates/shared/partials/plugin-webpack-sandbox-build.eta +13 -3
  67. package/cli/project-templates/shared/partials/plugin-wp-legacy-module.eta +28 -10
  68. package/cli/project-templates/shared/partials/plugin-wp-legacy-umd.eta +28 -10
  69. package/cli/project-templates/shared/partials/plugin-wp-modern-module.eta +9 -4
  70. package/cli/project-templates/shared/partials/plugin-wp-modern-umd.eta +9 -4
  71. package/cli/project-templates/shared/partials/stand-dev-host-vite-memory.eta +3 -3
  72. package/cli/project-templates/shared/partials/stand-dev-host-vite-subpath.eta +8 -4
  73. package/cli/project-templates/shared/partials/stand-dev-host-vite-umd.eta +5 -5
  74. package/cli/project-templates/shared/partials/stand-dev-host-vite.eta +3 -3
  75. package/cli/project-templates/shared/partials/stand-dev-host-webpack-subpath.eta +8 -4
  76. package/cli/project-templates/shared/partials/stand-dev-host-webpack-umd.eta +9 -3
  77. package/cli/project-templates/shared/partials/stand-dev-host-webpack.eta +8 -4
  78. package/cli/project-templates/shared/partials/stand-dev-storage-middleware.eta +370 -0
  79. package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.ts +80 -0
  80. package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.ts.eta +1 -0
  81. package/cli/project-templates/shared/stand-webpack-base/config/lib/{createWebpackStandConfig.cjs → createWebpackStandConfig.ts} +31 -19
  82. package/cli/project-templates/{stand/advanced/umd/vite/config/lib/umdServeMiddleware.mjs → shared/stand-webpack-base/config/lib/umdServeMiddleware.ts} +19 -11
  83. package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.ts.eta +1 -0
  84. package/cli/project-templates/stand/advanced/memory-usage/vite/config/lib/{createMemoryUsageStandConfig.mjs → createMemoryUsageStandConfig.ts} +25 -20
  85. package/cli/project-templates/stand/advanced/umd/vite/config/lib/umdServeMiddleware.ts +68 -0
  86. package/cli/project-templates/stand/react-adapter/webpack/README.md.eta +1 -0
  87. package/cli/project-templates/stand/react-adapter/webpack/config/dev-host.ts.eta +1 -0
  88. package/cli/project-templates/stand/react-adapter/webpack/package.json.eta +1 -0
  89. package/cli/project-templates/stand/react-adapter/webpack/public/index.html.eta +1 -0
  90. package/cli/project-templates/stand/react-adapter/webpack/src/dev/editorConfig.ts.eta +1 -0
  91. package/cli/project-templates/stand/react-adapter/webpack/src/dev/email.html.eta +1 -0
  92. package/cli/project-templates/stand/react-adapter/webpack/src/dev/getAuthToken.ts.eta +1 -0
  93. package/cli/project-templates/stand/react-adapter/webpack/src/dev/oauthCredentials.ts +9 -0
  94. package/cli/project-templates/stand/react-adapter/webpack/src/dev/storageProvider.ts.eta +1 -0
  95. package/cli/project-templates/stand/react-adapter/webpack/src/index.tsx.eta +1 -0
  96. package/cli/scripts/cli-matrix-smoke.ts +19 -10
  97. package/cli/scripts/verify-global-cli.ts +1 -1
  98. package/cli/scripts/vite-plugin-version-matrix.ts +299 -0
  99. package/cli/tsconfig.json +2 -2
  100. package/emailmaker-core.ed344c04.js +1 -0
  101. package/emailmaker-esm.js +788 -153
  102. package/emailmaker.d.ts +32 -0
  103. package/emailmaker.js +4 -4
  104. package/iframe/js/amp.BGJMqoms.js +1 -1
  105. package/iframe/js/chunk.oX6nCJbK.js +1 -1
  106. package/iframe/js/iframe-eblock.js +1 -1
  107. package/iframe/js/iframe.js +1 -1
  108. package/iframe/js/rules.BSaCN7eK.js +1 -1
  109. package/iframe/js/sanitize-html.Dy7Uwo8P.js +1 -1
  110. package/images/integrations/activecampaign.svg +4 -0
  111. package/images/integrations/bento.svg +9 -0
  112. package/images/integrations/brevo.svg +7 -0
  113. package/images/integrations/campaign_monitor.svg +10 -0
  114. package/images/integrations/constant_contact.svg +24 -0
  115. package/images/integrations/dotdigital.svg +144 -0
  116. package/images/integrations/getresponse.svg +23 -0
  117. package/images/integrations/hubspot.svg +3 -0
  118. package/images/integrations/klaviyo.svg +10 -0
  119. package/images/integrations/mailchimp.svg +9 -0
  120. package/images/integrations/salesforce.svg +20 -0
  121. package/js/browser-image-compression.js +9 -0
  122. package/package.json +2 -5
  123. package/runtime/@ant-design/cssinjs/index.js +1 -1
  124. package/runtime/@ant-design/icons/index.js +1 -1
  125. package/runtime/@ant-design/pro-layout/index.js +1 -1
  126. package/runtime/README.md +13 -13
  127. package/runtime/antd/index.js +1 -1
  128. package/runtime/app-core/index.js +1 -2
  129. package/runtime/classnames/index.js +1 -1
  130. package/runtime/core/index.js +6 -6
  131. package/runtime/dayjs/index.js +1 -1
  132. package/runtime/di/index.js +1 -2
  133. package/runtime/disposable/index.js +1 -2
  134. package/runtime/errors-runtime/index.js +1 -2
  135. package/runtime/guid/index.js +1 -2
  136. package/runtime/index.js +2 -4
  137. package/runtime/package.json +2 -3
  138. package/runtime/prop-types/index.js +1 -1
  139. package/runtime/react/index.js +1 -1
  140. package/runtime/react/jsx-dev-runtime/index.js +1 -1
  141. package/runtime/react/jsx-runtime/index.js +1 -1
  142. package/runtime/react-dom/client/index.js +1 -1
  143. package/runtime/react-dom/index.js +1 -1
  144. package/runtime/react-router-dom/index.js +1 -1
  145. package/runtime/uuid/index.js +1 -1
  146. package/static/amd/{8fc2a596.js → 19aeb269.js} +88 -88
  147. package/static/core/192ec827.js +1 -0
  148. package/static/core/22c1de2e2.js +1 -0
  149. package/static/core/24faedf0.js +1 -0
  150. package/static/core/29231645.js +1 -0
  151. package/static/core/2a3177fc2.js +1 -0
  152. package/static/core/346aabd2.js +3 -0
  153. package/static/core/3b800ed6.js +1 -0
  154. package/static/core/3e840e90.js +1 -0
  155. package/static/core/40cc9fd7.js +1 -0
  156. package/static/core/421bdec22.js +1 -0
  157. package/static/core/50ff48bc.js +4 -0
  158. package/static/core/5282795d2.js +6 -0
  159. package/static/core/555e2e2f2.js +903 -0
  160. package/static/core/563a283d.js +1 -0
  161. package/static/core/5d47e095.js +47 -0
  162. package/static/core/5f574386.js +1 -0
  163. package/static/core/67a41193.js +1 -0
  164. package/static/core/698dace4.js +7 -0
  165. package/static/core/6b648e2d.js +1 -0
  166. package/static/core/7629adfd.js +1 -0
  167. package/static/core/7717f2932.js +3 -0
  168. package/static/core/776cb34a.js +1 -0
  169. package/static/core/78a1e31e.js +1 -0
  170. package/static/core/7d56d643.js +1 -0
  171. package/static/core/841752212.js +40 -0
  172. package/static/core/8477e97e.js +1 -0
  173. package/static/core/8756d562.js +1 -0
  174. package/static/core/91d328d8.js +1 -0
  175. package/static/core/9270dbb6.js +6 -0
  176. package/static/core/96371334.js +566 -0
  177. package/static/core/9b9ddaef2.js +168 -0
  178. package/static/core/af1da4b4.js +1 -0
  179. package/static/core/b5096b152.js +471 -0
  180. package/static/core/bde6775a.js +1 -0
  181. package/static/core/bf1b888c.js +4 -0
  182. package/static/core/c3747df72.js +598 -0
  183. package/static/core/cec8d739.js +11 -0
  184. package/static/core/cfac3d32.js +1 -0
  185. package/static/core/d21c95cf2.js +1 -0
  186. package/static/core/dbd9ca52.js +1 -0
  187. package/static/core/dc590181.js +1 -0
  188. package/static/core/e0039d55.js +1 -0
  189. package/static/core/e4071c1a.js +4 -0
  190. package/static/core/ef87b75c.js +41 -0
  191. package/static/core/f47701f32.js +20 -0
  192. package/static/core/f83d7ac42.js +3 -0
  193. package/static/core/fcc67e6b.js +1 -0
  194. package/static/core/fd40d85c.js +1 -0
  195. package/static/core/fe638847.js +1 -0
  196. package/static/esm/{e8401d17.js → 203c9644.js} +3 -3
  197. package/static/esm/4b679053.js +27 -0
  198. package/static/esm/{b273a6c2.js → f31a26c6.js} +1 -1
  199. package/static/runtime/disposable-CD74igiJ.js +1 -0
  200. package/static/runtime/guid-C0wuVR8v.js +1 -0
  201. package/vite/index.d.ts +17 -6
  202. package/vite/index.js +315 -270
  203. package/vite/pluginDev/index.d.ts +10 -19
  204. package/vite/pluginDev/index.js +251 -204
  205. package/webpack/index.d.ts +24 -5
  206. package/webpack/index.js +168 -144
  207. package/webpack/pluginDev/index.d.ts +21 -22
  208. package/webpack/pluginDev/index.js +242 -177
  209. package/cli/dist/lib/template-engine/buildStandIndexHtml.test.d.ts +0 -2
  210. package/cli/dist/lib/template-engine/buildStandIndexHtml.test.js +0 -89
  211. package/cli/dist/lib/template-engine/emitEtaTree.test.d.ts +0 -2
  212. package/cli/dist/lib/template-engine/emitEtaTree.test.js +0 -34
  213. package/cli/dist/lib/template-engine/pluginEtaParity.test.d.ts +0 -2
  214. package/cli/dist/lib/template-engine/pluginEtaParity.test.js +0 -105
  215. package/cli/dist/lib/template-engine/resolveVariantDir.test.d.ts +0 -2
  216. package/cli/dist/lib/template-engine/resolveVariantDir.test.js +0 -52
  217. package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.d.ts +0 -2
  218. package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.js +0 -67
  219. package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.d.ts +0 -2
  220. package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.js +0 -83
  221. package/cli/dist/lib/template-engine/storageProviderEta.test.d.ts +0 -2
  222. package/cli/dist/lib/template-engine/storageProviderEta.test.js +0 -26
  223. package/cli/project-templates/plugin/shared-base/scripts/build-types.cjs +0 -8
  224. package/cli/project-templates/plugin/shared-base/scripts/clean.cjs +0 -6
  225. package/cli/project-templates/plugin/shared-base/scripts/dev-runner.cjs +0 -48
  226. package/cli/project-templates/plugin/shared-base/scripts/release-runner.cjs +0 -63
  227. package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.mjs +0 -80
  228. package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.cjs +0 -235
  229. package/cli/project-templates/shared/stand-webpack-base/config/lib/umdServeMiddleware.cjs +0 -38
  230. package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.cjs +0 -235
  231. package/emailmaker-core.80d62b88.js +0 -569
  232. package/runtime/_core/app-core/index.js +0 -1
  233. package/runtime/_core/chunks/app-core-DphKKh8f.js +0 -1
  234. package/runtime/_core/chunks/chunk-oqAt0Dze.js +0 -1
  235. package/runtime/_core/chunks/di-BHUzE57z.js +0 -1
  236. package/runtime/_core/chunks/disposable-PhM3rJkj.js +0 -1
  237. package/runtime/_core/chunks/errors-runtime-VjCOXaQX.js +0 -1
  238. package/runtime/_core/chunks/guid-D2-FTZQG.js +0 -1
  239. package/runtime/_core/di/index.js +0 -1
  240. package/runtime/_core/disposable/index.js +0 -1
  241. package/runtime/_core/errors-runtime/index.js +0 -1
  242. package/runtime/_core/guid/index.js +0 -1
  243. package/runtime/_core/index.js +0 -1
  244. package/shared/hostBootstrap.js +0 -47
  245. package/shared/pluginDevOptions.js +0 -31
  246. package/shared/runtimeManifest.js +0 -72
  247. package/shared/stringCase.js +0 -16
  248. package/static/core/2360f32a.js +0 -3
  249. package/static/core/2687db56.js +0 -3
  250. package/static/core/2b250af6.js +0 -1261
  251. package/static/core/3469930c.js +0 -302
  252. package/static/core/34ce9042.js +0 -201
  253. package/static/core/4091ba5b.js +0 -25
  254. package/static/core/41ce3a6a.js +0 -173
  255. package/static/core/4ac4908c.js +0 -2213
  256. package/static/core/519096c1.js +0 -2597
  257. package/static/core/5fa1772b.js +0 -116550
  258. package/static/core/61312909.js +0 -3
  259. package/static/core/62a98c07.js +0 -75301
  260. package/static/core/6309c0f2.js +0 -3
  261. package/static/core/68d9f440.js +0 -3
  262. package/static/core/73b645ab.js +0 -2
  263. package/static/core/81019351.js +0 -280
  264. package/static/core/835b37ef.js +0 -591
  265. package/static/core/91242fb3.js +0 -3
  266. package/static/core/972b15b0.js +0 -92399
  267. package/static/core/974ef468.js +0 -493
  268. package/static/core/a17614422.js +0 -38078
  269. package/static/core/a2fa7b5b.js +0 -4232
  270. package/static/core/a513adfd.js +0 -89857
  271. package/static/core/a7c73a9b.js +0 -3813
  272. package/static/core/b64c7c90.js +0 -228
  273. package/static/core/cdc9ba92.js +0 -4711
  274. package/static/core/d1db685d.js +0 -2193
  275. package/static/core/d661febc.js +0 -3
  276. package/static/core/d6d2d2d0.js +0 -23
  277. package/static/core/df1a1225.js +0 -607
  278. package/static/core/e5bff179.js +0 -1302
  279. package/static/core/e5d602f5.js +0 -2
  280. package/static/core/eb029366.js +0 -1532
  281. package/static/core/f46c035a.js +0 -2
  282. package/static/core/f8b9d89a.js +0 -461
  283. package/static/core/fd897ad7.js +0 -3
  284. package/static/core/fdd890c7.js +0 -6168
  285. package/static/esm/29eb18ff.js +0 -164
  286. package/vite/mime-types.js +0 -179
  287. package/vite/utils.js +0 -44
  288. /package/cli/project-templates/plugin/bundler-vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  289. /package/cli/project-templates/plugin/bundler-vite/config/{plugin-build.mjs.eta → plugin-build.ts.eta} +0 -0
  290. /package/cli/project-templates/plugin/bundler-vite/config/{sandbox-build.mjs.eta → sandbox-build.ts.eta} +0 -0
  291. /package/cli/project-templates/plugin/bundler-webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  292. /package/cli/project-templates/plugin/bundler-webpack/config/{plugin-build.cjs.eta → plugin-build.ts.eta} +0 -0
  293. /package/cli/project-templates/plugin/bundler-webpack/config/{sandbox-build.cjs.eta → sandbox-build.ts.eta} +0 -0
  294. /package/cli/project-templates/stand/advanced/memory-usage/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  295. /package/cli/project-templates/stand/advanced/shadow-dom/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  296. /package/cli/project-templates/stand/advanced/shadow-dom/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  297. /package/cli/project-templates/stand/advanced/subpath/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  298. /package/cli/project-templates/stand/advanced/subpath/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  299. /package/cli/project-templates/stand/advanced/umd/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  300. /package/cli/project-templates/stand/advanced/umd/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  301. /package/cli/project-templates/stand/closed-loop/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  302. /package/cli/project-templates/stand/closed-loop/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  303. /package/cli/project-templates/stand/oauth/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  304. /package/cli/project-templates/stand/oauth/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
  305. /package/cli/project-templates/stand/react-adapter/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
  306. /package/iframe/{iframe-eblock.80d62b88.html → iframe-eblock.ed344c04.html} +0 -0
  307. /package/iframe/{iframe.80d62b88.html → iframe.ed344c04.html} +0 -0
  308. /package/{runtime/chunks → static/runtime}/DownloadOutlined-a2ZUz7zB.js +0 -0
  309. /package/{runtime/chunks → static/runtime}/chunk-D-iEO58U.js +0 -0
  310. /package/{runtime/chunks → static/runtime}/classnames-DBEldvch.js +0 -0
  311. /package/{runtime/chunks → static/runtime}/client-5XqXGmAI.js +0 -0
  312. /package/{runtime/chunks → static/runtime}/dayjs.min-CO3mzOeV.js +0 -0
  313. /package/{runtime/_core/chunks/defineProperty-BGJFuFMq.js → static/runtime/defineProperty-CGNmw-jw.js} +0 -0
  314. /package/{runtime/chunks → static/runtime}/dist-Cns8cA2n.js +0 -0
  315. /package/{runtime/chunks → static/runtime}/dist-Ct0xRt3Y.js +0 -0
  316. /package/{runtime/chunks → static/runtime}/es-0FFT3fCz.js +0 -0
  317. /package/{runtime/chunks → static/runtime}/es-BwJ3eGbx.js +0 -0
  318. /package/{runtime/chunks → static/runtime}/es-D8EsVtRL.js +0 -0
  319. /package/{runtime/chunks → static/runtime}/es-Da4O25Kw.js +0 -0
  320. /package/{runtime/chunks → static/runtime}/jsx-dev-runtime-V4_MuHNS.js +0 -0
  321. /package/{runtime/chunks → static/runtime}/jsx-runtime-DBeCoE0b.js +0 -0
  322. /package/{runtime/chunks → static/runtime}/objectWithoutProperties-Bk0EDksJ.js +0 -0
  323. /package/{runtime/chunks → static/runtime}/prop-types-DxD5wgQ0.js +0 -0
  324. /package/{runtime/chunks → static/runtime}/react-TEeeBWTl.js +0 -0
  325. /package/{runtime/chunks → static/runtime}/react-dom-BKKa1g6U.js +0 -0
package/vite/index.js CHANGED
@@ -1,300 +1,345 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const MIME_TYPES = require('./mime-types');
4
- const { cleanUrl, normalizePath, copyFolder } = require('./utils');
5
- const { createInitFragment: createInitFragmentShared } = require('../shared/hostBootstrap');
6
-
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ let path = require("path");
24
+ path = __toESM(path);
25
+ let fs = require("fs");
26
+ fs = __toESM(fs);
27
+ let os = require("os");
28
+ os = __toESM(os);
29
+ let fs_promises = require("fs/promises");
30
+ //#region src/vite/mime-types.ts
31
+ /**
32
+ * Нам не нужен огромный универсальный справочник MIME:
33
+ * этот dev-server отдает только типичные веб-ассеты из npm-пакета.
34
+ * Чем меньше таблица, тем меньше она попадает в итоговый JS-бандл.
35
+ */
36
+ var COMMON_MIME_TYPES = {
37
+ css: "text/css; charset=utf-8",
38
+ eot: "application/vnd.ms-fontobject",
39
+ gif: "image/gif",
40
+ htm: "text/html; charset=utf-8",
41
+ html: "text/html; charset=utf-8",
42
+ ico: "image/x-icon",
43
+ jpeg: "image/jpeg",
44
+ jpg: "image/jpeg",
45
+ js: "application/javascript; charset=utf-8",
46
+ json: "application/json; charset=utf-8",
47
+ map: "application/json; charset=utf-8",
48
+ mjs: "application/javascript; charset=utf-8",
49
+ otf: "font/otf",
50
+ png: "image/png",
51
+ svg: "image/svg+xml",
52
+ txt: "text/plain; charset=utf-8",
53
+ ttf: "font/ttf",
54
+ wasm: "application/wasm",
55
+ webp: "image/webp",
56
+ woff: "font/woff",
57
+ woff2: "font/woff2"
58
+ };
59
+ function getMimeTypeByExtension(ext) {
60
+ if (!ext) return "application/octet-stream";
61
+ return COMMON_MIME_TYPES[ext.toLowerCase()] || "application/octet-stream";
62
+ }
63
+ //#endregion
64
+ //#region src/vite/utils.ts
65
+ function slash(p) {
66
+ return p.replace(/\\/g, "/");
67
+ }
68
+ var cleanUrl = (url) => {
69
+ return url.replace(/#.*$/s, "").replace(/\?.*$/s, "");
70
+ };
71
+ function normalizePath(id) {
72
+ const isWindows = os.default.platform() === "win32";
73
+ return path.default.posix.normalize(isWindows ? slash(id) : id);
74
+ }
75
+ var fileExists = async (p) => !!await (0, fs_promises.stat)(p).catch(() => false);
76
+ async function copyFolder(src, dest, filter) {
77
+ if (!await fileExists(dest)) await (0, fs_promises.mkdir)(dest);
78
+ const entries = await (0, fs_promises.readdir)(src);
79
+ await Promise.all(entries.map(async (entry) => {
80
+ const srcPath = path.default.join(src, entry);
81
+ if (filter(srcPath)) {
82
+ const destPath = path.default.join(dest, entry);
83
+ const st = await (0, fs_promises.stat)(srcPath);
84
+ if (st.isFile()) await (0, fs_promises.copyFile)(srcPath, destPath);
85
+ else if (st.isDirectory()) await copyFolder(srcPath, destPath, filter);
86
+ }
87
+ }));
88
+ }
89
+ //#endregion
90
+ //#region src/shared/hostBootstrap.ts
91
+ function createNormalizedPublicPathAssignment(environmentVariable, rawPath) {
92
+ const literal = JSON.stringify(String(rawPath || ""));
93
+ return [
94
+ `if (!window.${environmentVariable}.publicPath) window.${environmentVariable}.publicPath = (function() {`,
95
+ ` var rawPath = ${literal};`,
96
+ " if (!rawPath) {",
97
+ " rawPath = './';",
98
+ " }",
99
+ " try {",
100
+ " var normalizedPath = String(rawPath);",
101
+ " if (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(normalizedPath) || normalizedPath.indexOf('//') === 0) {",
102
+ " return normalizedPath;",
103
+ " }",
104
+ " var baseUrl = typeof document !== 'undefined' && document.baseURI",
105
+ " ? document.baseURI",
106
+ " : (typeof window !== 'undefined' && window.location ? window.location.href : '');",
107
+ " return baseUrl ? new URL(normalizedPath, baseUrl).href : normalizedPath;",
108
+ " } catch (_error) {",
109
+ " return String(rawPath);",
110
+ " }",
111
+ "})();"
112
+ ].join(" ");
113
+ }
114
+ function createInitFragment$1(environmentVariable, publicPath, startupPrefetchMode) {
115
+ return [
116
+ `window.${environmentVariable} = window.${environmentVariable} || {};`,
117
+ createNormalizedPublicPathAssignment(environmentVariable, publicPath),
118
+ `if (!window.${environmentVariable}.startupPrefetchMode) window.${environmentVariable}.startupPrefetchMode = "${startupPrefetchMode}";`
119
+ ].join(" ");
120
+ }
121
+ //#endregion
122
+ //#region src/shared/branding.ts
123
+ /**
124
+ * Чтение `process.env.REACT_APP_*` — как в основном приложении.
125
+ * На этапе сборки `build.ts` подставляет в `define` итоговые строки (см. `bundlerDefines()`).
126
+ */
127
+ var BUNDLER_DEFAULT_PACKAGE_NAME = "@emailmaker/emailmaker";
128
+ var BUNDLER_DEFAULT_APP_NAME = "emailmaker";
129
+ `${BUNDLER_DEFAULT_APP_NAME}`;
130
+ //#endregion
131
+ //#region src/vite/index.ts
7
132
  /**
8
- * Package name and appName are injected at publish time via apply-version
9
- * (`processBundlerHostPluginFiles` replaces '$$BUILD_DEFAULT_*$$' with JSON strings).
10
- * Repository sources keep placeholders, so this plugin is not intended to be required
11
- * directly from build-tools before apply-version runs.
12
- */
13
- const PACKAGE_PATH = "@emailmaker/emailmaker";
14
- const APP_NAME = "emailmaker";
15
- const ENVIRONMENT_VARIABLE = `__${APP_NAME}__`;
16
- const PLUGIN_NAME = `${APP_NAME}-vite-plugin`;
17
- const PACKAGE_ENTRY_NAME = `${APP_NAME}.js`;
18
- const ESM_PACKAGE_ENTRY_NAME = `${APP_NAME}-esm.js`;
19
- /** URL prefix for publicPath, including the leading slash. */
20
- const DEFAULT_OUTPUT_FOLDER = `/${APP_NAME}`;
21
- const DEFAULT_MODULES_PATH = 'node_modules';
22
- const DEFAULT_STARTUP_PREFETCH_MODE = 'eager';
23
-
133
+ * Package name and appName are injected at build time via `build.ts` (Vite `define` from `REACT_APP_*`).
134
+ */
135
+ var ENVIRONMENT_VARIABLE = `__${BUNDLER_DEFAULT_APP_NAME}__`;
136
+ var PLUGIN_NAME = `${BUNDLER_DEFAULT_APP_NAME}-vite-plugin`;
137
+ var PACKAGE_ENTRY_NAME = `${BUNDLER_DEFAULT_APP_NAME}.js`;
138
+ var ESM_PACKAGE_ENTRY_NAME = `${BUNDLER_DEFAULT_APP_NAME}-esm.js`;
139
+ var DEFAULT_OUTPUT_FOLDER = `/${BUNDLER_DEFAULT_APP_NAME}`;
140
+ var DEFAULT_MODULES_PATH = "node_modules";
141
+ var DEFAULT_STARTUP_PREFETCH_MODE = "eager";
24
142
  function outputFolderFsSegment(folder, appName) {
25
- const raw = folder != null && folder !== '' ? String(folder) : `/${appName}`;
26
- const trimmed = raw.replace(/^\/+/, '');
27
- return trimmed || appName;
143
+ return (folder != null && folder !== "" ? String(folder) : `/${appName}`).replace(/^\/+/, "") || appName;
28
144
  }
29
-
30
- const IGNORED_PATTERNS = [
31
- /.*\.npmignore/,
32
- /.*\.gitignore/,
33
- /.*\.md$/,
34
- /.*\.ts$/,
35
- /.*\.d\.ts$/,
36
- /.*\.json$/,
37
- /.*\.ico$/,
38
- /.*\.pot$/,
39
- /^.*(?<!iframe\..{1,})\.html$/,
40
- /vite\\?.*$/,
41
- /webpack\\?.*$/,
42
- /react\\?.*$/,
43
- /robots.txt$/,
44
- /main\..*\.js$/,
45
- /.*\\sandbox-eblock.*$/,
46
- // ESM consumers import the thin facade entry via bundler.
47
- // Browser-loaded core assets are copied separately and loaded from publicPath.
48
- new RegExp(PACKAGE_ENTRY_NAME.replace(/\./g, '\\.') + '$'),
49
- new RegExp(ESM_PACKAGE_ENTRY_NAME.replace(/\./g, '\\.') + '$'),
50
- /\.js\.map$/,
145
+ var IGNORED_PATTERNS = [
146
+ /.*\.npmignore/,
147
+ /.*\.gitignore/,
148
+ /.*\.md$/,
149
+ /.*\.ts$/,
150
+ /.*\.d\.ts$/,
151
+ /.*\.json$/,
152
+ /.*\.ico$/,
153
+ /.*\.pot$/,
154
+ /^.*(?<!iframe\..{1,})\.html$/,
155
+ /vite\\?.*$/,
156
+ /webpack\\?.*$/,
157
+ /react\\?.*$/,
158
+ /robots.txt$/,
159
+ /main\..*\.js$/,
160
+ /.*\\sandbox-eblock.*$/,
161
+ new RegExp(PACKAGE_ENTRY_NAME.replace(/\./g, "\\.") + "$"),
162
+ new RegExp(ESM_PACKAGE_ENTRY_NAME.replace(/\./g, "\\.") + "$"),
163
+ /\.js\.map$/
51
164
  ];
52
-
53
165
  function createInitFragment(publicPath, startupPrefetchMode) {
54
- return createInitFragmentShared(ENVIRONMENT_VARIABLE, publicPath, startupPrefetchMode);
166
+ return createInitFragment$1(ENVIRONMENT_VARIABLE, publicPath, startupPrefetchMode);
55
167
  }
56
-
57
168
  function normalizeForMatch(value) {
58
- return cleanUrl(String(value || '')).replace(/\\/g, '/');
169
+ return cleanUrl(String(value || "")).replace(/\\/g, "/");
59
170
  }
60
-
61
171
  function createBootstrapPrefix(publicPath, startupPrefetchMode) {
62
- return `${createInitFragment(publicPath, startupPrefetchMode)};\n`;
172
+ return `${createInitFragment(publicPath, startupPrefetchMode)};\n`;
63
173
  }
64
-
65
174
  function prependBootstrap(code, publicPath, startupPrefetchMode) {
66
- return `${createBootstrapPrefix(publicPath, startupPrefetchMode)}${code}`;
175
+ return `${createBootstrapPrefix(publicPath, startupPrefetchMode)}${code}`;
67
176
  }
68
-
69
177
  function getPackageEntryCandidates(packageRoot) {
70
- return [
71
- normalizeForMatch(path.join(packageRoot, ESM_PACKAGE_ENTRY_NAME)),
72
- normalizeForMatch(path.join(packageRoot, PACKAGE_ENTRY_NAME)),
73
- ];
178
+ return [normalizeForMatch(path.default.join(packageRoot, ESM_PACKAGE_ENTRY_NAME)), normalizeForMatch(path.default.join(packageRoot, PACKAGE_ENTRY_NAME))];
74
179
  }
75
-
76
180
  function shouldPatchPackageEntry(id, packageRoot, optimizedFileName) {
77
- const normalizedId = normalizeForMatch(id);
78
- const candidates = getPackageEntryCandidates(packageRoot);
79
- if (candidates.includes(normalizedId)) {
80
- return true;
81
- }
82
- const resolvedOptimizedFileName = optimizedFileName || getFlattenedOptimizedDepFileName();
83
- return isOptimizedDepRequest(normalizedId, resolvedOptimizedFileName);
181
+ const normalizedId = normalizeForMatch(id);
182
+ if (getPackageEntryCandidates(packageRoot).includes(normalizedId)) return true;
183
+ return isOptimizedDepRequest(normalizedId, optimizedFileName || getFlattenedOptimizedDepFileName());
84
184
  }
85
-
86
185
  function getFlattenedOptimizedDepFileName() {
87
- return `${PACKAGE_PATH.replace(/[\\/]/g, '_')}.js`;
186
+ return `${BUNDLER_DEFAULT_PACKAGE_NAME.replace(/[\\/]/g, "_")}.js`;
88
187
  }
89
-
90
188
  function readOptimizedDepFileName(depsMetadataPath) {
91
- if (!fs.existsSync(depsMetadataPath)) return getFlattenedOptimizedDepFileName();
92
- try {
93
- const metadata = JSON.parse(fs.readFileSync(depsMetadataPath, 'utf-8'));
94
- const optimized = metadata && metadata.optimized;
95
- const depInfo = optimized && optimized[PACKAGE_PATH];
96
- return depInfo && typeof depInfo.file === 'string'
97
- ? depInfo.file
98
- : getFlattenedOptimizedDepFileName();
99
- } catch {
100
- return getFlattenedOptimizedDepFileName();
101
- }
189
+ if (!fs.default.existsSync(depsMetadataPath)) return getFlattenedOptimizedDepFileName();
190
+ try {
191
+ const metadata = JSON.parse(fs.default.readFileSync(depsMetadataPath, "utf-8"));
192
+ const optimized = metadata && metadata.optimized;
193
+ const depInfo = optimized && optimized["@emailmaker/emailmaker"];
194
+ return depInfo && typeof depInfo.file === "string" ? depInfo.file : getFlattenedOptimizedDepFileName();
195
+ } catch {
196
+ return getFlattenedOptimizedDepFileName();
197
+ }
102
198
  }
103
-
104
199
  function isOptimizedDepRequest(pathname, optimizedFileName) {
105
- if (!optimizedFileName) return false;
106
- const normalizedPathname = normalizeForMatch(pathname);
107
- return normalizedPathname.includes('/.vite/deps/')
108
- && normalizedPathname.endsWith(`/${optimizedFileName}`);
200
+ if (!optimizedFileName) return false;
201
+ const normalizedPathname = normalizeForMatch(pathname);
202
+ return normalizedPathname.includes("/.vite/deps/") && normalizedPathname.endsWith(`/${optimizedFileName}`);
109
203
  }
110
-
111
204
  /**
112
- * The browser may request browser-loaded core as a URL relative to `/.vite/deps/`
113
- * when runtime publicPath points at the prebundle directory. That file does not
114
- * exist there because the real asset lives in the npm package root.
115
- */
205
+ * The browser may request browser-loaded core as a URL relative to `/.vite/deps/`
206
+ * when runtime publicPath points at the prebundle directory. That file does not
207
+ * exist there because the real asset lives in the npm package root.
208
+ */
116
209
  function getDepsCoreBasenameIfAny(pathname) {
117
- const normalizedPathname = normalizeForMatch(pathname);
118
- if (!normalizedPathname.includes('/.vite/deps/')) return null;
119
- const segments = pathname.split('/').filter(Boolean);
120
- const base = segments.length ? segments[segments.length - 1] : '';
121
- const re = new RegExp(`^${APP_NAME.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}-core\\.[a-f0-9]+\\.js$`);
122
- return re.test(base) ? base : null;
210
+ if (!normalizeForMatch(pathname).includes("/.vite/deps/")) return null;
211
+ const segments = pathname.split("/").filter(Boolean);
212
+ const base = segments.length ? segments[segments.length - 1] : "";
213
+ return new RegExp(`^${"emailmaker".replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}-core\\.[a-f0-9]+\\.js$`).test(base) ? base : null;
123
214
  }
124
-
125
- // =============================================================================
126
- // Serve plugin: dev-server middleware that proxies static files
127
- // =============================================================================
128
-
129
- const ViteServePlugin = (options) => {
130
- const rootPath = process.cwd();
131
- const mountSeg = outputFolderFsSegment(options.outputFolder, APP_NAME);
132
- const destPath = path.normalize(path.join(rootPath, mountSeg));
133
- const packageRoot = path.join(options.modulesPath || DEFAULT_MODULES_PATH, PACKAGE_PATH);
134
- const publicPath = `${String(options.outputFolder || DEFAULT_OUTPUT_FOLDER).replace(/\/$/, '')}/`;
135
- const startupPrefetchMode = options.startupPrefetchMode || DEFAULT_STARTUP_PREFETCH_MODE;
136
- let optimizedFacadeFile = getFlattenedOptimizedDepFileName();
137
-
138
- return {
139
- name: `${PLUGIN_NAME}-serve`,
140
- enforce: 'pre',
141
- apply: 'serve',
142
- configResolved(config) {
143
- const depsMetadataPath = path.join(config.cacheDir, 'deps', '_metadata.json');
144
- optimizedFacadeFile = readOptimizedDepFileName(depsMetadataPath);
145
- },
146
- transform(code, id) {
147
- if (!shouldPatchPackageEntry(id, packageRoot, optimizedFacadeFile)) return code;
148
- return prependBootstrap(code, publicPath, startupPrefetchMode);
149
- },
150
-
151
- configureServer: (server) => {
152
- const depsMetadataPath = path.join(server.config.cacheDir, 'deps', '_metadata.json');
153
- optimizedFacadeFile = readOptimizedDepFileName(depsMetadataPath);
154
- server.middlewares.use('/', async (req, res, next) => {
155
- if (!req.url) {
156
- next();
157
- return;
158
- }
159
- const pathname = cleanUrl(req.url).replace(/^\/+/, '');
160
- if (!pathname) {
161
- next();
162
- return;
163
- }
164
-
165
- const coreBasename = getDepsCoreBasenameIfAny(pathname);
166
- if (coreBasename) {
167
- const absCore = path.join(packageRoot, coreBasename);
168
- const ok = fs.existsSync(absCore) && fs.statSync(absCore).isFile();
169
- if (ok) {
170
- const content = await fs.promises.readFile(absCore, 'utf-8');
171
- res.writeHead(200, {
172
- 'Content-Type': MIME_TYPES.js || 'application/javascript; charset=utf-8',
173
- });
174
- res.end(content);
175
- return;
176
- }
177
- }
178
-
179
- const optimizedFileName = readOptimizedDepFileName(depsMetadataPath);
180
- if (isOptimizedDepRequest(pathname, optimizedFileName)) {
181
- const optimizedFilePath = path.join(server.config.cacheDir, 'deps', optimizedFileName);
182
- if (fs.existsSync(optimizedFilePath) && fs.statSync(optimizedFilePath).isFile()) {
183
- const content = await fs.promises.readFile(optimizedFilePath, 'utf-8');
184
- res.writeHead(200, {
185
- 'Content-Type': MIME_TYPES.js || 'application/javascript; charset=utf-8',
186
- });
187
- res.end(prependBootstrap(content, publicPath, startupPrefetchMode));
188
- return;
189
- }
190
- }
191
- const absReqPath = path.normalize(path.join(rootPath, ...pathname.split('/').filter(Boolean)));
192
- const normDest = path.normalize(destPath);
193
- if (absReqPath === normDest || absReqPath.startsWith(normDest + path.sep)) {
194
- const rel = path.relative(normDest, absReqPath);
195
- if (rel.startsWith('..') || path.isAbsolute(rel)) {
196
- next();
197
- return;
198
- }
199
- const sourcePath = path.join(
200
- options.modulesPath || DEFAULT_MODULES_PATH,
201
- PACKAGE_PATH,
202
- rel,
203
- );
204
- if (!IGNORED_PATTERNS.some((pattern) => pattern.test(sourcePath)) && fs.existsSync(sourcePath)) {
205
- await sendContentByFilePath(sourcePath);
206
- return;
207
- }
208
- }
209
- next();
210
-
211
- async function sendContentByFilePath(filePath) {
212
- const handledPath = normalizePath(filePath);
213
- if (!fs.existsSync(handledPath)) {
214
- next();
215
- return;
216
- }
217
- if (!fs.statSync(handledPath).isFile()) {
218
- next();
219
- return;
220
- }
221
- const content = await fs.promises.readFile(handledPath);
222
- const filePathParts = filePath.split('.');
223
- const ext = filePathParts.length > 1 ? filePathParts[filePathParts.length - 1] : '';
224
- res.writeHead(200, {
225
- 'Content-Type': (ext && MIME_TYPES[ext]) || 'text/plain',
226
- });
227
- res.end(content);
228
- }
229
- });
230
- },
231
- };
215
+ var ViteServePlugin = (options) => {
216
+ const rootPath = process.cwd();
217
+ const mountSeg = outputFolderFsSegment(options.outputFolder, BUNDLER_DEFAULT_APP_NAME);
218
+ const destPath = path.default.normalize(path.default.join(rootPath, mountSeg));
219
+ const packageRoot = path.default.join(options.modulesPath || DEFAULT_MODULES_PATH, BUNDLER_DEFAULT_PACKAGE_NAME);
220
+ const publicPath = `${String(options.outputFolder || DEFAULT_OUTPUT_FOLDER).replace(/\/$/, "")}/`;
221
+ const startupPrefetchMode = options.startupPrefetchMode || DEFAULT_STARTUP_PREFETCH_MODE;
222
+ let optimizedFacadeFile = getFlattenedOptimizedDepFileName();
223
+ return {
224
+ name: `${PLUGIN_NAME}-serve`,
225
+ enforce: "pre",
226
+ apply: "serve",
227
+ configResolved(config) {
228
+ optimizedFacadeFile = readOptimizedDepFileName(path.default.join(config.cacheDir, "deps", "_metadata.json"));
229
+ },
230
+ transform(code, id) {
231
+ if (!shouldPatchPackageEntry(id, packageRoot, optimizedFacadeFile)) return code;
232
+ return prependBootstrap(code, publicPath, startupPrefetchMode);
233
+ },
234
+ configureServer: (server) => {
235
+ const depsMetadataPath = path.default.join(server.config.cacheDir, "deps", "_metadata.json");
236
+ optimizedFacadeFile = readOptimizedDepFileName(depsMetadataPath);
237
+ server.middlewares.use("/", async (req, res, next) => {
238
+ if (!req.url) {
239
+ next();
240
+ return;
241
+ }
242
+ const pathname = cleanUrl(req.url).replace(/^\/+/, "");
243
+ if (!pathname) {
244
+ next();
245
+ return;
246
+ }
247
+ const coreBasename = getDepsCoreBasenameIfAny(pathname);
248
+ if (coreBasename) {
249
+ const absCore = path.default.join(packageRoot, coreBasename);
250
+ if (fs.default.existsSync(absCore) && fs.default.statSync(absCore).isFile()) {
251
+ const content = await fs.default.promises.readFile(absCore, "utf-8");
252
+ res.writeHead(200, { "Content-Type": getMimeTypeByExtension("js") });
253
+ res.end(content);
254
+ return;
255
+ }
256
+ }
257
+ const optimizedFileName = readOptimizedDepFileName(depsMetadataPath);
258
+ if (isOptimizedDepRequest(pathname, optimizedFileName)) {
259
+ const optimizedFilePath = path.default.join(server.config.cacheDir, "deps", optimizedFileName);
260
+ if (fs.default.existsSync(optimizedFilePath) && fs.default.statSync(optimizedFilePath).isFile()) {
261
+ const content = await fs.default.promises.readFile(optimizedFilePath, "utf-8");
262
+ res.writeHead(200, { "Content-Type": getMimeTypeByExtension("js") });
263
+ res.end(prependBootstrap(content, publicPath, startupPrefetchMode));
264
+ return;
265
+ }
266
+ }
267
+ const absReqPath = path.default.normalize(path.default.join(rootPath, ...pathname.split("/").filter(Boolean)));
268
+ const normDest = path.default.normalize(destPath);
269
+ if (absReqPath === normDest || absReqPath.startsWith(normDest + path.default.sep)) {
270
+ const rel = path.default.relative(normDest, absReqPath);
271
+ if (rel.startsWith("..") || path.default.isAbsolute(rel)) {
272
+ next();
273
+ return;
274
+ }
275
+ const sourcePath = path.default.join(options.modulesPath || DEFAULT_MODULES_PATH, BUNDLER_DEFAULT_PACKAGE_NAME, rel);
276
+ if (!IGNORED_PATTERNS.some((pattern) => pattern.test(sourcePath)) && fs.default.existsSync(sourcePath)) {
277
+ await sendContentByFilePath(sourcePath);
278
+ return;
279
+ }
280
+ }
281
+ next();
282
+ async function sendContentByFilePath(filePath) {
283
+ const handledPath = normalizePath(filePath);
284
+ if (!fs.default.existsSync(handledPath)) {
285
+ next();
286
+ return;
287
+ }
288
+ if (!fs.default.statSync(handledPath).isFile()) {
289
+ next();
290
+ return;
291
+ }
292
+ const content = await fs.default.promises.readFile(handledPath);
293
+ const filePathParts = filePath.split(".");
294
+ const ext = filePathParts.length > 1 ? filePathParts[filePathParts.length - 1] : "";
295
+ res.writeHead(200, { "Content-Type": getMimeTypeByExtension(ext) });
296
+ res.end(content);
297
+ }
298
+ });
299
+ }
300
+ };
232
301
  };
233
-
234
- // =============================================================================
235
- // Build plugin: copies static assets + injects publicPath
236
- // =============================================================================
237
-
238
- const ViteBuildPlugin = (options) => {
239
- const publicPath = options.publicPath || '';
240
- const sourcePath = path.join(options.modulesPath || DEFAULT_MODULES_PATH, PACKAGE_PATH);
241
- let resolvedConfig = undefined;
242
- const normalizedPublicPath = `${String(path.posix.join(publicPath, options.outputFolder || DEFAULT_OUTPUT_FOLDER)).replace(/\/$/, '')}/`;
243
- const startupPrefetchMode = options.startupPrefetchMode || DEFAULT_STARTUP_PREFETCH_MODE;
244
-
245
- return {
246
- name: `${PLUGIN_NAME}-build`,
247
- enforce: 'pre',
248
- apply: 'build',
249
- transform(code, id) {
250
- if (!shouldPatchPackageEntry(id, sourcePath)) return code;
251
- return prependBootstrap(code, normalizedPublicPath, startupPrefetchMode);
252
- },
253
- configResolved(config) {
254
- resolvedConfig = config;
255
- },
256
- async closeBundle() {
257
- const outDir = path.join(resolvedConfig.root, resolvedConfig.build.outDir);
258
- const outSeg = outputFolderFsSegment(options.outputFolder, APP_NAME);
259
- const destPath = path.join(outDir, outSeg);
260
-
261
- if (!fs.existsSync(sourcePath)) {
262
- return;
263
- }
264
-
265
- const stat = await fs.promises.stat(sourcePath);
266
-
267
- if (stat.isDirectory()) {
268
- await copyFolder(sourcePath, destPath, (sourcePath) => {
269
- return !IGNORED_PATTERNS.some((pattern) => pattern.test(sourcePath));
270
- });
271
- }
272
- },
273
- };
302
+ var ViteBuildPlugin = (options) => {
303
+ const publicPath = options.publicPath || "";
304
+ const sourcePath = path.default.join(options.modulesPath || DEFAULT_MODULES_PATH, BUNDLER_DEFAULT_PACKAGE_NAME);
305
+ let resolvedConfig;
306
+ const normalizedPublicPath = `${String(path.default.posix.join(publicPath, options.outputFolder || DEFAULT_OUTPUT_FOLDER)).replace(/\/$/, "")}/`;
307
+ const startupPrefetchMode = options.startupPrefetchMode || DEFAULT_STARTUP_PREFETCH_MODE;
308
+ return {
309
+ name: `${PLUGIN_NAME}-build`,
310
+ enforce: "pre",
311
+ apply: "build",
312
+ transform(code, id) {
313
+ if (!shouldPatchPackageEntry(id, sourcePath)) return code;
314
+ return prependBootstrap(code, normalizedPublicPath, startupPrefetchMode);
315
+ },
316
+ configResolved(config) {
317
+ resolvedConfig = config;
318
+ },
319
+ async closeBundle() {
320
+ if (!resolvedConfig) return;
321
+ const outDir = path.default.join(resolvedConfig.root, resolvedConfig.build.outDir);
322
+ const outSeg = outputFolderFsSegment(options.outputFolder, BUNDLER_DEFAULT_APP_NAME);
323
+ const destPath = path.default.join(outDir, outSeg);
324
+ if (!fs.default.existsSync(sourcePath)) return;
325
+ if ((await fs.default.promises.stat(sourcePath)).isDirectory()) await copyFolder(sourcePath, destPath, (sp) => {
326
+ return !IGNORED_PATTERNS.some((pattern) => pattern.test(sp));
327
+ });
328
+ }
329
+ };
274
330
  };
275
-
276
- // =============================================================================
277
- // Main entry
278
- // =============================================================================
279
-
280
331
  /**
281
- * Vite plugin for host applications.
282
- * Copies static assets (images, iframe, fonts, monaco workers) to the build output
283
- * and injects publicPath into the entry module so the editor can locate them at runtime.
284
- * The thin facade entry is still handled by the consumer bundler, while
285
- * browser-loaded core assets are copied to the host output and served from publicPath.
286
- *
287
- * For plugin development (externals + alias), use a separate plugin
288
- * from the `vite/pluginDev` subpath.
289
- *
290
- * @param {Object} [options]
291
- * @param {string} [options.publicPath]
292
- * @param {string} [options.outputFolder]
293
- * @param {string} [options.modulesPath]
294
- * @param {'eager'|'idle'|'manual'|'off'} [options.startupPrefetchMode='eager']
295
- */
296
- const VitePlugin = (options = {}) => {
297
- return [ViteServePlugin(options), ViteBuildPlugin(options)];
332
+ * Vite plugin for host applications.
333
+ * Copies static assets (images, iframe, fonts, monaco workers) to the build output
334
+ * and injects publicPath into the entry module so the editor can locate them at runtime.
335
+ * The thin facade entry is still handled by the consumer bundler, while
336
+ * browser-loaded core assets are copied to the host output and served from publicPath.
337
+ *
338
+ * For plugin development (externals + alias), use a separate plugin
339
+ * from the `vite/pluginDev` subpath.
340
+ */
341
+ var VitePlugin = (options = {}) => {
342
+ return [ViteServePlugin(options), ViteBuildPlugin(options)];
298
343
  };
299
-
344
+ //#endregion
300
345
  module.exports = VitePlugin;