@commercetools-frontend/mc-scripts 25.0.0 → 25.2.0

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 (84) hide show
  1. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +1 -1
  2. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js +1 -1
  3. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +1 -1
  4. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +28 -14
  5. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +28 -14
  6. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +28 -14
  7. package/dist/{build-50f29fb0.cjs.prod.js → build-182a099c.cjs.prod.js} +7 -7
  8. package/dist/{build-0b4c6b04.esm.js → build-220a1658.esm.js} +7 -7
  9. package/dist/{build-1baf8a00.cjs.dev.js → build-519d246d.cjs.dev.js} +7 -7
  10. package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-837e7c94.cjs.dev.js} +64 -43
  11. package/dist/{build-vite-85211835.esm.js → build-vite-8cae71a0.esm.js} +61 -24
  12. package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-b007241b.cjs.prod.js} +64 -43
  13. package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
  14. package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
  15. package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
  16. package/dist/{compile-html-adfef598.esm.js → compile-html-025cd493.esm.js} +2 -4
  17. package/dist/{compile-html-b80f9651.cjs.prod.js → compile-html-50fd05ec.cjs.prod.js} +2 -5
  18. package/dist/{compile-html-8679f721.cjs.dev.js → compile-html-f4ac88cc.cjs.dev.js} +2 -5
  19. package/dist/config-sync-0b96d430.esm.js +255 -0
  20. package/dist/config-sync-b3072939.cjs.prod.js +265 -0
  21. package/dist/config-sync-ci-4a09aa00.cjs.prod.js +305 -0
  22. package/dist/config-sync-ci-85e3fec2.esm.js +294 -0
  23. package/dist/config-sync-ci-eadb8bfc.cjs.dev.js +305 -0
  24. package/dist/config-sync-f8fca39f.cjs.dev.js +265 -0
  25. package/dist/{config-sync-87ba9f28.cjs.prod.js → config-sync-helpers-11fc328f.cjs.prod.js} +193 -326
  26. package/dist/{config-sync-27ca0c93.cjs.dev.js → config-sync-helpers-dab59ed9.cjs.dev.js} +195 -328
  27. package/dist/{config-sync-ff4b1e5b.esm.js → config-sync-helpers-fe6ea729.esm.js} +186 -323
  28. package/dist/{create-postcss-config-34bab342.cjs.prod.js → create-postcss-config-56b74a34.cjs.prod.js} +1 -1
  29. package/dist/{create-postcss-config-0e833724.cjs.dev.js → create-postcss-config-78879a12.cjs.dev.js} +1 -1
  30. package/dist/{create-postcss-config-e6dfba3f.esm.js → create-postcss-config-95f9bf62.esm.js} +1 -1
  31. package/dist/{create-webpack-config-for-development-fe0945ce.cjs.prod.js → create-webpack-config-for-development-3eb1b365.cjs.prod.js} +7 -7
  32. package/dist/{create-webpack-config-for-development-2ac1d86f.cjs.dev.js → create-webpack-config-for-development-62b89920.cjs.dev.js} +7 -7
  33. package/dist/{create-webpack-config-for-development-be2722d6.esm.js → create-webpack-config-for-development-a28736fa.esm.js} +7 -7
  34. package/dist/{create-webpack-config-for-production-66c77849.esm.js → create-webpack-config-for-production-21ea561f.esm.js} +8 -8
  35. package/dist/{create-webpack-config-for-production-2200e554.cjs.prod.js → create-webpack-config-for-production-3b6599db.cjs.prod.js} +8 -8
  36. package/dist/{create-webpack-config-for-production-d2c41a9d.cjs.dev.js → create-webpack-config-for-production-e5ed8805.cjs.dev.js} +8 -8
  37. package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-6d592cd6.cjs.prod.js} +21 -3
  38. package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-c4c5980e.cjs.dev.js} +21 -3
  39. package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-fcc77fb6.esm.js} +21 -3
  40. package/dist/declarations/src/types.d.ts +4 -0
  41. package/dist/{deployment-previews-set-7f9fbfe5.esm.js → deployment-previews-set-7d49e7df.esm.js} +22 -27
  42. package/dist/{deployment-previews-set-3697be5e.cjs.dev.js → deployment-previews-set-8d6a1e99.cjs.dev.js} +22 -28
  43. package/dist/{deployment-previews-set-e92403f7.cjs.prod.js → deployment-previews-set-f8ce3db7.cjs.prod.js} +22 -28
  44. package/dist/{graphql-requests-bab5fcc3.cjs.dev.js → graphql-requests-b57fca4c.cjs.prod.js} +5 -8
  45. package/dist/{graphql-requests-d8bc2292.esm.js → graphql-requests-d2fa2ca7.esm.js} +6 -9
  46. package/dist/{graphql-requests-8ef89149.cjs.prod.js → graphql-requests-da194989.cjs.dev.js} +5 -8
  47. package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
  48. package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
  49. package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
  50. package/dist/{login-5fd67aac.cjs.prod.js → login-9774c9cc.cjs.prod.js} +154 -38
  51. package/dist/login-abb38213.esm.js +337 -0
  52. package/dist/{login-9fac9eee.cjs.dev.js → login-f4550251.cjs.dev.js} +154 -38
  53. package/dist/{optimizations-ea21b802.cjs.prod.js → optimizations-7789145e.cjs.dev.js} +5 -8
  54. package/dist/{optimizations-ea71a24a.esm.js → optimizations-bf991634.esm.js} +5 -7
  55. package/dist/{optimizations-ebbeaf88.cjs.dev.js → optimizations-fb93514f.cjs.prod.js} +5 -8
  56. package/dist/{package-ff04bcf7.cjs.dev.js → package-0eebca1b.cjs.dev.js} +21 -11
  57. package/dist/{package-4bdd2ccf.esm.js → package-9e6910b8.esm.js} +21 -11
  58. package/dist/{package-428d5001.cjs.prod.js → package-b9298ce3.cjs.prod.js} +21 -11
  59. package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
  60. package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
  61. package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
  62. package/dist/{serve-04a03d5f.cjs.dev.js → serve-38456e1b.cjs.dev.js} +7 -6
  63. package/dist/{serve-fb1a0f5a.esm.js → serve-be1f9439.esm.js} +6 -6
  64. package/dist/{serve-2a863026.cjs.prod.js → serve-cc4a766d.cjs.prod.js} +7 -6
  65. package/dist/{start-643a55bb.esm.js → start-109f9462.esm.js} +8 -9
  66. package/dist/{start-47ea5e04.cjs.dev.js → start-7765f44c.cjs.dev.js} +8 -9
  67. package/dist/{start-84cdf12b.cjs.prod.js → start-e014127c.cjs.prod.js} +8 -9
  68. package/dist/{start-vite-eea72ba9.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +3 -4
  69. package/dist/{start-vite-d548c121.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +3 -4
  70. package/dist/{start-vite-d649d1f3.esm.js → start-vite-7d1161e8.esm.js} +3 -4
  71. package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
  72. package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
  73. package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
  74. package/package.json +21 -11
  75. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
  76. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
  77. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
  78. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +6 -6
  79. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +6 -6
  80. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +6 -6
  81. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
  82. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
  83. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
  84. package/dist/login-9ee43381.esm.js +0 -223
@@ -3,27 +3,29 @@
3
3
  var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
4
4
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
5
5
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
6
- var path = require('path');
6
+ var path$1 = require('path');
7
7
  var pluginGraphql = require('@rollup/plugin-graphql');
8
8
  var pluginReact = require('@vitejs/plugin-react');
9
- var fs = require('fs-extra');
9
+ var fs$1 = require('fs-extra');
10
10
  var rollupPluginVisualizer = require('rollup-plugin-visualizer');
11
11
  var vite = require('vite');
12
12
  var viteBundleAnalyzer = require('vite-bundle-analyzer');
13
13
  var assets = require('@commercetools-frontend/assets');
14
14
  var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
15
- var optimizations = require('./optimizations-ebbeaf88.cjs.dev.js');
16
- var paths = require('./paths-ec3e3a7d.cjs.dev.js');
15
+ var optimizations = require('./optimizations-7789145e.cjs.dev.js');
16
+ var paths = require('./paths-b76fc753.cjs.dev.js');
17
17
  var cliLib = require('@formatjs/cli-lib');
18
18
  var pluginutils = require('@rollup/pluginutils');
19
- var i18nMessageComplilation = require('./i18n-message-complilation-3f80e8d6.cjs.dev.js');
20
- var vitePluginSvgr = require('./vite-plugin-svgr-53ef97c7.cjs.dev.js');
19
+ var i18nMessageComplilation = require('./i18n-message-complilation-7311cb29.cjs.dev.js');
20
+ var fs = require('node:fs');
21
+ var path = require('node:path');
22
+ var glob = require('glob');
23
+ var vitePluginSvgr = require('./vite-plugin-svgr-7d06f400.cjs.dev.js');
21
24
  require('@babel/runtime-corejs3/helpers/defineProperty');
22
25
  require('@babel/runtime-corejs3/helpers/slicedToArray');
23
26
  require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
24
27
  require('@babel/runtime-corejs3/core-js-stable/object/entries');
25
28
  require('@babel/runtime-corejs3/core-js-stable/instance/includes');
26
- require('@babel/runtime-corejs3/core-js-stable/instance/concat');
27
29
  require('@babel/runtime-corejs3/core-js-stable/object/keys');
28
30
  require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
29
31
  require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
@@ -35,38 +37,21 @@ require('chalk');
35
37
  require('@babel/runtime-corejs3/core-js-stable/instance/find');
36
38
  require('fs');
37
39
  require('./does-file-exist-eb86baca.cjs.dev.js');
38
- require('node:fs');
39
40
  require('@babel/runtime-corejs3/core-js-stable/object/values');
40
41
  require('crypto');
41
42
  require('@babel/runtime-corejs3/core-js/instance/match-all');
42
43
 
43
44
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
44
45
 
45
- function _interopNamespace(e) {
46
- if (e && e.__esModule) return e;
47
- var n = Object.create(null);
48
- if (e) {
49
- Object.keys(e).forEach(function (k) {
50
- if (k !== 'default') {
51
- var d = Object.getOwnPropertyDescriptor(e, k);
52
- Object.defineProperty(n, k, d.get ? d : {
53
- enumerable: true,
54
- get: function () { return e[k]; }
55
- });
56
- }
57
- });
58
- }
59
- n["default"] = e;
60
- return Object.freeze(n);
61
- }
62
-
63
46
  var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
64
47
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
65
48
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
66
- var path__default = /*#__PURE__*/_interopDefault(path);
49
+ var path__default$1 = /*#__PURE__*/_interopDefault(path$1);
67
50
  var pluginGraphql__default = /*#__PURE__*/_interopDefault(pluginGraphql);
68
51
  var pluginReact__default = /*#__PURE__*/_interopDefault(pluginReact);
52
+ var fs__default$1 = /*#__PURE__*/_interopDefault(fs$1);
69
53
  var fs__default = /*#__PURE__*/_interopDefault(fs);
54
+ var path__default = /*#__PURE__*/_interopDefault(path);
70
55
 
71
56
  // Type guard to help with filtering arrays for nullish elements.
72
57
  function nonNullable(value) {
@@ -76,7 +61,7 @@ function nonNullable(value) {
76
61
  // This script/function is injected into the `index.html` and used by Vite
77
62
  // on runtime to build the assets URL (for example when using a separate CDN for the assets).
78
63
  // Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
79
- const dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
64
+ const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
80
65
  function vitePluginDynamicBaseAssetsGlobals() {
81
66
  return {
82
67
  name: 'dynamic-base-assets-globals',
@@ -122,25 +107,62 @@ function vitePluginI18nMessageCompilation() {
122
107
  };
123
108
  }
124
109
 
110
+ /**
111
+ * A simple Vite plugin to clean up files matching glob patterns after build.
112
+ * Replaces `vite-plugin-post-cleanup` to avoid the `inflight` vulnerability
113
+ * in its transitive dependencies.
114
+ */
115
+ function pluginPostCleanup(options) {
116
+ return {
117
+ name: 'vite-plugin-post-cleanup',
118
+ apply: 'build',
119
+ closeBundle() {
120
+ const outputDir = options.outputDir,
121
+ patterns = options.patterns,
122
+ verbose = options.verbose;
123
+ let totalFilesDeleted = 0;
124
+ for (const pattern of patterns) {
125
+ const files = glob.globSync(pattern, {
126
+ cwd: outputDir
127
+ });
128
+ for (const file of files) {
129
+ const filePath = path__default["default"].join(outputDir, file);
130
+ try {
131
+ fs__default["default"].unlinkSync(filePath);
132
+ totalFilesDeleted++;
133
+ if (verbose) {
134
+ console.log(`[post-cleanup] Deleted: ${file}`);
135
+ }
136
+ } catch (error) {
137
+ console.warn(`[post-cleanup] Failed to delete ${file}:`, error);
138
+ }
139
+ }
140
+ }
141
+ if (verbose && patterns.length > 0 && totalFilesDeleted === 0) {
142
+ console.log('[post-cleanup] No files matched the patterns');
143
+ }
144
+ }
145
+ };
146
+ }
147
+
125
148
  async function run() {
126
149
  var _context;
127
- const CleanBuild = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('vite-plugin-clean-build')); })).default;
128
150
  const DEFAULT_PORT = _parseInt__default["default"](String(process.env.HTTP_PORT), 10) || 3001;
129
151
 
130
152
  // Ensure the `/public` folder exists.
131
- fs__default["default"].mkdirSync(paths.paths.appBuild, {
153
+ fs__default$1["default"].mkdirSync(paths.paths.appBuild, {
132
154
  recursive: true
133
155
  });
134
156
 
135
157
  // Generate `index.html` (template).
136
- const appEntryPoint = path__default["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
158
+ const appEntryPoint = path__default$1["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
137
159
  const html = mcHtmlTemplate.generateTemplate({
138
160
  // Define the module entry point (path relative from the `/public` folder).
139
161
  // NOTE: that this is different from the development configuration.
140
- scriptImports: ["<script type=\"module\" src=\"/".concat(appEntryPoint, "\" defer></script>")]
162
+ scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
141
163
  });
142
164
  // Write `index.html` (template) into the `/public` folder.
143
- fs__default["default"].writeFileSync(paths.paths.appIndexHtml, html, {
165
+ fs__default$1["default"].writeFileSync(paths.paths.appIndexHtml, html, {
144
166
  encoding: 'utf8'
145
167
  });
146
168
  const appDependencies = require(paths.paths.appPackageJson).dependencies;
@@ -183,10 +205,10 @@ async function run() {
183
205
  renderBuiltUrl(filename, _ref) {
184
206
  let hostType = _ref.hostType;
185
207
  if (hostType === 'html') {
186
- return "__CDN_URL__".concat(filename);
208
+ return `__CDN_URL__${filename}`;
187
209
  }
188
210
  return {
189
- runtime: "window.__toCdnUrl(".concat(_JSON$stringify__default["default"](filename), ")")
211
+ runtime: `window.__toCdnUrl(${_JSON$stringify__default["default"](filename)})`
190
212
  };
191
213
  }
192
214
  },
@@ -202,12 +224,11 @@ async function run() {
202
224
  // Enable pre-parse default `formatjs` messages into AST.
203
225
  // TODO: make it a CLI option when Vite support becomes stable.
204
226
  process.env.ENABLE_I18N_AST === 'true'
205
- }] : undefined]).call(_context, nonNullable)
227
+ }] : undefined, process.env.ENABLE_BABEL_REACT_COMPILER === 'true' ? 'babel-plugin-react-compiler' : undefined]).call(_context, nonNullable)
206
228
  }
