@commercetools-frontend/mc-scripts 27.5.2 → 27.5.3
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/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +19 -39
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +19 -39
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +11 -11
- package/dist/{build-abb7a417.cjs.prod.js → build-BP3m-wjz.cjs.prod.js} +23 -23
- package/dist/{build-c9301721.cjs.dev.js → build-Dq8dqtsd.cjs.dev.js} +23 -23
- package/dist/{build-26bc6235.esm.js → build-GEMI3W9m.esm.js} +7 -7
- package/dist/{build-vite-1526e4f8.esm.js → build-vite-CO8mi4hd.esm.js} +20 -10
- package/dist/{build-vite-71889a4a.cjs.prod.js → build-vite-D67xSRU1.cjs.prod.js} +46 -36
- package/dist/{build-vite-2fb9320e.cjs.dev.js → build-vite-Dxi3rfHf.cjs.dev.js} +46 -36
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +2 -4
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +2 -4
- package/dist/commercetools-frontend-mc-scripts.esm.js +2 -2
- package/dist/{compile-html-025cd493.esm.js → compile-html-BVvy3IQD.esm.js} +2 -2
- package/dist/{compile-html-f4ac88cc.cjs.dev.js → compile-html-DZlUpFXg.cjs.prod.js} +8 -8
- package/dist/{compile-html-50fd05ec.cjs.prod.js → compile-html-Ds1YojsY.cjs.dev.js} +8 -8
- package/dist/{config-sync-cc7a04f3.esm.js → config-sync-Bu7U5gn5.esm.js} +5 -5
- package/dist/{config-sync-3536d3b5.cjs.dev.js → config-sync-Cd0sSSrd.cjs.dev.js} +22 -22
- package/dist/{config-sync-5f0637f7.cjs.prod.js → config-sync-D6xLjo9S.cjs.prod.js} +22 -22
- package/dist/{config-sync-ci-e8f6d93f.cjs.prod.js → config-sync-ci-CXgQcemF.cjs.prod.js} +21 -21
- package/dist/{config-sync-ci-df730395.esm.js → config-sync-ci-Dq7bAqeu.esm.js} +5 -5
- package/dist/{config-sync-ci-9f4b9716.cjs.dev.js → config-sync-ci-SDsF-Onw.cjs.dev.js} +21 -21
- package/dist/{config-sync-helpers-8bbbeecf.cjs.prod.js → config-sync-helpers-9kvPwuoy.cjs.prod.js} +47 -47
- package/dist/{config-sync-helpers-619a7bff.esm.js → config-sync-helpers-BLXJp1-D.esm.js} +3 -3
- package/dist/{config-sync-helpers-d60e32cc.cjs.dev.js → config-sync-helpers-DUK45F_R.cjs.dev.js} +47 -47
- package/dist/{create-postcss-config-1f9dc9c7.esm.js → create-postcss-config-CN9_8Usa.esm.js} +1 -1
- package/dist/{create-postcss-config-b7a5f264.cjs.prod.js → create-postcss-config-DAShdAyB.cjs.prod.js} +3 -3
- package/dist/{create-postcss-config-87e59d90.cjs.dev.js → create-postcss-config-NN2FAhvH.cjs.dev.js} +3 -3
- package/dist/{create-webpack-config-for-development-9bbc18bd.esm.js → create-webpack-config-for-development-5HpRHV9G.esm.js} +5 -5
- package/dist/{create-webpack-config-for-development-626c9ad5.cjs.prod.js → create-webpack-config-for-development-CxGehl7I.cjs.prod.js} +25 -25
- package/dist/{create-webpack-config-for-development-b4193970.cjs.dev.js → create-webpack-config-for-development-hxSNyq2_.cjs.dev.js} +25 -25
- package/dist/{create-webpack-config-for-production-87d74eb8.esm.js → create-webpack-config-for-production-BY0UNoNz.esm.js} +5 -5
- package/dist/{create-webpack-config-for-production-79de3446.cjs.prod.js → create-webpack-config-for-production-CW0DlZBz.cjs.prod.js} +32 -32
- package/dist/{create-webpack-config-for-production-1317cc36.cjs.dev.js → create-webpack-config-for-production-Edp9dzmw.cjs.dev.js} +32 -32
- package/dist/{credentials-storage-fd195144.cjs.dev.js → credentials-storage-B0tDCH7i.cjs.dev.js} +10 -10
- package/dist/{credentials-storage-67deadc3.esm.js → credentials-storage-B79bb0Ns.esm.js} +1 -1
- package/dist/{credentials-storage-ea1c16dc.cjs.prod.js → credentials-storage-C3TlK0a8.cjs.prod.js} +10 -10
- package/dist/{deployment-previews-set-8ea395a6.cjs.dev.js → deployment-previews-set-BuHX8wKo.cjs.dev.js} +22 -22
- package/dist/{deployment-previews-set-090d931d.esm.js → deployment-previews-set-C2OPIfy-.esm.js} +4 -4
- package/dist/{deployment-previews-set-0d2e747c.cjs.prod.js → deployment-previews-set-nvkAPwYw.cjs.prod.js} +22 -22
- package/dist/{does-file-exist-be53305d.cjs.prod.js → does-file-exist-DrcZIPe6.cjs.dev.js} +2 -2
- package/dist/{does-file-exist-eb86baca.cjs.dev.js → does-file-exist-DrcZIPe6.cjs.prod.js} +2 -2
- package/dist/{graphql-requests-82ecc296.cjs.dev.js → graphql-requests-BeUd4g3v.cjs.dev.js} +9 -9
- package/dist/{graphql-requests-5754c65e.cjs.prod.js → graphql-requests-D0rtMo7K.cjs.prod.js} +9 -9
- package/dist/{graphql-requests-3008d56e.esm.js → graphql-requests-DCLX_2y0.esm.js} +4 -4
- package/dist/{i18n-message-complilation-7311cb29.cjs.dev.js → i18n-message-complilation-CdVhuyWk.cjs.dev.js} +3 -3
- package/dist/{i18n-message-complilation-7762da61.cjs.prod.js → i18n-message-complilation-CdVhuyWk.cjs.prod.js} +3 -3
- package/dist/{login-440e8b76.cjs.dev.js → login-BagHOLO1.cjs.prod.js} +42 -60
- package/dist/{login-df9f774f.cjs.prod.js → login-DKzmRa46.cjs.dev.js} +42 -60
- package/dist/{login-6785c486.esm.js → login-DZVfG3Jq.esm.js} +3 -3
- package/dist/{optimizations-da5a0cfa.cjs.prod.js → optimizations-CEaq4axa.cjs.dev.js} +8 -8
- package/dist/{optimizations-56be74d6.cjs.dev.js → optimizations-CEaq4axa.cjs.prod.js} +8 -8
- package/dist/{optimizations-54382f7b.esm.js → optimizations-Cjrg77Gu.esm.js} +1 -1
- package/dist/package-B1Y3_DDl.cjs.dev.js +17 -0
- package/dist/package-BiK3ergJ.esm.js +15 -0
- package/dist/package-DxhqRLHb.cjs.prod.js +12 -0
- package/dist/{paths-b76fc753.cjs.dev.js → paths-B0WM5jb9.cjs.dev.js} +5 -5
- package/dist/{paths-39f22b8b.esm.js → paths-Cg5Vq6RE.esm.js} +1 -1
- package/dist/{paths-7768b440.cjs.prod.js → paths-DtvtCG0U.cjs.prod.js} +5 -5
- package/dist/{serve-b1c12985.cjs.dev.js → serve-BwNRk6vi.cjs.prod.js} +13 -13
- package/dist/{serve-3837602d.cjs.prod.js → serve-BxRJOSeR.cjs.dev.js} +13 -13
- package/dist/{serve-22475fec.esm.js → serve-fXDv4-Pm.esm.js} +2 -2
- package/dist/{start-164d9793.cjs.prod.js → start-CQgQhNhU.cjs.prod.js} +17 -17
- package/dist/{start-b74c64bf.cjs.dev.js → start-OjGog63p.cjs.dev.js} +17 -17
- package/dist/{start-149d6e48.esm.js → start-suUcoYml.esm.js} +7 -7
- package/dist/{start-vite-7d1161e8.esm.js → start-vite-BOrX5xsW.esm.js} +3 -3
- package/dist/{start-vite-29078b3a.cjs.prod.js → start-vite-Bf9UIg63.cjs.prod.js} +14 -14
- package/dist/{start-vite-068e9f73.cjs.dev.js → start-vite-CeaoWKrT.cjs.dev.js} +14 -14
- package/dist/{vite-plugin-svgr-4034a834.cjs.prod.js → vite-plugin-svgr-CRRIY_Py.cjs.dev.js} +6 -24
- package/dist/{vite-plugin-svgr-7d06f400.cjs.dev.js → vite-plugin-svgr-CRRIY_Py.cjs.prod.js} +6 -24
- package/package.json +8 -8
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -4
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -4
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +8 -10
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +8 -10
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +8 -8
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
- package/dist/package-48ace978.cjs.dev.js +0 -167
- package/dist/package-eb86d982.cjs.prod.js +0 -167
- package/dist/package-fba7e8e6.esm.js +0 -165
- /package/dist/{does-file-exist-32618334.esm.js → does-file-exist-C7l6j7NP.esm.js} +0 -0
- /package/dist/{i18n-message-complilation-21d3b0aa.esm.js → i18n-message-complilation-BRZ7ffQI.esm.js} +0 -0
- /package/dist/{vendors-to-transpile-04a49d40.cjs.prod.js → vendors-to-transpile-DLHlk7c-.cjs.dev.js} +0 -0
- /package/dist/{vendors-to-transpile-6ab4ea06.cjs.dev.js → vendors-to-transpile-DLHlk7c-.cjs.prod.js} +0 -0
- /package/dist/{vendors-to-transpile-7dc84a72.esm.js → vendors-to-transpile-uu9TNPDO.esm.js} +0 -0
- /package/dist/{vite-plugin-svgr-de6ee7da.esm.js → vite-plugin-svgr-B1JerYlQ.esm.js} +0 -0
|
@@ -10,9 +10,9 @@ var formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
|
|
10
10
|
var printBuildError = require('react-dev-utils/printBuildError');
|
|
11
11
|
var webpack = require('webpack');
|
|
12
12
|
var assets = require('@commercetools-frontend/assets');
|
|
13
|
-
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-
|
|
14
|
-
var paths = require('./paths-
|
|
15
|
-
var doesFileExist = require('./does-file-exist-
|
|
13
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-Edp9dzmw.cjs.dev.js');
|
|
14
|
+
var paths = require('./paths-B0WM5jb9.cjs.dev.js');
|
|
15
|
+
var doesFileExist = require('./does-file-exist-DrcZIPe6.cjs.dev.js');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
17
17
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
18
18
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
@@ -40,17 +40,17 @@ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
|
40
40
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
41
41
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
42
42
|
require('fs');
|
|
43
|
-
require('./create-postcss-config-
|
|
43
|
+
require('./create-postcss-config-NN2FAhvH.cjs.dev.js');
|
|
44
44
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
|
-
require('./package-
|
|
46
|
-
require('./optimizations-
|
|
45
|
+
require('./package-B1Y3_DDl.cjs.dev.js');
|
|
46
|
+
require('./optimizations-CEaq4axa.cjs.dev.js');
|
|
47
47
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
48
48
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
49
|
-
require('./vendors-to-transpile-
|
|
49
|
+
require('./vendors-to-transpile-DLHlk7c-.cjs.dev.js');
|
|
50
50
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
51
51
|
require('node:fs');
|
|
52
52
|
|
|
53
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
53
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
54
54
|
|
|
55
55
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
56
56
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
@@ -62,8 +62,8 @@ var formatWebpackMessages__default = /*#__PURE__*/_interopDefault(formatWebpackM
|
|
|
62
62
|
var printBuildError__default = /*#__PURE__*/_interopDefault(printBuildError);
|
|
63
63
|
var webpack__default = /*#__PURE__*/_interopDefault(webpack);
|
|
64
64
|
|
|
65
|
-
const measureFileSizesBeforeBuild = FileSizeReporter__default
|
|
66
|
-
const printFileSizesAfterBuild = FileSizeReporter__default
|
|
65
|
+
const measureFileSizesBeforeBuild = FileSizeReporter__default.default.measureFileSizesBeforeBuild;
|
|
66
|
+
const printFileSizesAfterBuild = FileSizeReporter__default.default.printFileSizesAfterBuild;
|
|
67
67
|
|
|
68
68
|
// These sizes are pretty large. We'll warn for bundles exceeding them.
|
|
69
69
|
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
|
|
@@ -72,7 +72,7 @@ async function run() {
|
|
|
72
72
|
const hasWebpackConfig = doesFileExist.doesFileExist(paths.paths.appWebpackConfig);
|
|
73
73
|
|
|
74
74
|
// Warn and crash if required files are missing
|
|
75
|
-
if (!checkRequiredFiles__default
|
|
75
|
+
if (!checkRequiredFiles__default.default([])) {
|
|
76
76
|
process.exit(1);
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -82,25 +82,25 @@ async function run() {
|
|
|
82
82
|
|
|
83
83
|
// Remove all content but keep the directory so that
|
|
84
84
|
// if you're in it, you don't end up in Trash
|
|
85
|
-
fs__default
|
|
85
|
+
fs__default.default.emptyDirSync(paths.paths.appBuild);
|
|
86
86
|
// Copy default files
|
|
87
87
|
copyDefaultFiles();
|
|
88
88
|
try {
|
|
89
89
|
// Start the webpack build
|
|
90
90
|
const result = await build();
|
|
91
91
|
if (result.warnings.length) {
|
|
92
|
-
console.log(chalk__default
|
|
92
|
+
console.log(chalk__default.default.yellow('Compiled with warnings.\n'));
|
|
93
93
|
console.log(result.warnings.join('\n\n'));
|
|
94
94
|
console.log('\n');
|
|
95
95
|
} else {
|
|
96
|
-
console.log(chalk__default
|
|
96
|
+
console.log(chalk__default.default.green('Compiled successfully.\n'));
|
|
97
97
|
}
|
|
98
98
|
console.log('File sizes after gzip:\n');
|
|
99
99
|
printFileSizesAfterBuild(result.stats, previousFileSizes, paths.paths.appBuild, WARN_AFTER_BUNDLE_GZIP_SIZE, WARN_AFTER_CHUNK_GZIP_SIZE);
|
|
100
100
|
console.log();
|
|
101
101
|
} catch (error) {
|
|
102
102
|
if (error instanceof Error) {
|
|
103
|
-
printBuildError__default
|
|
103
|
+
printBuildError__default.default(error);
|
|
104
104
|
}
|
|
105
105
|
throw new Error(`Failed to compile`);
|
|
106
106
|
}
|
|
@@ -109,11 +109,11 @@ async function run() {
|
|
|
109
109
|
async function build() {
|
|
110
110
|
console.log('Creating an optimized production build...');
|
|
111
111
|
const config = hasWebpackConfig ? require(paths.paths.appWebpackConfig) : createWebpackConfigForProduction.createWebpackConfigForProduction();
|
|
112
|
-
const compiler = webpack__default
|
|
112
|
+
const compiler = webpack__default.default(config);
|
|
113
113
|
if (!compiler) {
|
|
114
|
-
return _Promise__default
|
|
114
|
+
return _Promise__default.default.reject(new Error('Failed to create webpack compiler'));
|
|
115
115
|
}
|
|
116
|
-
return new _Promise__default
|
|
116
|
+
return new _Promise__default.default((resolve, reject) => {
|
|
117
117
|
compiler.run((err, stats) => {
|
|
118
118
|
let messages;
|
|
119
119
|
if (err) {
|
|
@@ -127,13 +127,13 @@ async function run() {
|
|
|
127
127
|
// @ts-ignore
|
|
128
128
|
err['postcssNode'].selector;
|
|
129
129
|
}
|
|
130
|
-
messages = formatWebpackMessages__default
|
|
130
|
+
messages = formatWebpackMessages__default.default({
|
|
131
131
|
// @ts-ignore
|
|
132
132
|
errors: [errMessage],
|
|
133
133
|
warnings: []
|
|
134
134
|
});
|
|
135
135
|
} else {
|
|
136
|
-
messages = formatWebpackMessages__default
|
|
136
|
+
messages = formatWebpackMessages__default.default(stats?.toJson({
|
|
137
137
|
all: false,
|
|
138
138
|
warnings: true,
|
|
139
139
|
errors: true
|
|
@@ -148,7 +148,7 @@ async function run() {
|
|
|
148
148
|
return reject(new Error(messages.errors.join('\n\n')));
|
|
149
149
|
}
|
|
150
150
|
if (process.env.CI && (typeof process.env.CI !== 'string' || process.env.CI.toLowerCase() !== 'false') && messages.warnings.length) {
|
|
151
|
-
console.log(chalk__default
|
|
151
|
+
console.log(chalk__default.default.yellow('\nTreating warnings as errors because process.env.CI = true.\n' + 'Most CI servers set it automatically.\n'));
|
|
152
152
|
return reject(new Error(messages.warnings.join('\n\n')));
|
|
153
153
|
}
|
|
154
154
|
return resolve({
|
|
@@ -159,10 +159,10 @@ async function run() {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
function copyDefaultFiles() {
|
|
162
|
-
fs__default
|
|
162
|
+
fs__default.default.copySync(path__default.default.join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
|
|
163
163
|
dereference: true
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
exports
|
|
168
|
+
exports.default = run;
|
|
@@ -8,9 +8,9 @@ import formatWebpackMessages from 'react-dev-utils/formatWebpackMessages';
|
|
|
8
8
|
import printBuildError from 'react-dev-utils/printBuildError';
|
|
9
9
|
import webpack from 'webpack';
|
|
10
10
|
import { packageLocation } from '@commercetools-frontend/assets';
|
|
11
|
-
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-
|
|
12
|
-
import { p as paths } from './paths-
|
|
13
|
-
import { d as doesFileExist } from './does-file-exist-
|
|
11
|
+
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-BY0UNoNz.esm.js';
|
|
12
|
+
import { p as paths } from './paths-Cg5Vq6RE.esm.js';
|
|
13
|
+
import { d as doesFileExist } from './does-file-exist-C7l6j7NP.esm.js';
|
|
14
14
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
15
15
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
16
16
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
@@ -38,13 +38,13 @@ import '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
|
38
38
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
39
39
|
import '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
40
40
|
import 'fs';
|
|
41
|
-
import './create-postcss-config-
|
|
41
|
+
import './create-postcss-config-CN9_8Usa.esm.js';
|
|
42
42
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
43
|
-
import './package-
|
|
44
|
-
import './optimizations-
|
|
43
|
+
import './package-BiK3ergJ.esm.js';
|
|
44
|
+
import './optimizations-Cjrg77Gu.esm.js';
|
|
45
45
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
46
46
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
47
|
-
import './vendors-to-transpile-
|
|
47
|
+
import './vendors-to-transpile-uu9TNPDO.esm.js';
|
|
48
48
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
49
49
|
import 'node:fs';
|
|
50
50
|
|
|
@@ -10,7 +10,7 @@ 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 { p as paths } from './paths-
|
|
13
|
+
import { p as paths } from './paths-Cg5Vq6RE.esm.js';
|
|
14
14
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
15
15
|
import _Object$values from '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
16
16
|
import _Map from '@babel/runtime-corejs3/core-js-stable/map';
|
|
@@ -22,14 +22,14 @@ import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instan
|
|
|
22
22
|
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
23
23
|
import { compile } from '@formatjs/cli-lib';
|
|
24
24
|
import { createFilter } from '@rollup/pluginutils';
|
|
25
|
-
import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-
|
|
25
|
+
import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-BRZ7ffQI.esm.js';
|
|
26
26
|
import fs from 'node:fs';
|
|
27
27
|
import path from 'node:path';
|
|
28
28
|
import { globSync } from 'glob';
|
|
29
|
-
import { v as vitePluginSvgr } from './vite-plugin-svgr-
|
|
29
|
+
import { v as vitePluginSvgr } from './vite-plugin-svgr-B1JerYlQ.esm.js';
|
|
30
30
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
31
31
|
import 'fs';
|
|
32
|
-
import './does-file-exist-
|
|
32
|
+
import './does-file-exist-C7l6j7NP.esm.js';
|
|
33
33
|
import 'chalk';
|
|
34
34
|
import 'crypto';
|
|
35
35
|
import '@babel/runtime-corejs3/core-js/instance/match-all';
|
|
@@ -207,7 +207,7 @@ function pluginPostCleanup(options) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
if (
|
|
210
|
+
if (patterns.length > 0 && totalFilesDeleted === 0) {
|
|
211
211
|
console.log('[post-cleanup] No files matched the patterns');
|
|
212
212
|
}
|
|
213
213
|
}
|
|
@@ -275,12 +275,22 @@ async function run() {
|
|
|
275
275
|
// https://vitejs.dev/guide/build.html#advanced-base-options
|
|
276
276
|
renderBuiltUrl(filename, _ref) {
|
|
277
277
|
let hostType = _ref.hostType;
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
switch (hostType) {
|
|
279
|
+
case 'html':
|
|
280
|
+
{
|
|
281
|
+
return `__CDN_URL__${filename}`;
|
|
282
|
+
}
|
|
283
|
+
case 'css':
|
|
284
|
+
// Vite does not support `{ runtime: ... }` for assets referenced from CSS
|
|
285
|
+
// (e.g. KaTeX fonts pulled in via CopilotKit → streamdown). Use relative URLs.
|
|
286
|
+
return {
|
|
287
|
+
relative: true
|
|
288
|
+
};
|
|
289
|
+
default:
|
|
290
|
+
return {
|
|
291
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify(filename)})`
|
|
292
|
+
};
|
|
280
293
|
}
|
|
281
|
-
return {
|
|
282
|
-
runtime: `window.__toCdnUrl(${_JSON$stringify(filename)})`
|
|
283
|
-
};
|
|
284
294
|
}
|
|
285
295
|
},
|
|
286
296
|
plugins: [vitePluginSvgr(), pluginGraphql(), pluginReact({
|
|
@@ -12,7 +12,7 @@ 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 paths = require('./paths-
|
|
15
|
+
var paths = require('./paths-DtvtCG0U.cjs.prod.js');
|
|
16
16
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
17
17
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
18
18
|
var _Map = require('@babel/runtime-corejs3/core-js-stable/map');
|
|
@@ -24,19 +24,19 @@ var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/inst
|
|
|
24
24
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
25
25
|
var cliLib = require('@formatjs/cli-lib');
|
|
26
26
|
var pluginutils = require('@rollup/pluginutils');
|
|
27
|
-
var i18nMessageComplilation = require('./i18n-message-complilation-
|
|
27
|
+
var i18nMessageComplilation = require('./i18n-message-complilation-CdVhuyWk.cjs.prod.js');
|
|
28
28
|
var fs = require('node:fs');
|
|
29
29
|
var path = require('node:path');
|
|
30
30
|
var glob = require('glob');
|
|
31
|
-
var vitePluginSvgr = require('./vite-plugin-svgr-
|
|
31
|
+
var vitePluginSvgr = require('./vite-plugin-svgr-CRRIY_Py.cjs.prod.js');
|
|
32
32
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
33
33
|
require('fs');
|
|
34
|
-
require('./does-file-exist-
|
|
34
|
+
require('./does-file-exist-DrcZIPe6.cjs.prod.js');
|
|
35
35
|
require('chalk');
|
|
36
36
|
require('crypto');
|
|
37
37
|
require('@babel/runtime-corejs3/core-js/instance/match-all');
|
|
38
38
|
|
|
39
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
39
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
40
40
|
|
|
41
41
|
var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
|
|
42
42
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
@@ -86,7 +86,7 @@ function pluginChunkCycleCheck() {
|
|
|
86
86
|
generateBundle(_, bundle) {
|
|
87
87
|
const cycles = findChunkCycles(bundle);
|
|
88
88
|
if (cycles.length === 0) return;
|
|
89
|
-
const formatted = _mapInstanceProperty__default
|
|
89
|
+
const formatted = _mapInstanceProperty__default.default(cycles).call(cycles, cycle => ` ${cycle.join(' → ')}`).join('\n');
|
|
90
90
|
const message = `Detected circular imports between output chunks:\n${formatted}\n` + `\nChunk cycles produce TDZ runtime errors (e.g. "X is undefined") ` + `because Rollup emits real ESM and one chunk can observe another ` + `chunk's not-yet-initialized top-level vars mid-evaluation. ` + `Review \`output.manualChunks\` or any plugin assigning chunks.`;
|
|
91
91
|
if (onCycle === 'error') {
|
|
92
92
|
this.error(message);
|
|
@@ -103,8 +103,8 @@ function pluginChunkCycleCheck() {
|
|
|
103
103
|
*/
|
|
104
104
|
function findChunkCycles(bundle) {
|
|
105
105
|
var _context;
|
|
106
|
-
const chunks = _filterInstanceProperty__default
|
|
107
|
-
const graph = new _Map__default
|
|
106
|
+
const chunks = _filterInstanceProperty__default.default(_context = _Object$values__default.default(bundle)).call(_context, entry => entry.type === 'chunk');
|
|
107
|
+
const graph = new _Map__default.default();
|
|
108
108
|
for (const chunk of chunks) {
|
|
109
109
|
// `imports` covers static imports between chunks. `dynamicImports` are
|
|
110
110
|
// deliberately ignored — those create legitimate lazy boundaries that
|
|
@@ -114,10 +114,10 @@ function findChunkCycles(bundle) {
|
|
|
114
114
|
const WHITE = 0;
|
|
115
115
|
const GRAY = 1;
|
|
116
116
|
const BLACK = 2;
|
|
117
|
-
const color = new _Map__default
|
|
118
|
-
for (const name of _keysInstanceProperty__default
|
|
117
|
+
const color = new _Map__default.default();
|
|
118
|
+
for (const name of _keysInstanceProperty__default.default(graph).call(graph)) color.set(name, WHITE);
|
|
119
119
|
const cycles = [];
|
|
120
|
-
const seenCycleKeys = new _Set__default
|
|
120
|
+
const seenCycleKeys = new _Set__default.default();
|
|
121
121
|
const pathStack = [];
|
|
122
122
|
const visit = node => {
|
|
123
123
|
color.set(node, GRAY);
|
|
@@ -128,11 +128,11 @@ function findChunkCycles(bundle) {
|
|
|
128
128
|
const nextColor = color.get(next);
|
|
129
129
|
if (nextColor === GRAY) {
|
|
130
130
|
var _context2, _context3, _context4;
|
|
131
|
-
const startIdx = _indexOfInstanceProperty__default
|
|
132
|
-
const cycle = _concatInstanceProperty__default
|
|
131
|
+
const startIdx = _indexOfInstanceProperty__default.default(pathStack).call(pathStack, next);
|
|
132
|
+
const cycle = _concatInstanceProperty__default.default(_context2 = _sliceInstanceProperty__default.default(pathStack).call(pathStack, startIdx)).call(_context2, next);
|
|
133
133
|
// Normalize so we report each elementary cycle only once regardless
|
|
134
134
|
// of which node in the cycle DFS entered from.
|
|
135
|
-
const key = _sortInstanceProperty__default
|
|
135
|
+
const key = _sortInstanceProperty__default.default(_context3 = _sliceInstanceProperty__default.default(_context4 = [...cycle]).call(_context4, 0, -1)).call(_context3).join('|');
|
|
136
136
|
if (!seenCycleKeys.has(key)) {
|
|
137
137
|
seenCycleKeys.add(key);
|
|
138
138
|
cycles.push(cycle);
|
|
@@ -144,7 +144,7 @@ function findChunkCycles(bundle) {
|
|
|
144
144
|
pathStack.pop();
|
|
145
145
|
color.set(node, BLACK);
|
|
146
146
|
};
|
|
147
|
-
for (const node of _keysInstanceProperty__default
|
|
147
|
+
for (const node of _keysInstanceProperty__default.default(graph).call(graph)) {
|
|
148
148
|
if (color.get(node) === WHITE) visit(node);
|
|
149
149
|
}
|
|
150
150
|
return cycles;
|
|
@@ -218,9 +218,9 @@ function pluginPostCleanup(options) {
|
|
|
218
218
|
cwd: outputDir
|
|
219
219
|
});
|
|
220
220
|
for (const file of files) {
|
|
221
|
-
const filePath = path__default
|
|
221
|
+
const filePath = path__default.default.join(outputDir, file);
|
|
222
222
|
try {
|
|
223
|
-
fs__default
|
|
223
|
+
fs__default.default.unlinkSync(filePath);
|
|
224
224
|
totalFilesDeleted++;
|
|
225
225
|
if (verbose) {
|
|
226
226
|
console.log(`[post-cleanup] Deleted: ${file}`);
|
|
@@ -230,7 +230,7 @@ function pluginPostCleanup(options) {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
if (
|
|
233
|
+
if (patterns.length > 0 && totalFilesDeleted === 0) {
|
|
234
234
|
console.log('[post-cleanup] No files matched the patterns');
|
|
235
235
|
}
|
|
236
236
|
}
|
|
@@ -239,22 +239,22 @@ function pluginPostCleanup(options) {
|
|
|
239
239
|
|
|
240
240
|
async function run() {
|
|
241
241
|
var _context;
|
|
242
|
-
const DEFAULT_PORT = _parseInt__default
|
|
242
|
+
const DEFAULT_PORT = _parseInt__default.default(String(process.env.HTTP_PORT), 10) || 3001;
|
|
243
243
|
|
|
244
244
|
// Ensure the `/public` folder exists.
|
|
245
|
-
fs__default$1
|
|
245
|
+
fs__default$1.default.mkdirSync(paths.paths.appBuild, {
|
|
246
246
|
recursive: true
|
|
247
247
|
});
|
|
248
248
|
|
|
249
249
|
// Generate `index.html` (template).
|
|
250
|
-
const appEntryPoint = path__default$1
|
|
250
|
+
const appEntryPoint = path__default$1.default.relative(paths.paths.appRoot, paths.paths.entryPoint);
|
|
251
251
|
const html = mcHtmlTemplate.generateTemplate({
|
|
252
252
|
// Define the module entry point (path relative from the `/public` folder).
|
|
253
253
|
// NOTE: that this is different from the development configuration.
|
|
254
254
|
scriptImports: [`<script type="module" src="/${appEntryPoint}" defer></script>`]
|
|
255
255
|
});
|
|
256
256
|
// Write `index.html` (template) into the `/public` folder.
|
|
257
|
-
fs__default$1
|
|
257
|
+
fs__default$1.default.writeFileSync(paths.paths.appIndexHtml, html, {
|
|
258
258
|
encoding: 'utf8'
|
|
259
259
|
});
|
|
260
260
|
await vite.build({
|
|
@@ -262,8 +262,8 @@ async function run() {
|
|
|
262
262
|
base: './',
|
|
263
263
|
// <-- Important to allow configuring the runtime base path.
|
|
264
264
|
define: {
|
|
265
|
-
'process.env.DEBUG': _JSON$stringify__default
|
|
266
|
-
'process.env.NODE_ENV': _JSON$stringify__default
|
|
265
|
+
'process.env.DEBUG': _JSON$stringify__default.default(false),
|
|
266
|
+
'process.env.NODE_ENV': _JSON$stringify__default.default('production')
|
|
267
267
|
},
|
|
268
268
|
build: {
|
|
269
269
|
outDir: 'public',
|
|
@@ -298,18 +298,28 @@ async function run() {
|
|
|
298
298
|
// https://vitejs.dev/guide/build.html#advanced-base-options
|
|
299
299
|
renderBuiltUrl(filename, _ref) {
|
|
300
300
|
let hostType = _ref.hostType;
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
switch (hostType) {
|
|
302
|
+
case 'html':
|
|
303
|
+
{
|
|
304
|
+
return `__CDN_URL__${filename}`;
|
|
305
|
+
}
|
|
306
|
+
case 'css':
|
|
307
|
+
// Vite does not support `{ runtime: ... }` for assets referenced from CSS
|
|
308
|
+
// (e.g. KaTeX fonts pulled in via CopilotKit → streamdown). Use relative URLs.
|
|
309
|
+
return {
|
|
310
|
+
relative: true
|
|
311
|
+
};
|
|
312
|
+
default:
|
|
313
|
+
return {
|
|
314
|
+
runtime: `window.__toCdnUrl(${_JSON$stringify__default.default(filename)})`
|
|
315
|
+
};
|
|
303
316
|
}
|
|
304
|
-
return {
|
|
305
|
-
runtime: `window.__toCdnUrl(${_JSON$stringify__default["default"](filename)})`
|
|
306
|
-
};
|
|
307
317
|
}
|
|
308
318
|
},
|
|
309
|
-
plugins: [vitePluginSvgr.vitePluginSvgr(), pluginGraphql__default
|
|
319
|
+
plugins: [vitePluginSvgr.vitePluginSvgr(), pluginGraphql__default.default(), pluginReact__default.default({
|
|
310
320
|
jsxImportSource: '@emotion/react',
|
|
311
321
|
babel: {
|
|
312
|
-
plugins: _filterInstanceProperty__default
|
|
322
|
+
plugins: _filterInstanceProperty__default.default(_context = ['@emotion/babel-plugin', '@babel/plugin-proposal-do-expressions', process.env.ENABLE_BABEL_PLUGIN_FORMATJS === 'true' ? ['babel-plugin-formatjs', {
|
|
313
323
|
removeDefaultMessage:
|
|
314
324
|
// Remove default `formatjs` messages from bundles.
|
|
315
325
|
// TODO: make it a CLI option when Vite support becomes stable.
|
|
@@ -340,19 +350,19 @@ async function run() {
|
|
|
340
350
|
});
|
|
341
351
|
|
|
342
352
|
// Rename `/public/public/index.html` to `/public/index.html.template`
|
|
343
|
-
fs__default$1
|
|
353
|
+
fs__default$1.default.renameSync(
|
|
344
354
|
// Because of our custom entry point path (`/public/index.html`),
|
|
345
355
|
// Vite will write the `index.html` to `/public/public/index.html`.
|
|
346
356
|
// We need to move this file to the `/public` folder and rename it
|
|
347
357
|
// to `index.html.template` (as expected by the `compile-html` command).
|
|
348
|
-
path__default$1
|
|
358
|
+
path__default$1.default.join(paths.paths.appBuild, 'public/index.html'), paths.paths.appIndexHtmlTemplate);
|
|
349
359
|
// Clean up nested folder
|
|
350
|
-
fs__default$1
|
|
360
|
+
fs__default$1.default.rmdirSync(path__default$1.default.join(paths.paths.appBuild, 'public'));
|
|
351
361
|
|
|
352
362
|
// Copy public assets
|
|
353
|
-
fs__default$1
|
|
363
|
+
fs__default$1.default.copySync(path__default$1.default.join(assets.packageLocation, 'html-page'), paths.paths.appBuild, {
|
|
354
364
|
dereference: true
|
|
355
365
|
});
|
|
356
366
|
}
|
|
357
367
|
|
|
358
|
-
exports
|
|
368
|
+
exports.default = run;
|