@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.
- package/README.md +1 -1
- package/cli/dist/lib/cli/project.js +2 -16
- package/cli/dist/lib/config.js +20 -29
- package/cli/dist/lib/local-test.js +3 -19
- package/cli/dist/lib/paths.js +11 -0
- package/cli/dist/lib/resolveNpmSpawn.d.ts +20 -0
- package/cli/dist/lib/resolveNpmSpawn.js +71 -0
- package/cli/dist/lib/template-engine/context/pluginPackageJsonData.js +21 -19
- package/cli/dist/lib/template-engine/context/standVitePackageJsonData.js +7 -8
- package/cli/dist/lib/template-engine/resolveVariantDir.d.ts +5 -1
- package/cli/dist/lib/template-engine/resolveVariantDir.js +22 -0
- package/cli/dist/lib/templates/shared/i18n.js +2 -2
- package/cli/dist/lib/templates/shared/paths.js +3 -4
- package/cli/dist/lib/types/package-config.d.ts +1 -0
- package/cli/lib/cli/project.ts +2 -18
- package/cli/lib/config.ts +19 -30
- package/cli/lib/local-test.ts +3 -22
- package/cli/lib/paths.ts +15 -0
- package/cli/lib/resolveNpmSpawn.ts +72 -0
- package/cli/lib/template-engine/buildStandIndexHtml.test.ts +1 -0
- package/cli/lib/template-engine/context/pluginPackageJsonData.ts +23 -23
- package/cli/lib/template-engine/context/standVitePackageJsonData.ts +7 -12
- package/cli/lib/template-engine/pluginEtaParity.test.ts +1 -0
- package/cli/lib/template-engine/resolveVariantDir.ts +22 -0
- package/cli/lib/template-engine/standAdvancedViteDevHostEta.test.ts +4 -3
- package/cli/lib/template-engine/standWebpackDevHostEta.test.ts +7 -6
- package/cli/lib/templates/shared/i18n.ts +2 -2
- package/cli/lib/templates/shared/paths.ts +3 -4
- package/cli/lib/types/package-config.ts +1 -0
- package/cli/package.json +1 -1
- package/cli/project-templates/plugin/assets/vite/{plugin-build.config.mjs → plugin-build.config.ts} +7 -5
- package/cli/project-templates/plugin/assets/vite/{sandbox-build.config.mjs → sandbox-build.config.ts} +7 -5
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.module.cjs → plugin-build.legacy.module.ts} +20 -7
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.umd.cjs → plugin-build.legacy.umd.ts} +20 -7
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.module.cjs → plugin-build.modern.module.ts} +9 -4
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.umd.cjs → plugin-build.modern.umd.ts} +9 -4
- package/cli/project-templates/plugin/assets/webpack/{sandbox-build.config.cjs → sandbox-build.config.ts} +13 -3
- package/cli/project-templates/plugin/bundler-vite/release.html.eta +1 -0
- package/cli/project-templates/plugin/bundler-webpack/public/release.html.eta +1 -0
- package/cli/project-templates/plugin/shared-base/public/demo/product-1.svg +10 -0
- package/cli/project-templates/plugin/shared-base/public/demo/product-2.svg +10 -0
- package/cli/project-templates/plugin/shared-base/scripts/build-runner.ts +22 -0
- package/cli/project-templates/plugin/shared-base/scripts/build-types.ts +17 -0
- package/cli/project-templates/plugin/shared-base/scripts/clean.ts +16 -0
- package/cli/project-templates/plugin/shared-base/scripts/dev-runner.ts +52 -0
- package/cli/project-templates/plugin/shared-base/scripts/npmRun.ts +61 -0
- package/cli/project-templates/plugin/shared-base/scripts/release-runner.ts +18 -0
- package/cli/project-templates/plugin/shared-base/scripts/scriptRuntime.ts +10 -0
- package/cli/project-templates/plugin/shared-base/src/dev/hostApp.tsx.eta +1 -0
- package/cli/project-templates/plugin/shared-base/src/dev-release.tsx.eta +1 -0
- package/cli/project-templates/plugin/shared-base/src/dev.tsx.eta +1 -1
- package/cli/project-templates/shared/partials/plugin-dev-host-app-advanced.eta +93 -0
- package/cli/project-templates/shared/partials/plugin-dev-host-app-minimal.eta +54 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-advanced.eta +3 -2
- package/cli/project-templates/shared/partials/plugin-dev-tsx-debug.eta +18 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-release.eta +33 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-runtime-helpers.eta +8 -8
- package/cli/project-templates/shared/partials/plugin-index-ts.eta +0 -1
- package/cli/project-templates/shared/partials/plugin-vite-dev-host.eta +9 -5
- package/cli/project-templates/shared/partials/plugin-vite-plugin-build.eta +7 -5
- package/cli/project-templates/shared/partials/plugin-vite-release-html.eta +12 -0
- package/cli/project-templates/shared/partials/plugin-vite-sandbox-build.eta +7 -5
- package/cli/project-templates/shared/partials/plugin-webpack-dev-host-legacy.eta +12 -5
- package/cli/project-templates/shared/partials/plugin-webpack-dev-host-modern.eta +13 -6
- package/cli/project-templates/shared/partials/plugin-webpack-release-html.eta +12 -0
- package/cli/project-templates/shared/partials/plugin-webpack-sandbox-build.eta +13 -3
- package/cli/project-templates/shared/partials/plugin-wp-legacy-module.eta +28 -10
- package/cli/project-templates/shared/partials/plugin-wp-legacy-umd.eta +28 -10
- package/cli/project-templates/shared/partials/plugin-wp-modern-module.eta +9 -4
- package/cli/project-templates/shared/partials/plugin-wp-modern-umd.eta +9 -4
- package/cli/project-templates/shared/partials/stand-dev-host-vite-memory.eta +3 -3
- package/cli/project-templates/shared/partials/stand-dev-host-vite-subpath.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-host-vite-umd.eta +5 -5
- package/cli/project-templates/shared/partials/stand-dev-host-vite.eta +3 -3
- package/cli/project-templates/shared/partials/stand-dev-host-webpack-subpath.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-host-webpack-umd.eta +9 -3
- package/cli/project-templates/shared/partials/stand-dev-host-webpack.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-storage-middleware.eta +370 -0
- package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.ts +80 -0
- package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.ts.eta +1 -0
- package/cli/project-templates/shared/stand-webpack-base/config/lib/{createWebpackStandConfig.cjs → createWebpackStandConfig.ts} +31 -19
- package/cli/project-templates/{stand/advanced/umd/vite/config/lib/umdServeMiddleware.mjs → shared/stand-webpack-base/config/lib/umdServeMiddleware.ts} +19 -11
- package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.ts.eta +1 -0
- package/cli/project-templates/stand/advanced/memory-usage/vite/config/lib/{createMemoryUsageStandConfig.mjs → createMemoryUsageStandConfig.ts} +25 -20
- package/cli/project-templates/stand/advanced/umd/vite/config/lib/umdServeMiddleware.ts +68 -0
- package/cli/project-templates/stand/react-adapter/webpack/README.md.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/config/dev-host.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/package.json.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/public/index.html.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/editorConfig.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/email.html.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/getAuthToken.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/oauthCredentials.ts +9 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/storageProvider.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/index.tsx.eta +1 -0
- package/cli/scripts/cli-matrix-smoke.ts +19 -10
- package/cli/scripts/verify-global-cli.ts +1 -1
- package/cli/scripts/vite-plugin-version-matrix.ts +299 -0
- package/cli/tsconfig.json +2 -2
- package/emailmaker-core.ed344c04.js +1 -0
- package/emailmaker-esm.js +788 -153
- package/emailmaker.d.ts +32 -0
- package/emailmaker.js +4 -4
- package/iframe/js/amp.BGJMqoms.js +1 -1
- package/iframe/js/chunk.oX6nCJbK.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.BSaCN7eK.js +1 -1
- package/iframe/js/sanitize-html.Dy7Uwo8P.js +1 -1
- package/images/integrations/activecampaign.svg +4 -0
- package/images/integrations/bento.svg +9 -0
- package/images/integrations/brevo.svg +7 -0
- package/images/integrations/campaign_monitor.svg +10 -0
- package/images/integrations/constant_contact.svg +24 -0
- package/images/integrations/dotdigital.svg +144 -0
- package/images/integrations/getresponse.svg +23 -0
- package/images/integrations/hubspot.svg +3 -0
- package/images/integrations/klaviyo.svg +10 -0
- package/images/integrations/mailchimp.svg +9 -0
- package/images/integrations/salesforce.svg +20 -0
- package/js/browser-image-compression.js +9 -0
- package/package.json +2 -5
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/icons/index.js +1 -1
- package/runtime/@ant-design/pro-layout/index.js +1 -1
- package/runtime/README.md +13 -13
- package/runtime/antd/index.js +1 -1
- package/runtime/app-core/index.js +1 -2
- package/runtime/classnames/index.js +1 -1
- package/runtime/core/index.js +6 -6
- package/runtime/dayjs/index.js +1 -1
- package/runtime/di/index.js +1 -2
- package/runtime/disposable/index.js +1 -2
- package/runtime/errors-runtime/index.js +1 -2
- package/runtime/guid/index.js +1 -2
- package/runtime/index.js +2 -4
- package/runtime/package.json +2 -3
- package/runtime/prop-types/index.js +1 -1
- package/runtime/react/index.js +1 -1
- package/runtime/react/jsx-dev-runtime/index.js +1 -1
- package/runtime/react/jsx-runtime/index.js +1 -1
- package/runtime/react-dom/client/index.js +1 -1
- package/runtime/react-dom/index.js +1 -1
- package/runtime/react-router-dom/index.js +1 -1
- package/runtime/uuid/index.js +1 -1
- package/static/amd/{8fc2a596.js → 19aeb269.js} +88 -88
- package/static/core/192ec827.js +1 -0
- package/static/core/22c1de2e2.js +1 -0
- package/static/core/24faedf0.js +1 -0
- package/static/core/29231645.js +1 -0
- package/static/core/2a3177fc2.js +1 -0
- package/static/core/346aabd2.js +3 -0
- package/static/core/3b800ed6.js +1 -0
- package/static/core/3e840e90.js +1 -0
- package/static/core/40cc9fd7.js +1 -0
- package/static/core/421bdec22.js +1 -0
- package/static/core/50ff48bc.js +4 -0
- package/static/core/5282795d2.js +6 -0
- package/static/core/555e2e2f2.js +903 -0
- package/static/core/563a283d.js +1 -0
- package/static/core/5d47e095.js +47 -0
- package/static/core/5f574386.js +1 -0
- package/static/core/67a41193.js +1 -0
- package/static/core/698dace4.js +7 -0
- package/static/core/6b648e2d.js +1 -0
- package/static/core/7629adfd.js +1 -0
- package/static/core/7717f2932.js +3 -0
- package/static/core/776cb34a.js +1 -0
- package/static/core/78a1e31e.js +1 -0
- package/static/core/7d56d643.js +1 -0
- package/static/core/841752212.js +40 -0
- package/static/core/8477e97e.js +1 -0
- package/static/core/8756d562.js +1 -0
- package/static/core/91d328d8.js +1 -0
- package/static/core/9270dbb6.js +6 -0
- package/static/core/96371334.js +566 -0
- package/static/core/9b9ddaef2.js +168 -0
- package/static/core/af1da4b4.js +1 -0
- package/static/core/b5096b152.js +471 -0
- package/static/core/bde6775a.js +1 -0
- package/static/core/bf1b888c.js +4 -0
- package/static/core/c3747df72.js +598 -0
- package/static/core/cec8d739.js +11 -0
- package/static/core/cfac3d32.js +1 -0
- package/static/core/d21c95cf2.js +1 -0
- package/static/core/dbd9ca52.js +1 -0
- package/static/core/dc590181.js +1 -0
- package/static/core/e0039d55.js +1 -0
- package/static/core/e4071c1a.js +4 -0
- package/static/core/ef87b75c.js +41 -0
- package/static/core/f47701f32.js +20 -0
- package/static/core/f83d7ac42.js +3 -0
- package/static/core/fcc67e6b.js +1 -0
- package/static/core/fd40d85c.js +1 -0
- package/static/core/fe638847.js +1 -0
- package/static/esm/{e8401d17.js → 203c9644.js} +3 -3
- package/static/esm/4b679053.js +27 -0
- package/static/esm/{b273a6c2.js → f31a26c6.js} +1 -1
- package/static/runtime/disposable-CD74igiJ.js +1 -0
- package/static/runtime/guid-C0wuVR8v.js +1 -0
- package/vite/index.d.ts +17 -6
- package/vite/index.js +315 -270
- package/vite/pluginDev/index.d.ts +10 -19
- package/vite/pluginDev/index.js +251 -204
- package/webpack/index.d.ts +24 -5
- package/webpack/index.js +168 -144
- package/webpack/pluginDev/index.d.ts +21 -22
- package/webpack/pluginDev/index.js +242 -177
- package/cli/dist/lib/template-engine/buildStandIndexHtml.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/buildStandIndexHtml.test.js +0 -89
- package/cli/dist/lib/template-engine/emitEtaTree.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/emitEtaTree.test.js +0 -34
- package/cli/dist/lib/template-engine/pluginEtaParity.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/pluginEtaParity.test.js +0 -105
- package/cli/dist/lib/template-engine/resolveVariantDir.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/resolveVariantDir.test.js +0 -52
- package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.js +0 -67
- package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.js +0 -83
- package/cli/dist/lib/template-engine/storageProviderEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/storageProviderEta.test.js +0 -26
- package/cli/project-templates/plugin/shared-base/scripts/build-types.cjs +0 -8
- package/cli/project-templates/plugin/shared-base/scripts/clean.cjs +0 -6
- package/cli/project-templates/plugin/shared-base/scripts/dev-runner.cjs +0 -48
- package/cli/project-templates/plugin/shared-base/scripts/release-runner.cjs +0 -63
- package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.mjs +0 -80
- package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.cjs +0 -235
- package/cli/project-templates/shared/stand-webpack-base/config/lib/umdServeMiddleware.cjs +0 -38
- package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.cjs +0 -235
- package/emailmaker-core.80d62b88.js +0 -569
- package/runtime/_core/app-core/index.js +0 -1
- package/runtime/_core/chunks/app-core-DphKKh8f.js +0 -1
- package/runtime/_core/chunks/chunk-oqAt0Dze.js +0 -1
- package/runtime/_core/chunks/di-BHUzE57z.js +0 -1
- package/runtime/_core/chunks/disposable-PhM3rJkj.js +0 -1
- package/runtime/_core/chunks/errors-runtime-VjCOXaQX.js +0 -1
- package/runtime/_core/chunks/guid-D2-FTZQG.js +0 -1
- package/runtime/_core/di/index.js +0 -1
- package/runtime/_core/disposable/index.js +0 -1
- package/runtime/_core/errors-runtime/index.js +0 -1
- package/runtime/_core/guid/index.js +0 -1
- package/runtime/_core/index.js +0 -1
- package/shared/hostBootstrap.js +0 -47
- package/shared/pluginDevOptions.js +0 -31
- package/shared/runtimeManifest.js +0 -72
- package/shared/stringCase.js +0 -16
- package/static/core/2360f32a.js +0 -3
- package/static/core/2687db56.js +0 -3
- package/static/core/2b250af6.js +0 -1261
- package/static/core/3469930c.js +0 -302
- package/static/core/34ce9042.js +0 -201
- package/static/core/4091ba5b.js +0 -25
- package/static/core/41ce3a6a.js +0 -173
- package/static/core/4ac4908c.js +0 -2213
- package/static/core/519096c1.js +0 -2597
- package/static/core/5fa1772b.js +0 -116550
- package/static/core/61312909.js +0 -3
- package/static/core/62a98c07.js +0 -75301
- package/static/core/6309c0f2.js +0 -3
- package/static/core/68d9f440.js +0 -3
- package/static/core/73b645ab.js +0 -2
- package/static/core/81019351.js +0 -280
- package/static/core/835b37ef.js +0 -591
- package/static/core/91242fb3.js +0 -3
- package/static/core/972b15b0.js +0 -92399
- package/static/core/974ef468.js +0 -493
- package/static/core/a17614422.js +0 -38078
- package/static/core/a2fa7b5b.js +0 -4232
- package/static/core/a513adfd.js +0 -89857
- package/static/core/a7c73a9b.js +0 -3813
- package/static/core/b64c7c90.js +0 -228
- package/static/core/cdc9ba92.js +0 -4711
- package/static/core/d1db685d.js +0 -2193
- package/static/core/d661febc.js +0 -3
- package/static/core/d6d2d2d0.js +0 -23
- package/static/core/df1a1225.js +0 -607
- package/static/core/e5bff179.js +0 -1302
- package/static/core/e5d602f5.js +0 -2
- package/static/core/eb029366.js +0 -1532
- package/static/core/f46c035a.js +0 -2
- package/static/core/f8b9d89a.js +0 -461
- package/static/core/fd897ad7.js +0 -3
- package/static/core/fdd890c7.js +0 -6168
- package/static/esm/29eb18ff.js +0 -164
- package/vite/mime-types.js +0 -179
- package/vite/utils.js +0 -44
- /package/cli/project-templates/plugin/bundler-vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-vite/config/{plugin-build.mjs.eta → plugin-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-vite/config/{sandbox-build.mjs.eta → sandbox-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{plugin-build.cjs.eta → plugin-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{sandbox-build.cjs.eta → sandbox-build.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/memory-usage/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/shadow-dom/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/shadow-dom/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/subpath/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/subpath/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/umd/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/umd/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/closed-loop/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/closed-loop/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/oauth/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/oauth/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/react-adapter/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/iframe/{iframe-eblock.80d62b88.html → iframe-eblock.ed344c04.html} +0 -0
- /package/iframe/{iframe.80d62b88.html → iframe.ed344c04.html} +0 -0
- /package/{runtime/chunks → static/runtime}/DownloadOutlined-a2ZUz7zB.js +0 -0
- /package/{runtime/chunks → static/runtime}/chunk-D-iEO58U.js +0 -0
- /package/{runtime/chunks → static/runtime}/classnames-DBEldvch.js +0 -0
- /package/{runtime/chunks → static/runtime}/client-5XqXGmAI.js +0 -0
- /package/{runtime/chunks → static/runtime}/dayjs.min-CO3mzOeV.js +0 -0
- /package/{runtime/_core/chunks/defineProperty-BGJFuFMq.js → static/runtime/defineProperty-CGNmw-jw.js} +0 -0
- /package/{runtime/chunks → static/runtime}/dist-Cns8cA2n.js +0 -0
- /package/{runtime/chunks → static/runtime}/dist-Ct0xRt3Y.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-0FFT3fCz.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-BwJ3eGbx.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-D8EsVtRL.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-Da4O25Kw.js +0 -0
- /package/{runtime/chunks → static/runtime}/jsx-dev-runtime-V4_MuHNS.js +0 -0
- /package/{runtime/chunks → static/runtime}/jsx-runtime-DBeCoE0b.js +0 -0
- /package/{runtime/chunks → static/runtime}/objectWithoutProperties-Bk0EDksJ.js +0 -0
- /package/{runtime/chunks → static/runtime}/prop-types-DxD5wgQ0.js +0 -0
- /package/{runtime/chunks → static/runtime}/react-TEeeBWTl.js +0 -0
- /package/{runtime/chunks → static/runtime}/react-dom-BKKa1g6U.js +0 -0
|
@@ -1,182 +1,247 @@
|
|
|
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 fs = require("fs");
|
|
24
|
+
fs = __toESM(fs);
|
|
25
|
+
let path = require("path");
|
|
26
|
+
path = __toESM(path);
|
|
27
|
+
let module$1 = require("module");
|
|
28
|
+
//#region src/shared/runtimeManifest.ts
|
|
29
|
+
var MANIFEST_FILE = "plugin-dev-manifest.json";
|
|
30
|
+
function readJson(filePath) {
|
|
31
|
+
return JSON.parse(fs.default.readFileSync(filePath, "utf-8"));
|
|
32
|
+
}
|
|
33
|
+
function tryResolveFromPackage(_require, request) {
|
|
34
|
+
try {
|
|
35
|
+
return _require.resolve(request);
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function readRuntimeManifest(runtimePackage, pluginName) {
|
|
41
|
+
const _require = (0, module$1.createRequire)(path.default.resolve(process.cwd(), "package.json"));
|
|
42
|
+
const packageJsonPath = _require.resolve(`${runtimePackage}/package.json`);
|
|
43
|
+
const packageDir = path.default.dirname(packageJsonPath);
|
|
44
|
+
const manifestPath = tryResolveFromPackage(_require, `${runtimePackage}/plugin-dev-manifest.json`) || path.default.join(packageDir, "plugin-dev-manifest.json");
|
|
45
|
+
if (fs.default.existsSync(manifestPath)) {
|
|
46
|
+
const manifest = readJson(manifestPath);
|
|
47
|
+
console.log(`[${pluginName}] runtime manifest at ${manifestPath}`);
|
|
48
|
+
return manifest;
|
|
49
|
+
}
|
|
50
|
+
const runtimePkg = readJson(packageJsonPath);
|
|
51
|
+
if (!runtimePkg.runtimeModules || typeof runtimePkg.runtimeModules !== "object") throw new Error(`No "${MANIFEST_FILE}" and no legacy runtime metadata in ${runtimePackage}/package.json`);
|
|
52
|
+
console.warn(`[${pluginName}] ${MANIFEST_FILE} not found, falling back to legacy package.json metadata`);
|
|
53
|
+
return {
|
|
54
|
+
runtimeModules: runtimePkg.runtimeModules,
|
|
55
|
+
runtimeExports: runtimePkg.runtimeExports || {},
|
|
56
|
+
runtimeCoreModules: Array.isArray(runtimePkg.runtimeCoreModules) ? runtimePkg.runtimeCoreModules : [],
|
|
57
|
+
runtimeCoreExport: runtimePkg.runtimeCoreExport || "Core"
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function createRuntimeEntryList(runtimeManifest) {
|
|
61
|
+
const runtimeModules = runtimeManifest.runtimeModules || {};
|
|
62
|
+
const runtimeExports = runtimeManifest.runtimeExports || {};
|
|
63
|
+
const runtimeCoreModules = Array.isArray(runtimeManifest.runtimeCoreModules) ? runtimeManifest.runtimeCoreModules : [];
|
|
64
|
+
return {
|
|
65
|
+
runtimeModules,
|
|
66
|
+
runtimeExports,
|
|
67
|
+
runtimeCoreModules,
|
|
68
|
+
runtimeCoreExport: runtimeManifest.runtimeCoreExport || "Core",
|
|
69
|
+
runtimeEntries: Object.entries(runtimeModules).map(([runtimeSubpath, originalName]) => ({
|
|
70
|
+
runtimeSubpath,
|
|
71
|
+
originalName,
|
|
72
|
+
exportName: runtimeExports[runtimeSubpath]
|
|
73
|
+
})),
|
|
74
|
+
runtimeCoreModuleSet: new Set(runtimeCoreModules)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/shared/pluginDevOptions.ts
|
|
1
79
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const { readRuntimeManifest, createRuntimeEntryList } = require('../../shared/runtimeManifest');
|
|
25
|
-
const { resolvePluginDevOptions } = require('../../shared/pluginDevOptions');
|
|
26
|
-
|
|
27
|
-
// apply-version injects @emailmaker/runtime, __emailmaker__, @emailmaker/emailmaker, etc.
|
|
28
|
-
// applyBundlerBuildDefaultReplacements then turns '$$BUILD_DEFAULT_*$$' into literals.
|
|
29
|
-
const PACKAGE_PATH = "@emailmaker/emailmaker";
|
|
30
|
-
const APP_NAME = "emailmaker";
|
|
31
|
-
const RUNTIME_PACKAGE = '@emailmaker/runtime';
|
|
32
|
-
const NAMESPACE = '__emailmaker__';
|
|
33
|
-
|
|
34
|
-
const PLUGIN_NAME = `${APP_NAME}-pluginDev-webpack`;
|
|
35
|
-
|
|
80
|
+
* Normalizes shared `pluginDev` options for Vite and Webpack adapters.
|
|
81
|
+
*/
|
|
82
|
+
function resolvePluginDevOptions(options) {
|
|
83
|
+
let o = {};
|
|
84
|
+
if (options && options !== true) o = options;
|
|
85
|
+
const externals = o.externals === "global" ? "globals" : o.externals;
|
|
86
|
+
const defaultAlias = externals === void 0 || externals === "esm" || externals === false;
|
|
87
|
+
return {
|
|
88
|
+
externals: externals !== void 0 ? externals : "esm",
|
|
89
|
+
alias: o.alias !== void 0 ? o.alias : defaultAlias
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/shared/branding.ts
|
|
94
|
+
var BUNDLER_DEFAULT_APP_NAME = "emailmaker";
|
|
95
|
+
var BUNDLER_RUNTIME_PACKAGE = "@emailmaker/emailmaker/runtime";
|
|
96
|
+
var BUNDLER_NAMESPACE = `__${BUNDLER_DEFAULT_APP_NAME}__`;
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/webpack/pluginDev/index.ts
|
|
99
|
+
var PLUGIN_NAME = `${BUNDLER_DEFAULT_APP_NAME}-pluginDev-webpack`;
|
|
36
100
|
function printModeHints(opts) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (opts.externals === 'async-globals') {
|
|
42
|
-
console.warn(`[${PLUGIN_NAME}] async-globals is an advanced Webpack compatibility target. Prefer the npm package target unless the host explicitly requires async globals.`);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (opts.alias && (opts.externals === 'globals' || opts.externals === 'async-globals')) {
|
|
46
|
-
console.warn(`[${PLUGIN_NAME}] alias=true with ${opts.externals} is an advanced setup and is usually unnecessary.`);
|
|
47
|
-
}
|
|
101
|
+
if (opts.externals === "globals") console.warn(`[${PLUGIN_NAME}] globals mode is intended for the browser/script target. Make sure the host loads runtime globals before the plugin bundle.`);
|
|
102
|
+
if (opts.externals === "async-globals") console.warn(`[${PLUGIN_NAME}] async-globals is an advanced Webpack compatibility target. Prefer the npm package target unless the host explicitly requires async globals.`);
|
|
103
|
+
if (opts.alias && (opts.externals === "globals" || opts.externals === "async-globals")) console.warn(`[${PLUGIN_NAME}] alias=true with ${opts.externals} is an advanced setup and is usually unnecessary.`);
|
|
48
104
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (!compiler.options.resolve.alias) compiler.options.resolve.alias = {};
|
|
102
|
-
|
|
103
|
-
const alias = compiler.options.resolve.alias;
|
|
104
|
-
|
|
105
|
-
for (const originalName of allOriginalNames) {
|
|
106
|
-
if (!opts.alias && !runtimeCoreModuleSet.has(originalName)) {
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
// Webpack exact match: 'react$' prevents matching 'react/jsx-runtime'
|
|
110
|
-
if (originalName.startsWith('@')) {
|
|
111
|
-
alias[originalName] = `${RUNTIME_PACKAGE}/${originalName}`;
|
|
112
|
-
} else if (originalName.includes('/')) {
|
|
113
|
-
alias[originalName] = `${RUNTIME_PACKAGE}/${originalName}`;
|
|
114
|
-
} else {
|
|
115
|
-
alias[`${originalName}$`] = `${RUNTIME_PACKAGE}/${originalName}`;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
console.log(`[${PLUGIN_NAME}] ${allOriginalNames.length} resolve aliases`);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// --- externals ---
|
|
123
|
-
if (!opts.externals) return;
|
|
124
|
-
|
|
125
|
-
const externals = {};
|
|
126
|
-
const type = opts.externals;
|
|
127
|
-
const coreRequest = `${RUNTIME_PACKAGE}/core`;
|
|
128
|
-
|
|
129
|
-
if (runtimeCoreModules.length > 0) {
|
|
130
|
-
switch (type) {
|
|
131
|
-
case 'esm':
|
|
132
|
-
externals[coreRequest] = `module ${coreRequest}`;
|
|
133
|
-
break;
|
|
134
|
-
case 'globals':
|
|
135
|
-
externals[coreRequest] = `var ${NAMESPACE}.modules.${runtimeCoreExport}`;
|
|
136
|
-
break;
|
|
137
|
-
case 'async-globals':
|
|
138
|
-
externals[coreRequest] = [`promise ${NAMESPACE}.modules`, runtimeCoreExport];
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
for (const { runtimeSubpath, originalName, exportName } of runtimeEntries) {
|
|
144
|
-
if (runtimeCoreModuleSet.has(originalName)) {
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
const runtimeRequest = `${RUNTIME_PACKAGE}/${runtimeSubpath}`;
|
|
148
|
-
switch (type) {
|
|
149
|
-
case 'esm':
|
|
150
|
-
externals[originalName] = `module ${runtimeRequest}`;
|
|
151
|
-
externals[runtimeRequest] = `module ${runtimeRequest}`;
|
|
152
|
-
break;
|
|
153
|
-
case 'globals':
|
|
154
|
-
if (exportName) {
|
|
155
|
-
externals[originalName] = `var ${NAMESPACE}.modules.${exportName}`;
|
|
156
|
-
externals[runtimeRequest] = `var ${NAMESPACE}.modules.${exportName}`;
|
|
157
|
-
}
|
|
158
|
-
break;
|
|
159
|
-
case 'async-globals':
|
|
160
|
-
if (exportName) {
|
|
161
|
-
externals[originalName] = [`promise ${NAMESPACE}.modules`, exportName];
|
|
162
|
-
externals[runtimeRequest] = [`promise ${NAMESPACE}.modules`, exportName];
|
|
163
|
-
}
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Merge with existing externals
|
|
169
|
-
const existing = compiler.options.externals;
|
|
170
|
-
if (typeof existing === 'object' && !Array.isArray(existing) && !(existing instanceof RegExp)) {
|
|
171
|
-
compiler.options.externals = { ...existing, ...externals };
|
|
172
|
-
} else if (Array.isArray(existing)) {
|
|
173
|
-
compiler.options.externals = [...existing, externals];
|
|
174
|
-
} else {
|
|
175
|
-
compiler.options.externals = externals;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
console.log(`[${PLUGIN_NAME}] ${Object.keys(externals).length} ${type} externals`);
|
|
179
|
-
}
|
|
105
|
+
function isNestedRuntimeRequest(request, runtimeRequest) {
|
|
106
|
+
return request === runtimeRequest || request.startsWith(`${runtimeRequest}/`) || request.startsWith(`${runtimeRequest}.`);
|
|
107
|
+
}
|
|
108
|
+
function getCoreExternalValue(type, coreExport) {
|
|
109
|
+
switch (type) {
|
|
110
|
+
case "esm": return `${BUNDLER_RUNTIME_PACKAGE}/core`;
|
|
111
|
+
case "globals": return `var ${BUNDLER_NAMESPACE}.modules.${coreExport}`;
|
|
112
|
+
case "async-globals": return [`promise ${BUNDLER_NAMESPACE}.modules`, coreExport];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function getRuntimeExternalValue(type, entry, request, runtimeCoreExport) {
|
|
116
|
+
if (entry.isCore) {
|
|
117
|
+
if (request === entry.originalName) return type === "esm" ? entry.runtimeRequest : getCoreExternalValue(type, runtimeCoreExport);
|
|
118
|
+
if (isNestedRuntimeRequest(request, entry.runtimeRequest)) return type === "esm" ? request : getCoreExternalValue(type, runtimeCoreExport);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
switch (type) {
|
|
122
|
+
case "esm":
|
|
123
|
+
if (request === entry.originalName) return entry.runtimeRequest;
|
|
124
|
+
if (isNestedRuntimeRequest(request, entry.runtimeRequest)) return request;
|
|
125
|
+
return;
|
|
126
|
+
case "globals":
|
|
127
|
+
if (!entry.exportName) return;
|
|
128
|
+
if (request === entry.originalName || isNestedRuntimeRequest(request, entry.runtimeRequest)) return `var ${BUNDLER_NAMESPACE}.modules.${entry.exportName}`;
|
|
129
|
+
return;
|
|
130
|
+
case "async-globals":
|
|
131
|
+
if (!entry.exportName) return;
|
|
132
|
+
if (request === entry.originalName || isNestedRuntimeRequest(request, entry.runtimeRequest)) return [`promise ${BUNDLER_NAMESPACE}.modules`, entry.exportName];
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function createRuntimeExternalResolver(type, runtimeEntries, runtimeCoreExport) {
|
|
137
|
+
const coreRequest = `${BUNDLER_RUNTIME_PACKAGE}/core`;
|
|
138
|
+
return function runtimeExternalResolver(data, callback) {
|
|
139
|
+
const request = data.request;
|
|
140
|
+
if (!request) {
|
|
141
|
+
callback();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (request === coreRequest || request.startsWith(`${coreRequest}/`) || request.startsWith(`${coreRequest}.`)) {
|
|
145
|
+
callback(null, type === "esm" ? request : getCoreExternalValue(type, runtimeCoreExport));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
for (const entry of runtimeEntries) {
|
|
149
|
+
const mapped = getRuntimeExternalValue(type, entry, request, runtimeCoreExport);
|
|
150
|
+
if (mapped !== void 0) {
|
|
151
|
+
callback(null, mapped);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
callback();
|
|
156
|
+
};
|
|
180
157
|
}
|
|
181
|
-
|
|
158
|
+
var PluginDev = class {
|
|
159
|
+
constructor(options) {
|
|
160
|
+
this._opts = resolvePluginDevOptions(options);
|
|
161
|
+
}
|
|
162
|
+
apply(compiler) {
|
|
163
|
+
const opts = this._opts;
|
|
164
|
+
let runtimeModules;
|
|
165
|
+
let runtimeCoreModules;
|
|
166
|
+
let runtimeCoreExport;
|
|
167
|
+
let runtimeEntries;
|
|
168
|
+
let runtimeCoreModuleSet;
|
|
169
|
+
try {
|
|
170
|
+
({runtimeModules, runtimeCoreModules, runtimeCoreExport, runtimeEntries, runtimeCoreModuleSet} = createRuntimeEntryList(readRuntimeManifest(BUNDLER_RUNTIME_PACKAGE, PLUGIN_NAME)));
|
|
171
|
+
} catch (e) {
|
|
172
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
173
|
+
throw new Error(`[${PLUGIN_NAME}] ${BUNDLER_RUNTIME_PACKAGE} not found.\nMake sure it is installed: npm install ${BUNDLER_RUNTIME_PACKAGE}\n` + msg);
|
|
174
|
+
}
|
|
175
|
+
const allOriginalNames = runtimeEntries.map(({ originalName }) => originalName);
|
|
176
|
+
console.log(`[${PLUGIN_NAME}] externals: ${opts.externals || "disabled"}, alias: ${opts.alias}`);
|
|
177
|
+
printModeHints(opts);
|
|
178
|
+
if (opts.alias || runtimeCoreModules.length > 0) {
|
|
179
|
+
if (!compiler.options.resolve) compiler.options.resolve = {};
|
|
180
|
+
if (!compiler.options.resolve.alias) compiler.options.resolve.alias = {};
|
|
181
|
+
const alias = compiler.options.resolve.alias;
|
|
182
|
+
for (const originalName of allOriginalNames) {
|
|
183
|
+
if (!opts.alias && !runtimeCoreModuleSet.has(originalName)) continue;
|
|
184
|
+
if (originalName.startsWith("@")) alias[originalName] = `${BUNDLER_RUNTIME_PACKAGE}/${originalName}`;
|
|
185
|
+
else if (originalName.includes("/")) alias[originalName] = `${BUNDLER_RUNTIME_PACKAGE}/${originalName}`;
|
|
186
|
+
else alias[`${originalName}$`] = `${BUNDLER_RUNTIME_PACKAGE}/${originalName}`;
|
|
187
|
+
}
|
|
188
|
+
console.log(`[${PLUGIN_NAME}] ${allOriginalNames.length} resolve aliases`);
|
|
189
|
+
}
|
|
190
|
+
if (!opts.externals) return;
|
|
191
|
+
const externals = {};
|
|
192
|
+
const type = opts.externals;
|
|
193
|
+
const coreRequest = `${BUNDLER_RUNTIME_PACKAGE}/core`;
|
|
194
|
+
const runtimeExternalEntries = runtimeEntries.map(({ runtimeSubpath, originalName, exportName }) => ({
|
|
195
|
+
originalName,
|
|
196
|
+
runtimeRequest: `${BUNDLER_RUNTIME_PACKAGE}/${runtimeSubpath}`,
|
|
197
|
+
exportName,
|
|
198
|
+
isCore: runtimeCoreModuleSet.has(originalName)
|
|
199
|
+
}));
|
|
200
|
+
if (runtimeCoreModules.length > 0) switch (type) {
|
|
201
|
+
case "esm":
|
|
202
|
+
externals[coreRequest] = coreRequest;
|
|
203
|
+
break;
|
|
204
|
+
case "globals":
|
|
205
|
+
externals[coreRequest] = `var ${BUNDLER_NAMESPACE}.modules.${runtimeCoreExport}`;
|
|
206
|
+
break;
|
|
207
|
+
case "async-globals":
|
|
208
|
+
externals[coreRequest] = [`promise ${BUNDLER_NAMESPACE}.modules`, runtimeCoreExport];
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
for (const { originalName, runtimeRequest, exportName, isCore } of runtimeExternalEntries) {
|
|
212
|
+
if (isCore) continue;
|
|
213
|
+
switch (type) {
|
|
214
|
+
case "esm":
|
|
215
|
+
externals[originalName] = runtimeRequest;
|
|
216
|
+
externals[runtimeRequest] = runtimeRequest;
|
|
217
|
+
break;
|
|
218
|
+
case "globals":
|
|
219
|
+
if (exportName) {
|
|
220
|
+
externals[originalName] = `var ${BUNDLER_NAMESPACE}.modules.${exportName}`;
|
|
221
|
+
externals[runtimeRequest] = `var ${BUNDLER_NAMESPACE}.modules.${exportName}`;
|
|
222
|
+
}
|
|
223
|
+
break;
|
|
224
|
+
case "async-globals":
|
|
225
|
+
if (exportName) {
|
|
226
|
+
externals[originalName] = [`promise ${BUNDLER_NAMESPACE}.modules`, exportName];
|
|
227
|
+
externals[runtimeRequest] = [`promise ${BUNDLER_NAMESPACE}.modules`, exportName];
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const existing = compiler.options.externals;
|
|
233
|
+
if (typeof existing === "object" && !Array.isArray(existing) && !(existing instanceof RegExp)) compiler.options.externals = [createRuntimeExternalResolver(type, runtimeExternalEntries, runtimeCoreExport), {
|
|
234
|
+
...existing,
|
|
235
|
+
...externals
|
|
236
|
+
}];
|
|
237
|
+
else if (Array.isArray(existing)) compiler.options.externals = [
|
|
238
|
+
createRuntimeExternalResolver(type, runtimeExternalEntries, runtimeCoreExport),
|
|
239
|
+
...existing,
|
|
240
|
+
externals
|
|
241
|
+
];
|
|
242
|
+
else compiler.options.externals = [createRuntimeExternalResolver(type, runtimeExternalEntries, runtimeCoreExport), externals];
|
|
243
|
+
console.log(`[${PLUGIN_NAME}] ${Object.keys(externals).length} ${type} externals`);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
182
247
|
module.exports = PluginDev;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_test_1 = __importDefault(require("node:test"));
|
|
7
|
-
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
8
|
-
const generateFiles_1 = require("./generateFiles");
|
|
9
|
-
const paths_1 = require("../templates/shared/paths");
|
|
10
|
-
function mockPackageConfig(appName = 'verifyapp') {
|
|
11
|
-
return {
|
|
12
|
-
appName,
|
|
13
|
-
packageName: '@scope/editor',
|
|
14
|
-
runtimePackageName: '@scope/runtime',
|
|
15
|
-
uiLanguage: 'en',
|
|
16
|
-
openApiBaseUrl: 'http://localhost:3000',
|
|
17
|
-
openApiOrigin: 'http://localhost:3000',
|
|
18
|
-
version: '1.0.0',
|
|
19
|
-
runtimeVersion: '2.0.0',
|
|
20
|
-
versions: {
|
|
21
|
-
typescript: '5.0.0',
|
|
22
|
-
vite: '5.0.0',
|
|
23
|
-
webpack: '5.0.0',
|
|
24
|
-
webpackCli: '5.0.0',
|
|
25
|
-
webpackDevServer: '5.0.0',
|
|
26
|
-
tsLoader: '9.0.0',
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function baseStandOptions(overrides = {}) {
|
|
31
|
-
return {
|
|
32
|
-
kind: 'demo-stand',
|
|
33
|
-
standMode: 'oauth',
|
|
34
|
-
bundler: 'vite',
|
|
35
|
-
packageConfig: mockPackageConfig(),
|
|
36
|
-
...overrides,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
(0, node_test_1.default)('stand oauth vite index.html is generated from Eta', () => {
|
|
40
|
-
const options = baseStandOptions();
|
|
41
|
-
const { files } = (0, generateFiles_1.generateFiles)(options);
|
|
42
|
-
strict_1.default.match(files['index.html'], /<title>Verifyapp debug host<\/title>/);
|
|
43
|
-
strict_1.default.match(files['index.html'], /<script type="module" src="\/src\/index\.tsx"><\/script>/);
|
|
44
|
-
});
|
|
45
|
-
(0, node_test_1.default)('stand-closed webpack public/index.html is generated from Eta', () => {
|
|
46
|
-
const options = baseStandOptions({
|
|
47
|
-
kind: 'stand-closed',
|
|
48
|
-
standMode: undefined,
|
|
49
|
-
bundler: 'webpack',
|
|
50
|
-
packageConfig: mockPackageConfig('closedapp'),
|
|
51
|
-
});
|
|
52
|
-
const { files } = (0, generateFiles_1.generateFiles)(options);
|
|
53
|
-
strict_1.default.match(files['public/index.html'], /<title>Closedapp debug host<\/title>/);
|
|
54
|
-
strict_1.default.match(files['public/index.html'], /<script src="\/dev\.js"><\/script>/);
|
|
55
|
-
});
|
|
56
|
-
(0, node_test_1.default)('stand advanced umd vite index.html includes runtime bootstrap', () => {
|
|
57
|
-
const options = baseStandOptions({
|
|
58
|
-
standMode: 'advanced',
|
|
59
|
-
advancedProfile: 'umd',
|
|
60
|
-
packageConfig: mockPackageConfig('umdapp'),
|
|
61
|
-
});
|
|
62
|
-
const { files } = (0, generateFiles_1.generateFiles)(options);
|
|
63
|
-
strict_1.default.match(files['index.html'], /window\["__umdapp__"\] = window\["__umdapp__"\] \|\| \{\};/);
|
|
64
|
-
strict_1.default.match(files['index.html'], /<script src="\/umdapp\/umdapp\.js"><\/script>/);
|
|
65
|
-
});
|
|
66
|
-
(0, node_test_1.default)('stand advanced umd webpack public/index.html includes runtime bootstrap', () => {
|
|
67
|
-
const options = baseStandOptions({
|
|
68
|
-
bundler: 'webpack',
|
|
69
|
-
standMode: 'advanced',
|
|
70
|
-
advancedProfile: 'umd',
|
|
71
|
-
packageConfig: mockPackageConfig('umdapp'),
|
|
72
|
-
});
|
|
73
|
-
const { files } = (0, generateFiles_1.generateFiles)(options);
|
|
74
|
-
strict_1.default.match(files['public/index.html'], /window\["__umdapp__"\] = window\["__umdapp__"\] \|\| \{\};/);
|
|
75
|
-
strict_1.default.match(files['public/index.html'], /<script src="\/umdapp\/umdapp\.js"><\/script>/);
|
|
76
|
-
strict_1.default.match(files['public/index.html'], /<script src="\/dev\.js"><\/script>/);
|
|
77
|
-
});
|
|
78
|
-
(0, node_test_1.default)('stand advanced subpath webpack writes subpath index key', () => {
|
|
79
|
-
const options = baseStandOptions({
|
|
80
|
-
bundler: 'webpack',
|
|
81
|
-
standMode: 'advanced',
|
|
82
|
-
advancedProfile: 'subpath',
|
|
83
|
-
});
|
|
84
|
-
const gp = (0, paths_1.getGeneratedPaths)(options);
|
|
85
|
-
const { files } = (0, generateFiles_1.generateFiles)(options);
|
|
86
|
-
strict_1.default.ok(files[gp.indexHtml]);
|
|
87
|
-
strict_1.default.match(files[gp.indexHtml], /<script src="\.\/dev\.js"><\/script>/);
|
|
88
|
-
});
|
|
89
|
-
//# sourceMappingURL=buildStandIndexHtml.test.js.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_test_1 = __importDefault(require("node:test"));
|
|
7
|
-
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const os_1 = __importDefault(require("os"));
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const emitEtaTree_1 = require("./emitEtaTree");
|
|
12
|
-
(0, node_test_1.default)('etaRelativePathToOutputKey', () => {
|
|
13
|
-
strict_1.default.equal((0, emitEtaTree_1.etaRelativePathToOutputKey)('gitignore.eta'), '.gitignore');
|
|
14
|
-
strict_1.default.equal((0, emitEtaTree_1.etaRelativePathToOutputKey)('src/types.d.ts.eta'), 'src/types.d.ts');
|
|
15
|
-
strict_1.default.equal((0, emitEtaTree_1.etaRelativePathToOutputKey)('a.txt'), 'a.txt');
|
|
16
|
-
});
|
|
17
|
-
(0, node_test_1.default)('emitEtaTreeToFiles renders .eta and copies plain files', () => {
|
|
18
|
-
const tmp = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'eta-tree-'));
|
|
19
|
-
const variantRoot = path_1.default.join(tmp, 'variant');
|
|
20
|
-
const partials = path_1.default.join(tmp, 'partials');
|
|
21
|
-
fs_1.default.mkdirSync(path_1.default.join(variantRoot, 'sub'), { recursive: true });
|
|
22
|
-
fs_1.default.mkdirSync(partials, { recursive: true });
|
|
23
|
-
fs_1.default.writeFileSync(path_1.default.join(variantRoot, 'hello.txt.eta'), '<%~ it.rendered["hello.txt"] %>', 'utf8');
|
|
24
|
-
fs_1.default.writeFileSync(path_1.default.join(variantRoot, 'sub', 'raw.bin'), 'RAW', 'utf8');
|
|
25
|
-
const files = (0, emitEtaTree_1.emitEtaTreeToFiles)({
|
|
26
|
-
variantRoot,
|
|
27
|
-
partialsDir: partials,
|
|
28
|
-
context: { rendered: { 'hello.txt': 'HELLO' } },
|
|
29
|
-
});
|
|
30
|
-
strict_1.default.equal(files['hello.txt'], 'HELLO');
|
|
31
|
-
strict_1.default.equal(files['sub/raw.bin'].toString(), 'RAW');
|
|
32
|
-
fs_1.default.rmSync(tmp, { recursive: true, force: true });
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=emitEtaTree.test.js.map
|