207
229
  }),
208
- // cleanbuild is needed to remove large svg assets
209
- // that are not used after the build.
210
- CleanBuild({
230
+ // Clean up large SVG assets that are not used after the build.
231
+ pluginPostCleanup({
211
232
  outputDir: paths.paths.appBuild,
212
233
  patterns: ['*.react-*.svg'],
213
234
  verbose: true // logs the files that are removed
@@ -221,17 +242,17 @@ async function run() {
221
242
  });
222
243
 
223
244
  // Rename `/public/public/index.html` to `/public/index.html.template`
224
- fs__default["default"].renameSync(
245
+ fs__default$1["default"].renameSync(
225
246
  // Because of our custom entry point path (`/public/index.html`),
226
247
  // Vite will write the `index.html` to `/public/public/index.html`.
227
248
  // We need to move this file to the `/public` folder and rename it
228
249
  // to `index.html.template` (as expected by the `compile-html` command).
229
- path__default["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
250
+ path__default$1["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
230
251
  // Clean up nested folder
231
- fs__default["default"].rmdirSync(path__default["default"].join(paths.paths.appBuild, 'public'));
252
+ fs__default$1["default"].rmdirSync(path__default$1["default"].join(paths.paths.appBuild, 'public'));
232
253
 
233
254
  // Copy public assets
234
- fs__default["default"].copySync(path__default["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
255
+ fs__default$1["default"].copySync(path__default$1["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
235
256
  dereference: true
236
257
  });
237
258
  }
@@ -1,27 +1,29 @@
1
1
  import _parseInt from '@babel/runtime-corejs3/core-js-stable/parse-int';
2
2
  import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
3
3
  import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
4
- import path from 'path';
4
+ import path$1 from 'path';
5
5
  import pluginGraphql from '@rollup/plugin-graphql';
6
6
  import pluginReact from '@vitejs/plugin-react';
7
- import fs from 'fs-extra';
7
+ import fs$1 from 'fs-extra';
8
8
  import { visualizer } from 'rollup-plugin-visualizer';
9
9
  import { build } from 'vite';
10
10
  import { analyzer } from 'vite-bundle-analyzer';
11
11
  import { packageLocation } from '@commercetools-frontend/assets';
12
12
  import { generateTemplate } from '@commercetools-frontend/mc-html-template';
13
- import { a as getViteCacheGroups } from './optimizations-ea71a24a.esm.js';
14
- import { p as paths } from './paths-7bf7e88e.esm.js';
13
+ import { a as getViteCacheGroups } from './optimizations-bf991634.esm.js';
14
+ import { p as paths } from './paths-39f22b8b.esm.js';
15
15
  import { compile } from '@formatjs/cli-lib';
16
16
  import { createFilter } from '@rollup/pluginutils';
17
- import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-8aec9d1b.esm.js';
18
- import { v as vitePluginSvgr } from './vite-plugin-svgr-22c8d518.esm.js';
17
+ import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-21d3b0aa.esm.js';
18
+ import fs from 'node:fs';
19
+ import path from 'node:path';
20
+ import { globSync } from 'glob';
21
+ import { v as vitePluginSvgr } from './vite-plugin-svgr-de6ee7da.esm.js';
19
22
  import '@babel/runtime-corejs3/helpers/defineProperty';
20
23
  import '@babel/runtime-corejs3/helpers/slicedToArray';
21
24
  import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
22
25
  import '@babel/runtime-corejs3/core-js-stable/object/entries';
23
26
  import '@babel/runtime-corejs3/core-js-stable/instance/includes';
24
- import '@babel/runtime-corejs3/core-js-stable/instance/concat';
25
27
  import '@babel/runtime-corejs3/core-js-stable/object/keys';
26
28
  import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
27
29
  import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
@@ -33,7 +35,6 @@ import 'chalk';
33
35
  import '@babel/runtime-corejs3/core-js-stable/instance/find';
34
36
  import 'fs';
35
37
  import './does-file-exist-32618334.esm.js';
36
- import 'node:fs';
37
38
  import '@babel/runtime-corejs3/core-js-stable/object/values';
38
39
  import 'crypto';
39
40
  import '@babel/runtime-corejs3/core-js/instance/match-all';
@@ -46,7 +47,7 @@ function nonNullable(value) {
46
47
  // This script/function is injected into the `index.html` and used by Vite
47
48
  // on runtime to build the assets URL (for example when using a separate CDN for the assets).
48
49
  // Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
49
- const dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
50
+ const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
50
51
  function vitePluginDynamicBaseAssetsGlobals() {
51
52
  return {
52
53
  name: 'dynamic-base-assets-globals',
@@ -92,25 +93,62 @@ function vitePluginI18nMessageCompilation() {
92
93
  };
93
94
  }
94
95
 
96
+ /**
97
+ * A simple Vite plugin to clean up files matching glob patterns after build.
98
+ * Replaces `vite-plugin-post-cleanup` to avoid the `inflight` vulnerability
99
+ * in its transitive dependencies.
100
+ */
101
+ function pluginPostCleanup(options) {
102
+ return {
103
+ name: 'vite-plugin-post-cleanup',
104
+ apply: 'build',
105
+ closeBundle() {
106
+ const outputDir = options.outputDir,
107
+ patterns = options.patterns,
108
+ verbose = options.verbose;
109
+ let totalFilesDeleted = 0;
110
+ for (const pattern of patterns) {
111
+ const files = globSync(pattern, {
112
+ cwd: outputDir
113
+ });
114
+ for (const file of files) {
115
+ const filePath = path.join(outputDir, file);
116
+ try {
117
+ fs.unlinkSync(filePath);
118
+ totalFilesDeleted++;
119
+ if (verbose) {
120
+ console.log(`[post-cleanup] Deleted: ${file}`);
121
+ }
122
+ } catch (error) {
123
+ console.warn(`[post-cleanup] Failed to delete ${file}:`, error);
124
+ }
125
+ }
126
+ }
127
+ if (verbose && patterns.length > 0 && totalFilesDeleted === 0) {
128
+ console.log('[post-cleanup] No files matched the patterns');
129
+ }
130
+ }
131
+ };
132
+ }
133
+
95
134
  async function run() {
96
135
  var _context;
97
- const CleanBuild = (await import('vite-plugin-clean-build')).default;
98
136
  const DEFAULT_PORT = _parseInt(String(process.env.HTTP_PORT), 10) || 3001;
99
137
 
100
138
  // Ensure the `/public` folder exists.
101
- fs.mkdirSync(paths.appBuild, {
139
+ fs$1.mkdirSync(paths.appBuild, {
102
140
  recursive: true
103
141
  });
104
142
 
105
143
  // Generate `index.html` (template).
106
- const appEntryPoint = path.relative(paths.appRoot, paths.entryPoint);
144
+ const appEntryPoint = path$1.relative(paths.appRoot, paths.entryPoint);
107
145
  const html = generateTemplate({
108
146
  // Define the module entry point (path relative from the `/public` folder).
109
147
  // NOTE: that this is different from the development configuration.
110
- scriptImports: ["<script type=\"module\" src=\"/".concat(appEntryPoint, "\" defer></script>")]
148
+ scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
111
149
  });
112
150
  // Write `index.html` (template) into the `/public` folder.
113
- fs.writeFileSync(paths.appIndexHtml, html, {
151
+ fs$1.writeFileSync(paths.appIndexHtml, html, {
114
152
  encoding: 'utf8'
115
153
  });
116
154
  const appDependencies = require(paths.appPackageJson).dependencies;
@@ -153,10 +191,10 @@ async function run() {
153
191
  renderBuiltUrl(filename, _ref) {
154
192
  let hostType = _ref.hostType;
155
193
  if (hostType === 'html') {
156
- return "__CDN_URL__".concat(filename);
194
+ return `__CDN_URL__${filename}`;
157
195
  }
158
196
  return {
159
- runtime: "window.__toCdnUrl(".concat(_JSON$stringify(filename), ")")
197
+ runtime: `window.__toCdnUrl(${_JSON$stringify(filename)})`
160
198
  };
161
199
  }
162
200
  },
@@ -172,12 +210,11 @@ async function run() {
172
210
  // Enable pre-parse default `formatjs` messages into AST.
173
211
  // TODO: make it a CLI option when Vite support becomes stable.
174
212
  process.env.ENABLE_I18N_AST === 'true'
175
- }] : undefined]).call(_context, nonNullable)
213
+ }] : undefined, process.env.ENABLE_BABEL_REACT_COMPILER === 'true' ? 'babel-plugin-react-compiler' : undefined]).call(_context, nonNullable)
176
214
  }
177
215
  }),
178
- // cleanbuild is needed to remove large svg assets
179
- // that are not used after the build.
180
- CleanBuild({
216
+ // Clean up large SVG assets that are not used after the build.
217
+ pluginPostCleanup({
181
218
  outputDir: paths.appBuild,
182
219
  patterns: ['*.react-*.svg'],
183
220
  verbose: true // logs the files that are removed
@@ -191,17 +228,17 @@ async function run() {
191
228
  });
192
229
 
193
230
  // Rename `/public/public/index.html` to `/public/index.html.template`
194
- fs.renameSync(
231
+ fs$1.renameSync(
195
232
  // Because of our custom entry point path (`/public/index.html`),
196
233
  // Vite will write the `index.html` to `/public/public/index.html`.
197
234
  // We need to move this file to the `/public` folder and rename it
198
235
  // to `index.html.template` (as expected by the `compile-html` command).
199
- path.join(paths.appBuild, 'public/index.html'), paths.appIndexHtmlTemplate);
236
+ path$1.join(paths.appBuild, 'public/index.html'), paths.appIndexHtmlTemplate);
200
237
  // Clean up nested folder
201
- fs.rmdirSync(path.join(paths.appBuild, 'public'));
238
+ fs$1.rmdirSync(path$1.join(paths.appBuild, 'public'));
202
239
 
203
240
  // Copy public assets
204
- fs.copySync(path.join(packageLocation, 'html-page'), paths.appBuild, {
241
+ fs$1.copySync(path$1.join(packageLocation, 'html-page'), paths.appBuild, {
205
242
  dereference: true
206
243
  });
207
244
  }
@@ -3,27 +3,29 @@
3
3
  var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
4
4
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
5
5
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
6
- var path = require('path');
6
+ var path$1 = require('path');
7
7
  var pluginGraphql = require('@rollup/plugin-graphql');
8
8
  var pluginReact = require('@vitejs/plugin-react');
9
- var fs = require('fs-extra');
9
+ var fs$1 = require('fs-extra');
10
10
  var rollupPluginVisualizer = require('rollup-plugin-visualizer');
11
11
  var vite = require('vite');
12
12
  var viteBundleAnalyzer = require('vite-bundle-analyzer');
13
13
  var assets = require('@commercetools-frontend/assets');
14
14
  var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
15
- var optimizations = require('./optimizations-ea21b802.cjs.prod.js');
16
- var paths = require('./paths-af1a725a.cjs.prod.js');
15
+ var optimizations = require('./optimizations-fb93514f.cjs.prod.js');
16
+ var paths = require('./paths-7768b440.cjs.prod.js');
17
17
  var cliLib = require('@formatjs/cli-lib');
18
18
  var pluginutils = require('@rollup/pluginutils');
19
- var i18nMessageComplilation = require('./i18n-message-complilation-393d344a.cjs.prod.js');
20
- var vitePluginSvgr = require('./vite-plugin-svgr-5de1cad9.cjs.prod.js');
19
+ var i18nMessageComplilation = require('./i18n-message-complilation-7762da61.cjs.prod.js');
20
+ var fs = require('node:fs');
21
+ var path = require('node:path');
22
+ var glob = require('glob');
23
+ var vitePluginSvgr = require('./vite-plugin-svgr-4034a834.cjs.prod.js');
21
24
  require('@babel/runtime-corejs3/helpers/defineProperty');
22
25
  require('@babel/runtime-corejs3/helpers/slicedToArray');
23
26
  require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
24
27
  require('@babel/runtime-corejs3/core-js-stable/object/entries');
25
28
  require('@babel/runtime-corejs3/core-js-stable/instance/includes');
26
- require('@babel/runtime-corejs3/core-js-stable/instance/concat');
27
29
  require('@babel/runtime-corejs3/core-js-stable/object/keys');
28
30
  require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
29
31
  require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
@@ -35,38 +37,21 @@ require('chalk');
35
37
  require('@babel/runtime-corejs3/core-js-stable/instance/find');
36
38
  require('fs');
37
39
  require('./does-file-exist-be53305d.cjs.prod.js');
38
- require('node:fs');
39
40
  require('@babel/runtime-corejs3/core-js-stable/object/values');
40
41
  require('crypto');
41
42
  require('@babel/runtime-corejs3/core-js/instance/match-all');
42
43
 
43
44
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
44
45
 
45
- function _interopNamespace(e) {
46
- if (e && e.__esModule) return e;
47
- var n = Object.create(null);
48
- if (e) {
49
- Object.keys(e).forEach(function (k) {
50
- if (k !== 'default') {
51
- var d = Object.getOwnPropertyDescriptor(e, k);
52
- Object.defineProperty(n, k, d.get ? d : {
53
- enumerable: true,
54
- get: function () { return e[k]; }
55
- });
56
- }
57
- });
58
- }
59
- n["default"] = e;
60
- return Object.freeze(n);
61
- }
62
-
63
46
  var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
64
47
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
65
48
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
66
- var path__default = /*#__PURE__*/_interopDefault(path);
49
+ var path__default$1 = /*#__PURE__*/_interopDefault(path$1);
67
50
  var pluginGraphql__default = /*#__PURE__*/_interopDefault(pluginGraphql);
68
51
  var pluginReact__default = /*#__PURE__*/_interopDefault(pluginReact);
52
+ var fs__default$1 = /*#__PURE__*/_interopDefault(fs$1);
69
53
  var fs__default = /*#__PURE__*/_interopDefault(fs);
54
+ var path__default = /*#__PURE__*/_interopDefault(path);
70
55
 
71
56
  // Type guard to help with filtering arrays for nullish elements.
72
57
  function nonNullable(value) {
@@ -76,7 +61,7 @@ function nonNullable(value) {
76
61
  // This script/function is injected into the `index.html` and used by Vite
77
62
  // on runtime to build the assets URL (for example when using a separate CDN for the assets).
78
63
  // Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
79
- const dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
64
+ const dynamicBaseAssetsCode = `globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;`;
80
65
  function vitePluginDynamicBaseAssetsGlobals() {
81
66
  return {
82
67
  name: 'dynamic-base-assets-globals',
@@ -122,25 +107,62 @@ function vitePluginI18nMessageCompilation() {
122
107
  };
123
108
  }
124
109
 
110
+ /**
111
+ * A simple Vite plugin to clean up files matching glob patterns after build.
112
+ * Replaces `vite-plugin-post-cleanup` to avoid the `inflight` vulnerability
113
+ * in its transitive dependencies.
114
+ */
115
+ function pluginPostCleanup(options) {
116
+ return {
117
+ name: 'vite-plugin-post-cleanup',
118
+ apply: 'build',
119
+ closeBundle() {
120
+ const outputDir = options.outputDir,
121
+ patterns = options.patterns,
122
+ verbose = options.verbose;
123
+ let totalFilesDeleted = 0;
124
+ for (const pattern of patterns) {
125
+ const files = glob.globSync(pattern, {
126
+ cwd: outputDir
127
+ });
128
+ for (const file of files) {
129
+ const filePath = path__default["default"].join(outputDir, file);
130
+ try {
131
+ fs__default["default"].unlinkSync(filePath);
132
+ totalFilesDeleted++;
133
+ if (verbose) {
134
+ console.log(`[post-cleanup] Deleted: ${file}`);
135
+ }
136
+ } catch (error) {
137
+ console.warn(`[post-cleanup] Failed to delete ${file}:`, error);
138
+ }
139
+ }
140
+ }
141
+ if (verbose && patterns.length > 0 && totalFilesDeleted === 0) {
142
+ console.log('[post-cleanup] No files matched the patterns');
143
+ }
144
+ }
145
+ };
146
+ }
147
+
125
148
  async function run() {
126
149
  var _context;
127
- const CleanBuild = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('vite-plugin-clean-build')); })).default;
128
150
  const DEFAULT_PORT = _parseInt__default["default"](String(process.env.HTTP_PORT), 10) || 3001;
129
151
 
130
152
  // Ensure the `/public` folder exists.
131
- fs__default["default"].mkdirSync(paths.paths.appBuild, {
153
+ fs__default$1["default"].mkdirSync(paths.paths.appBuild, {
132
154
  recursive: true
133
155
  });
134
156
 
135
157
  // Generate `index.html` (template).
136
- const appEntryPoint = path__default["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
158
+ const appEntryPoint = path__default$1["default"].relative(paths.paths.appRoot, paths.paths.entryPoint);
137
159
  const html = mcHtmlTemplate.generateTemplate({
138
160
  // Define the module entry point (path relative from the `/public` folder).
139
161
  // NOTE: that this is different from the development configuration.
140
- scriptImports: ["<script type=\"module\" src=\"/".concat(appEntryPoint, "\" defer></script>")]
162
+ scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
141
163
  });
142
164
  // Write `index.html` (template) into the `/public` folder.
143
- fs__default["default"].writeFileSync(paths.paths.appIndexHtml, html, {
165
+ fs__default$1["default"].writeFileSync(paths.paths.appIndexHtml, html, {
144
166
  encoding: 'utf8'
145
167
  });
146
168
  const appDependencies = require(paths.paths.appPackageJson).dependencies;
@@ -183,10 +205,10 @@ async function run() {
183
205
  renderBuiltUrl(filename, _ref) {
184
206
  let hostType = _ref.hostType;
185
207
  if (hostType === 'html') {
186
- return "__CDN_URL__".concat(filename);
208
+ return `__CDN_URL__${filename}`;
187
209
  }
188
210
  return {
189
- runtime: "window.__toCdnUrl(".concat(_JSON$stringify__default["default"](filename), ")")
211
+ runtime: `window.__toCdnUrl(${_JSON$stringify__default["default"](filename)})`
190
212
  };
191
213
  }
192
214
  },
@@ -202,12 +224,11 @@ async function run() {
202
224
  // Enable pre-parse default `formatjs` messages into AST.
203
225
  // TODO: make it a CLI option when Vite support becomes stable.
204
226
  process.env.ENABLE_I18N_AST === 'true'
205
- }] : undefined]).call(_context, nonNullable)
227
+ }] : undefined, process.env.ENABLE_BABEL_REACT_COMPILER === 'true' ? 'babel-plugin-react-compiler' : undefined]).call(_context, nonNullable)
206
228
  }
207
229
  }),
208
- // cleanbuild is needed to remove large svg assets
209
- // that are not used after the build.
210
- CleanBuild({
230
+ // Clean up large SVG assets that are not used after the build.
231
+ pluginPostCleanup({
211
232
  outputDir: paths.paths.appBuild,
212
233
  patterns: ['*.react-*.svg'],
213
234
  verbose: true // logs the files that are removed
@@ -221,17 +242,17 @@ async function run() {
221
242
  });
222
243
 
223
244
  // Rename `/public/public/index.html` to `/public/index.html.template`
224
- fs__default["default"].renameSync(
245
+ fs__default$1["default"].renameSync(
225
246
  // Because of our custom entry point path (`/public/index.html`),
226
247
  // Vite will write the `index.html` to `/public/public/index.html`.
227
248
  // We need to move this file to the `/public` folder and rename it
228
249
  // to `index.html.template` (as expected by the `compile-html` command).
229
- path__default["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
250
+ path__default$1["default"].join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
230
251
  // Clean up nested folder
231
- fs__default["default"].rmdirSync(path__default["default"].join(paths.paths.appBuild, 'public'));
252
+ fs__default$1["default"].rmdirSync(path__default$1["default"].join(paths.paths.appBuild, 'public'));
232
253
 
233
254
  // Copy public assets
234
- fs__default["default"].copySync(path__default["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
255
+ fs__default$1["default"].copySync(path__default$1["default"].join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
235
256
  dereference: true
236
257
  });
237
258
  }
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "25.0.0";
8
+ var version = "25.2.0";
9
9
 
10
10
  // These exports are deprecated.
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "25.0.0";
8
+ var version = "25.2.0";
9
9
 
10
10
  // These exports are deprecated.
11
11
 
@@ -1,7 +1,7 @@
1
1
  export { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
2
2
 
3
3
  // NOTE: This string will be replaced on build time with the package version.
4
- var version = "25.0.0";
4
+ var version = "25.2.0";
5
5
 
6
6
  // These exports are deprecated.
7
7
 
@@ -1,9 +1,8 @@
1
- import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
2
1
  import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
3
2
  import fs from 'fs';
4
3
  import chalk from 'chalk';
5
4
  import { compileHtml } from '@commercetools-frontend/mc-html-template';
6
- import { p as paths } from './paths-7bf7e88e.esm.js';
5
+ import { p as paths } from './paths-39f22b8b.esm.js';
7
6
  import '@babel/runtime-corejs3/core-js-stable/instance/find';
8
7
  import 'path';
9
8
  import './does-file-exist-32618334.esm.js';
@@ -24,8 +23,7 @@ async function run(options) {
24
23
  const transformerFn = require(transformerPath);
25
24
  transformerFn(compiled);
26
25
  } catch (error) {
27
- var _context;
28
- throw new Error(_concatInstanceProperty(_context = "Could not load transformer module \"".concat(options.transformer, "\"\n")).call(_context, error instanceof Error ? error.stack : ''));
26
+ throw new Error(`Could not load transformer module "${options.transformer}"\n${error instanceof Error ? error.stack : ''}`);
29
27
  }
30
28
  } else if (options.printSecurityHeaders) {
31
29
  console.log(_JSON$stringify(compiled.headers));