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

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.aa9efbce.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/4aaa358b2.js +903 -0
  158. package/static/core/50ff48bc.js +4 -0
  159. package/static/core/5282795d2.js +6 -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/cec8d739.js +11 -0
  183. package/static/core/cf45bf332.js +598 -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.aa9efbce.html} +0 -0
  307. /package/iframe/{iframe.80d62b88.html → iframe.aa9efbce.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
@@ -0,0 +1,93 @@
1
+ import { useEffect } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import * as <%= it.productApiName %> from '<%= it.packageConfig.packageName %>';
4
+ import type { ExportedApi } from '<%= it.packageConfig.packageName %>';
5
+ import baseEmailHtml from './email.html?raw';
6
+ import { createEditorConfig } from './editorConfig';
7
+ import { getAuthToken } from './getAuthToken';
8
+
9
+ const productBlockGroups = [
10
+ {
11
+ id: 'group1',
12
+ name: 'iPhone X',
13
+ image_url: '/demo/product-1.svg',
14
+ price: 999.95,
15
+ count: 5,
16
+ },
17
+ {
18
+ id: 'group2',
19
+ name: 'MacBook Pro',
20
+ image_url: '/demo/product-2.svg',
21
+ price: 1499.95,
22
+ count: 1,
23
+ },
24
+ ];
25
+
26
+ const editorConfig = createEditorConfig({ productBlockGroups });
27
+
28
+ function createDemoEmailId() {
29
+ if (typeof globalThis.crypto?.randomUUID === 'function') {
30
+ return globalThis.crypto.randomUUID();
31
+ }
32
+
33
+ return `demo-email-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
34
+ }
35
+
36
+ const DEMO_TARGET_MARKUP = [
37
+ '<tr>',
38
+ ' <td style="padding: 32px; font-family: Arial, sans-serif; font-size: 16px; line-height: 24px; color: #333333;">',
39
+ ' <div style="padding: 16px; border: 1px dashed #d9d9d9; border-radius: 8px; background: #ffffff;">',
40
+ <%~ it.demoMessageLiteral %>,
41
+ ' </div>',
42
+ ' </td>',
43
+ '</tr>',
44
+ ].join('');
45
+
46
+ const EMPTY_EMAIL_CONTAINER = '<table cellpadding="0" cellspacing="0" width="100%" border="0" style="max-width: 660px; min-width: 660px; width: 660px;" class="em-narrow-table"></table>';
47
+
48
+ function createDemoEmailHtml() {
49
+ const populatedContainer = EMPTY_EMAIL_CONTAINER.replace('</table>', DEMO_TARGET_MARKUP + '</table>');
50
+ return baseEmailHtml.includes(EMPTY_EMAIL_CONTAINER)
51
+ ? baseEmailHtml.replace(EMPTY_EMAIL_CONTAINER, populatedContainer)
52
+ : baseEmailHtml;
53
+ }
54
+
55
+ export interface HostAppOptions {
56
+ plugins: NonNullable<ExportedApi.Options['plugins']>;
57
+ }
58
+
59
+ export function renderHostApp(options: HostAppOptions): void {
60
+ const { plugins } = options;
61
+ const contentCode = createDemoEmailHtml();
62
+
63
+ function PluginDevHostApp() {
64
+ useEffect(() => {
65
+ void (async () => {
66
+ const initOptions = {
67
+ getAuthToken,
68
+ element: '#editor-root',
69
+ content: {
70
+ email: {
71
+ id: createDemoEmailId(),
72
+ title: <%~ it.devHostDemoTitleLiteral %>,
73
+ code: contentCode,
74
+ },
75
+ },
76
+ config: editorConfig,
77
+ plugins,
78
+ } satisfies ExportedApi.Options;
79
+ await <%= it.productApiName %>.init(initOptions);
80
+ })();
81
+ }, []);
82
+
83
+ return <div id="editor-root" />;
84
+ }
85
+
86
+ const rootElement = document.getElementById('root');
87
+
88
+ if (!rootElement) {
89
+ throw new Error(<%~ it.rootElementNotFoundLiteral %>);
90
+ }
91
+
92
+ createRoot(rootElement).render(<PluginDevHostApp />);
93
+ }
@@ -0,0 +1,54 @@
1
+ import { useEffect } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import * as <%= it.productApiName %> from '<%= it.packageConfig.packageName %>';
4
+ import type { ExportedApi } from '<%= it.packageConfig.packageName %>';
5
+ import baseEmailHtml from './email.html?raw';
6
+ import { editorConfig } from './editorConfig';
7
+ import { getAuthToken } from './getAuthToken';
8
+
9
+ function createDemoEmailId() {
10
+ if (typeof globalThis.crypto?.randomUUID === 'function') {
11
+ return globalThis.crypto.randomUUID();
12
+ }
13
+
14
+ return `demo-email-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
15
+ }
16
+
17
+ export interface HostAppOptions {
18
+ plugins: NonNullable<ExportedApi.Options['plugins']>;
19
+ }
20
+
21
+ export function renderHostApp(options: HostAppOptions): void {
22
+ const { plugins } = options;
23
+
24
+ function PluginDevHostApp() {
25
+ useEffect(() => {
26
+ void (async () => {
27
+ const initOptions = {
28
+ getAuthToken,
29
+ element: '#editor-root',
30
+ content: {
31
+ email: {
32
+ id: createDemoEmailId(),
33
+ title: <%~ it.devHostDemoTitleLiteral %>,
34
+ code: baseEmailHtml,
35
+ },
36
+ },
37
+ config: editorConfig,
38
+ plugins,
39
+ } satisfies ExportedApi.Options;
40
+ await <%= it.productApiName %>.init(initOptions);
41
+ })();
42
+ }, []);
43
+
44
+ return <div id="editor-root" />;
45
+ }
46
+
47
+ const rootElement = document.getElementById('root');
48
+
49
+ if (!rootElement) {
50
+ throw new Error(<%~ it.rootElementNotFoundLiteral %>);
51
+ }
52
+
53
+ createRoot(rootElement).render(<PluginDevHostApp />);
54
+ }
@@ -6,18 +6,19 @@ import baseEmailHtml from './dev/email.html?raw';
6
6
  import { createEditorConfig } from './dev/editorConfig';
7
7
  import { getAuthToken } from './dev/getAuthToken';
8
8
 
9
+ // Локальные демо-картинки из public/demo (доступны с dev-сервера, без внешних CDN).
9
10
  const productBlockGroups = [
10
11
  {
11
12
  id: 'group1',
12
13
  name: 'iPhone X',
13
- image_url: 'https://zwkxy.stripocdn.email/content/guids/CABINET_afa9e4cdc44a36489ab8a25bf18acd36/images/madibadeafricaninspirationaxe4ufe3iv4unsplash_1_sJE.png',
14
+ image_url: '/demo/product-1.svg',
14
15
  price: 999.95,
15
16
  count: 5,
16
17
  },
17
18
  {
18
19
  id: 'group2',
19
20
  name: 'MacBook Pro',
20
- image_url: 'https://zwkxy.stripocdn.email/content/guids/CABINET_04b76f2be80a3047c3463cc03b80c354/images/pexelsannashvets4588065.png',
21
+ image_url: '/demo/product-2.svg',
21
22
  price: 1499.95,
22
23
  count: 1,
23
24
  },
@@ -0,0 +1,18 @@
1
+ import type { ExportedApi } from '<%= it.packageConfig.packageName %>';
2
+ import { renderHostApp } from './dev/hostApp';
3
+
4
+ async function main(): Promise<void> {
5
+ const pluginModule = await import('./index');
6
+
7
+ if (!pluginModule.default) {
8
+ throw new Error('Unable to resolve the local plugin constructor from ./index.');
9
+ }
10
+
11
+ const plugins: NonNullable<ExportedApi.Options['plugins']> = [
12
+ [pluginModule.default, { publicPath: '/' }],
13
+ ];
14
+
15
+ renderHostApp({ plugins });
16
+ }
17
+
18
+ void main();
@@ -0,0 +1,33 @@
1
+ import type { ExportedApi } from '<%= it.packageConfig.packageName %>';
2
+ import { renderHostApp } from './dev/hostApp';
3
+ <% if (it.releaseUsesUmd) { %>
4
+ renderHostApp({
5
+ plugins: [{
6
+ type: 'umd',
7
+ url: '/dist/index.js',
8
+ name: <%~ it.pluginKeyLiteral %>,
9
+ resolve: 'registry',
10
+ }] as NonNullable<ExportedApi.Options['plugins']>,
11
+ });
12
+ <% } else { %>
13
+ type PluginConstructor = typeof import('./index').default;
14
+
15
+ async function main(): Promise<void> {
16
+ const pluginModule = await import(
17
+ <%= it.releaseImportIgnoreComment %>
18
+ '/dist/index.js'
19
+ ) as { default: PluginConstructor };
20
+
21
+ if (!pluginModule.default) {
22
+ throw new Error('Unable to resolve the built plugin constructor from dist/index.js.');
23
+ }
24
+
25
+ const plugins: NonNullable<ExportedApi.Options['plugins']> = [
26
+ [pluginModule.default, { publicPath: '/dist/' }],
27
+ ];
28
+
29
+ renderHostApp({ plugins });
30
+ }
31
+
32
+ void main();
33
+ <% } %>
@@ -1,4 +1,4 @@
1
- type PluginConstructor = typeof import('./index').<%= it.pluginClassName %>;
1
+ type PluginConstructor = typeof import('./index').default;
2
2
  type PluginEntries = NonNullable<ExportedApi.Options['plugins']>;
3
3
  type PluginRunMode = 'debug' | 'release';
4
4
  const RELEASE_PLUGIN_ENTRY: string = '/dist/index.js';
@@ -23,25 +23,25 @@ const RELEASE_PLUGIN_DESCRIPTOR = null;
23
23
 
24
24
  async function loadReleasePlugin() {
25
25
  type PluginModule = {
26
- <%= it.pluginClassName %>: PluginConstructor;
26
+ default: PluginConstructor;
27
27
  };
28
- const { <%= it.pluginClassName %> } = await import(
28
+ const pluginModule = await import(
29
29
  <%= it.releaseImportIgnoreComment %>
30
30
  RELEASE_PLUGIN_ENTRY
31
31
  ) as PluginModule;
32
- if (!<%= it.pluginClassName %>) {
32
+ if (!pluginModule.default) {
33
33
  throw new Error('Unable to resolve the built plugin constructor from dist/index.js.');
34
34
  }
35
- return <%= it.pluginClassName %>;
35
+ return pluginModule.default;
36
36
  }
37
37
  <% } %>
38
38
  async function loadPluginConstructor() {
39
39
  if (!IS_RELEASE_MODE) {
40
- const { <%= it.pluginClassName %> } = await import('./index');
41
- if (!<%= it.pluginClassName %>) {
40
+ const pluginModule = await import('./index');
41
+ if (!pluginModule.default) {
42
42
  throw new Error('Unable to resolve the local plugin constructor from ./index.');
43
43
  }
44
- return <%= it.pluginClassName %>;
44
+ return pluginModule.default;
45
45
  }
46
46
 
47
47
  <% if (it.releaseUsesUmd) { %>throw new Error('Release UMD bundle should be passed as a descriptor.');<% } else { %>return loadReleasePlugin();<% } %>
@@ -1,4 +1,3 @@
1
1
  import { <%= it.pluginClassName %> } from './app/<%= it.pluginClassName %>';
2
2
 
3
- export { <%= it.pluginClassName %> };
4
3
  export default <%= it.pluginClassName %>;
@@ -1,13 +1,14 @@
1
- import path from 'path';
2
- import { fileURLToPath } from 'url';
3
- import { defineConfig } from 'vite';
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { defineConfig, type UserConfigExport } from 'vite';
4
4
  import VitePlugin from '<%= it.packageConfig.packageName %>/vite';
5
5
  import PluginDev from '<%= it.packageConfig.packageName %>/vite/pluginDev';
6
6
 
7
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
8
  const projectRoot = path.resolve(__dirname, '..');
9
+ const isRelease = process.env.EM_DEV_RELEASE === '1';
9
10
 
10
- export default defineConfig(() => ({
11
+ const config = defineConfig(() => ({
11
12
  root: projectRoot,
12
13
  plugins: [
13
14
  ...VitePlugin(),
@@ -15,6 +16,7 @@ export default defineConfig(() => ({
15
16
  ],
16
17
  server: {
17
18
  port: 3000,
19
+ open: isRelease ? '/release.html' : undefined,
18
20
  proxy: {
19
21
  '/api': {
20
22
  target: <%~ JSON.stringify(it.packageConfig.openApiBaseUrl || '') %>,
@@ -30,4 +32,6 @@ export default defineConfig(() => ({
30
32
  },
31
33
  },
32
34
  },
33
- }));
35
+ })) satisfies UserConfigExport;
36
+
37
+ export default config;
@@ -1,13 +1,13 @@
1
- import path from 'path';
2
- import { fileURLToPath } from 'url';
3
- import { defineConfig } from 'vite';
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { defineConfig, type UserConfigExport } from 'vite';
4
4
  import PluginDev from '<%= it.packageConfig.packageName %>/vite/pluginDev';
5
5
 
6
6
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
7
  const projectRoot = path.resolve(__dirname, '..');
8
8
  const pluginDevExternals = <%~ it.importsModeLiteral %>;
9
9
 
10
- export default defineConfig({
10
+ const config = defineConfig({
11
11
  root: projectRoot,
12
12
  plugins: [
13
13
  PluginDev({ externals: pluginDevExternals }),
@@ -24,4 +24,6 @@ export default defineConfig({
24
24
  fileName: () => 'index.js',
25
25
  },
26
26
  },
27
- });
27
+ }) satisfies UserConfigExport;
28
+
29
+ export default config;
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="<%= it.htmlLang %>">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title><%= it.indexHtmlTitle %> release host</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/dev-release.tsx"></script>
11
+ </body>
12
+ </html>
@@ -1,11 +1,11 @@
1
- import path from 'path';
2
- import { fileURLToPath } from 'url';
3
- import { defineConfig } from 'vite';
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { defineConfig, type UserConfigExport } from 'vite';
4
4
 
5
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
6
  const projectRoot = path.resolve(__dirname, '..');
7
7
 
8
- export default defineConfig(({ mode }) => ({
8
+ const config = defineConfig(({ mode }) => ({
9
9
  root: projectRoot,
10
10
  build: {
11
11
  sourcemap: true,
@@ -19,4 +19,6 @@ export default defineConfig(({ mode }) => ({
19
19
  fileName: () => 'sandbox.js',
20
20
  },
21
21
  },
22
- }));
22
+ })) satisfies UserConfigExport;
23
+
24
+ export default config;
@@ -1,12 +1,16 @@
1
- const path = require('path');
2
- const WebpackPlugin = require('<%= it.packageConfig.packageName %>/webpack');
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import type { Configuration } from 'webpack';
4
+ import WebpackPlugin from '<%= it.packageConfig.packageName %>/webpack';
3
5
 
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
4
7
  const projectRoot = path.resolve(__dirname, '..');
8
+ const isRelease = process.env.EM_DEV_RELEASE === '1';
5
9
 
6
- module.exports = {
10
+ const config = {
7
11
  mode: 'development',
8
12
  devtool: 'eval-source-map',
9
- entry: path.resolve(projectRoot, 'src/dev.tsx'),
13
+ entry: path.resolve(projectRoot, isRelease ? 'src/dev-release.tsx' : 'src/dev.tsx'),
10
14
  module: {
11
15
  rules: [
12
16
  {
@@ -38,6 +42,7 @@ module.exports = {
38
42
  { directory: path.resolve(projectRoot, 'dist'), publicPath: '/dist' },
39
43
  ],
40
44
  port: 3000,
45
+ open: isRelease ? '/release.html' : undefined,
41
46
  hot: false,
42
47
  liveReload: true,
43
48
  allowedHosts: 'all',
@@ -53,4 +58,6 @@ module.exports = {
53
58
  },
54
59
  ],
55
60
  },
56
- };
61
+ } satisfies Configuration;
62
+
63
+ export default config;
@@ -1,13 +1,17 @@
1
- const path = require('path');
2
- const WebpackPlugin = require('<%= it.packageConfig.packageName %>/webpack');
3
- const PluginDev = require('<%= it.packageConfig.packageName %>/webpack/pluginDev');
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import type { Configuration } from 'webpack';
4
+ import WebpackPlugin from '<%= it.packageConfig.packageName %>/webpack';
5
+ import PluginDev from '<%= it.packageConfig.packageName %>/webpack/pluginDev';
4
6
 
7
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
8
  const projectRoot = path.resolve(__dirname, '..');
9
+ const isRelease = process.env.EM_DEV_RELEASE === '1';
6
10
 
7
- module.exports = {
11
+ const config = {
8
12
  mode: 'development',
9
13
  devtool: 'eval-source-map',
10
- entry: path.resolve(projectRoot, 'src/dev.tsx'),
14
+ entry: path.resolve(projectRoot, isRelease ? 'src/dev-release.tsx' : 'src/dev.tsx'),
11
15
  module: {
12
16
  rules: [
13
17
  {
@@ -40,6 +44,7 @@ module.exports = {
40
44
  { directory: path.resolve(projectRoot, 'dist'), publicPath: '/dist' },
41
45
  ],
42
46
  port: 3000,
47
+ open: isRelease ? '/release.html' : undefined,
43
48
  hot: false,
44
49
  liveReload: true,
45
50
  allowedHosts: 'all',
@@ -55,4 +60,6 @@ module.exports = {
55
60
  },
56
61
  ],
57
62
  },
58
- };
63
+ } satisfies Configuration;
64
+
65
+ export default config;
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="<%= it.htmlLang %>">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title><%= it.indexHtmlTitle %> release host</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script src="<%= it.webpackIndexScriptSrc %>"></script>
11
+ </body>
12
+ </html>
@@ -1,7 +1,15 @@
1
- const path = require('path');
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import type { Configuration } from 'webpack';
4
+
5
+ interface WebpackArgv {
6
+ mode?: string;
7
+ }
8
+
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
2
10
  const projectRoot = path.resolve(__dirname, '..');
3
11
 
4
- module.exports = (_env, argv = {}) => {
12
+ const config = (_env: Record<string, never>, argv: WebpackArgv = {}) => {
5
13
  const isDev = argv.mode !== 'production';
6
14
 
7
15
  return {
@@ -34,5 +42,7 @@ module.exports = (_env, argv = {}) => {
34
42
  clean: false,
35
43
  iife: true,
36
44
  },
37
- };
45
+ } satisfies Configuration;
38
46
  };
47
+
48
+ export default config;
@@ -1,21 +1,37 @@
1
- const fs = require('fs');
2
- const path = require('path');
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import type { Configuration } from 'webpack';
3
5
 
6
+ type LegacyExternalValue = string | string[];
7
+ type LegacyExternals = Record<string, LegacyExternalValue>;
8
+
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
4
10
  const projectRoot = path.resolve(__dirname, '..');
5
11
 
6
- function readJsonSync(relativePath) {
7
- const absPath = path.resolve(projectRoot, relativePath);
8
- return fs.existsSync(absPath) ? JSON.parse(fs.readFileSync(absPath, 'utf8')) : {};
12
+ function readJsonSync(relativePath: string): LegacyExternals {
13
+ return JSON.parse(fs.readFileSync(path.resolve(projectRoot, relativePath), 'utf8')) as LegacyExternals;
14
+ }
15
+
16
+ function getExternal(packageName: string): LegacyExternals {
17
+ try {
18
+ return readJsonSync(`node_modules/${packageName}/externals.json`);
19
+ } catch (e) {
20
+ console.log(e);
21
+ return {};
22
+ }
9
23
  }
10
24
 
11
- function getExternals() {
25
+ function getExternals(): LegacyExternals {
12
26
  return {
13
- ...readJsonSync('node_modules/<%= it.packageConfig.extensionsApiPackageName %>/externals.json'),
14
- ...readJsonSync('node_modules/<%= it.packageConfig.extensionsReactPackageName %>/externals.json'),
27
+ ...getExternal('<%= it.packageConfig.uiKitPackageName %>'),
28
+ ...getExternal('<%= it.packageConfig.extensionsApiPackageName %>'),
29
+ ...getExternal('<%= it.packageConfig.extensionsReactPackageName %>'),
30
+ ...getExternal('<%= it.packageConfig.extensionsSandboxPackageName %>'),
15
31
  };
16
32
  }
17
33
 
18
- module.exports = {
34
+ const config = {
19
35
  entry: path.resolve(projectRoot, 'src/index.ts'),
20
36
  devtool: 'source-map',
21
37
  mode: 'production',
@@ -50,4 +66,6 @@ module.exports = {
50
66
  type: 'module',
51
67
  },
52
68
  },
53
- };
69
+ } satisfies Configuration;
70
+
71
+ export default config;
@@ -1,21 +1,37 @@
1
- const fs = require('fs');
2
- const path = require('path');
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import type { Configuration } from 'webpack';
3
5
 
6
+ type LegacyExternalValue = string | string[];
7
+ type LegacyExternals = Record<string, LegacyExternalValue>;
8
+
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
4
10
  const projectRoot = path.resolve(__dirname, '..');
5
11
 
6
- function readJsonSync(relativePath) {
7
- const absPath = path.resolve(projectRoot, relativePath);
8
- return fs.existsSync(absPath) ? JSON.parse(fs.readFileSync(absPath, 'utf8')) : {};
12
+ function readJsonSync(relativePath: string): LegacyExternals {
13
+ return JSON.parse(fs.readFileSync(path.resolve(projectRoot, relativePath), 'utf8')) as LegacyExternals;
14
+ }
15
+
16
+ function getExternal(packageName: string): LegacyExternals {
17
+ try {
18
+ return readJsonSync(`node_modules/${packageName}/externals.json`);
19
+ } catch (e) {
20
+ console.log(e);
21
+ return {};
22
+ }
9
23
  }
10
24
 
11
- function getExternals() {
25
+ function getExternals(): LegacyExternals {
12
26
  return {
13
- ...readJsonSync('node_modules/<%= it.packageConfig.extensionsApiPackageName %>/externals.json'),
14
- ...readJsonSync('node_modules/<%= it.packageConfig.extensionsReactPackageName %>/externals.json'),
27
+ ...getExternal('<%= it.packageConfig.uiKitPackageName %>'),
28
+ ...getExternal('<%= it.packageConfig.extensionsApiPackageName %>'),
29
+ ...getExternal('<%= it.packageConfig.extensionsReactPackageName %>'),
30
+ ...getExternal('<%= it.packageConfig.extensionsSandboxPackageName %>'),
15
31
  };
16
32
  }
17
33
 
18
- module.exports = {
34
+ const config = {
19
35
  entry: path.resolve(projectRoot, 'src/index.ts'),
20
36
  devtool: 'source-map',
21
37
  mode: 'production',
@@ -53,4 +69,6 @@ module.exports = {
53
69
  globalObject: 'this',
54
70
  umdNamedDefine: true,
55
71
  },
56
- };
72
+ } satisfies Configuration;
73
+
74
+ export default config;
@@ -1,10 +1,13 @@
1
- const path = require('path');
2
- const PluginDev = require('<%= it.packageConfig.packageName %>/webpack/pluginDev');
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import type { Configuration } from 'webpack';
4
+ import PluginDev from '<%= it.packageConfig.packageName %>/webpack/pluginDev';
3
5
 
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
4
7
  const projectRoot = path.resolve(__dirname, '..');
5
8
  const pluginDevExternals = <%~ it.importsModeLiteral %>;
6
9
 
7
- module.exports = {
10
+ const config = {
8
11
  entry: path.resolve(projectRoot, 'src/index.ts'),
9
12
  devtool: 'source-map',
10
13
  mode: 'production',
@@ -41,4 +44,6 @@ module.exports = {
41
44
  type: 'module',
42
45
  },
43
46
  },
44
- };
47
+ } satisfies Configuration;
48
+
49
+ export default config;
@@ -1,10 +1,13 @@
1
- const path = require('path');
2
- const PluginDev = require('<%= it.packageConfig.packageName %>/webpack/pluginDev');
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import type { Configuration } from 'webpack';
4
+ import PluginDev from '<%= it.packageConfig.packageName %>/webpack/pluginDev';
3
5
 
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
4
7
  const projectRoot = path.resolve(__dirname, '..');
5
8
  const pluginDevExternals = <%~ it.importsModeLiteral %>;
6
9
 
7
- module.exports = {
10
+ const config = {
8
11
  entry: path.resolve(projectRoot, 'src/index.ts'),
9
12
  devtool: 'source-map',
10
13
  mode: 'production',
@@ -44,4 +47,6 @@ module.exports = {
44
47
  globalObject: 'this',
45
48
  umdNamedDefine: true,
46
49
  },
47
- };
50
+ } satisfies Configuration;
51
+
52
+ export default config;
@@ -1,7 +1,7 @@
1
- import path from 'path';
2
- import { fileURLToPath } from 'url';
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
3
  import VitePlugin from '<%~ it.standVitePluginPackage %>/vite';
4
- import { createMemoryUsageStandConfig } from './lib/createMemoryUsageStandConfig.mjs';
4
+ import { createMemoryUsageStandConfig } from './lib/createMemoryUsageStandConfig.ts';
5
5
 
6
6
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
7
  const projectRoot = path.resolve(__dirname, '..');