@commercetools-frontend/mc-scripts 27.5.1 → 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-7c7442bd.cjs.prod.js → build-BP3m-wjz.cjs.prod.js} +23 -23
- package/dist/{build-2cbde331.cjs.dev.js → build-Dq8dqtsd.cjs.dev.js} +23 -23
- package/dist/{build-4ab9306b.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-d5c4aa9b.esm.js → config-sync-Bu7U5gn5.esm.js} +5 -5
- package/dist/{config-sync-7ae74804.cjs.dev.js → config-sync-Cd0sSSrd.cjs.dev.js} +22 -22
- package/dist/{config-sync-d3d5d721.cjs.prod.js → config-sync-D6xLjo9S.cjs.prod.js} +22 -22
- package/dist/{config-sync-ci-d3104a62.cjs.prod.js → config-sync-ci-CXgQcemF.cjs.prod.js} +21 -21
- package/dist/{config-sync-ci-9c50ed6f.esm.js → config-sync-ci-Dq7bAqeu.esm.js} +5 -5
- package/dist/{config-sync-ci-732e0c5d.cjs.dev.js → config-sync-ci-SDsF-Onw.cjs.dev.js} +21 -21
- package/dist/{config-sync-helpers-ea628bce.cjs.prod.js → config-sync-helpers-9kvPwuoy.cjs.prod.js} +47 -47
- package/dist/{config-sync-helpers-bea5f027.esm.js → config-sync-helpers-BLXJp1-D.esm.js} +3 -3
- package/dist/{config-sync-helpers-178da465.cjs.dev.js → config-sync-helpers-DUK45F_R.cjs.dev.js} +47 -47
- package/dist/{create-postcss-config-f6a5f68b.esm.js → create-postcss-config-CN9_8Usa.esm.js} +1 -1
- package/dist/{create-postcss-config-3f3bda09.cjs.prod.js → create-postcss-config-DAShdAyB.cjs.prod.js} +3 -3
- package/dist/{create-postcss-config-e4c767b4.cjs.dev.js → create-postcss-config-NN2FAhvH.cjs.dev.js} +3 -3
- package/dist/{create-webpack-config-for-development-c6e48557.esm.js → create-webpack-config-for-development-5HpRHV9G.esm.js} +5 -5
- package/dist/{create-webpack-config-for-development-4a2616e9.cjs.prod.js → create-webpack-config-for-development-CxGehl7I.cjs.prod.js} +25 -25
- package/dist/{create-webpack-config-for-development-a2df037a.cjs.dev.js → create-webpack-config-for-development-hxSNyq2_.cjs.dev.js} +25 -25
- package/dist/{create-webpack-config-for-production-04a7a9f8.esm.js → create-webpack-config-for-production-BY0UNoNz.esm.js} +5 -5
- package/dist/{create-webpack-config-for-production-443f6fe7.cjs.prod.js → create-webpack-config-for-production-CW0DlZBz.cjs.prod.js} +32 -32
- package/dist/{create-webpack-config-for-production-12e257fc.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-491442d7.cjs.dev.js → deployment-previews-set-BuHX8wKo.cjs.dev.js} +22 -22
- package/dist/{deployment-previews-set-4b020cb4.esm.js → deployment-previews-set-C2OPIfy-.esm.js} +4 -4
- package/dist/{deployment-previews-set-2b334c11.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-bd7a3fe9.cjs.dev.js → graphql-requests-BeUd4g3v.cjs.dev.js} +9 -9
- package/dist/{graphql-requests-6ead2029.cjs.prod.js → graphql-requests-D0rtMo7K.cjs.prod.js} +9 -9
- package/dist/{graphql-requests-87338c52.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-2d10deff.cjs.dev.js → login-BagHOLO1.cjs.prod.js} +42 -60
- package/dist/{login-26cfe1af.cjs.prod.js → login-DKzmRa46.cjs.dev.js} +42 -60
- package/dist/{login-ab249036.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-19facf6d.cjs.prod.js → start-CQgQhNhU.cjs.prod.js} +17 -17
- package/dist/{start-9b1252f9.cjs.dev.js → start-OjGog63p.cjs.dev.js} +17 -17
- package/dist/{start-3c1e5902.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-62998a4b.cjs.prod.js +0 -167
- package/dist/package-a686a0ee.esm.js +0 -165
- package/dist/package-fe1840f3.cjs.dev.js +0 -167
- /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
|
@@ -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-B0WM5jb9.cjs.dev.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.dev.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.dev.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.dev.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;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
3
|
+
var vendorsToTranspile = require('./vendors-to-transpile-DLHlk7c-.cjs.dev.js');
|
|
6
4
|
|
|
7
5
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "27.5.
|
|
6
|
+
var version = "27.5.3";
|
|
9
7
|
|
|
10
8
|
// These exports are deprecated.
|
|
11
9
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
3
|
+
var vendorsToTranspile = require('./vendors-to-transpile-DLHlk7c-.cjs.prod.js');
|
|
6
4
|
|
|
7
5
|
// NOTE: This string will be replaced on build time with the package version.
|
|
8
|
-
var version = "27.5.
|
|
6
|
+
var version = "27.5.3";
|
|
9
7
|
|
|
10
8
|
// These exports are deprecated.
|
|
11
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { v as vendorsToTranspile } from './vendors-to-transpile-
|
|
1
|
+
export { v as vendorsToTranspile } from './vendors-to-transpile-uu9TNPDO.esm.js';
|
|
2
2
|
|
|
3
3
|
// NOTE: This string will be replaced on build time with the package version.
|
|
4
|
-
var version = "27.5.
|
|
4
|
+
var version = "27.5.3";
|
|
5
5
|
|
|
6
6
|
// These exports are deprecated.
|
|
7
7
|
|
|
@@ -2,10 +2,10 @@ import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringif
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { compileHtml } from '@commercetools-frontend/mc-html-template';
|
|
5
|
-
import { p as paths } from './paths-
|
|
5
|
+
import { p as paths } from './paths-Cg5Vq6RE.esm.js';
|
|
6
6
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
7
7
|
import 'path';
|
|
8
|
-
import './does-file-exist-
|
|
8
|
+
import './does-file-exist-C7l6j7NP.esm.js';
|
|
9
9
|
import 'node:fs';
|
|
10
10
|
|
|
11
11
|
const appDirectory = fs.realpathSync(process.cwd());
|
|
@@ -4,23 +4,23 @@ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/string
|
|
|
4
4
|
var fs = require('fs');
|
|
5
5
|
var chalk = require('chalk');
|
|
6
6
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
7
|
-
var paths = require('./paths-
|
|
7
|
+
var paths = require('./paths-DtvtCG0U.cjs.prod.js');
|
|
8
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
9
9
|
require('path');
|
|
10
|
-
require('./does-file-exist-
|
|
10
|
+
require('./does-file-exist-DrcZIPe6.cjs.prod.js');
|
|
11
11
|
require('node:fs');
|
|
12
12
|
|
|
13
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
|
|
15
15
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
16
16
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
17
17
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
18
18
|
|
|
19
|
-
const appDirectory = fs__default
|
|
19
|
+
const appDirectory = fs__default.default.realpathSync(process.cwd());
|
|
20
20
|
async function run(options) {
|
|
21
21
|
console.log('Compiling index.html...');
|
|
22
22
|
const compiled = await mcHtmlTemplate.compileHtml(paths.paths.appIndexHtmlTemplate);
|
|
23
|
-
fs__default
|
|
23
|
+
fs__default.default.writeFileSync(paths.paths.appIndexHtml, compiled.indexHtmlContent, {
|
|
24
24
|
encoding: 'utf8'
|
|
25
25
|
});
|
|
26
26
|
if (options.transformer) {
|
|
@@ -34,9 +34,9 @@ async function run(options) {
|
|
|
34
34
|
throw new Error(`Could not load transformer module "${options.transformer}"\n${error instanceof Error ? error.stack : ''}`);
|
|
35
35
|
}
|
|
36
36
|
} else if (options.printSecurityHeaders) {
|
|
37
|
-
console.log(_JSON$stringify__default
|
|
37
|
+
console.log(_JSON$stringify__default.default(compiled.headers));
|
|
38
38
|
}
|
|
39
|
-
console.log(chalk__default
|
|
39
|
+
console.log(chalk__default.default.green('Compiled successfully.\n'));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
exports
|
|
42
|
+
exports.default = run;
|
|
@@ -4,23 +4,23 @@ var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/string
|
|
|
4
4
|
var fs = require('fs');
|
|
5
5
|
var chalk = require('chalk');
|
|
6
6
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
7
|
-
var paths = require('./paths-
|
|
7
|
+
var paths = require('./paths-B0WM5jb9.cjs.dev.js');
|
|
8
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
9
9
|
require('path');
|
|
10
|
-
require('./does-file-exist-
|
|
10
|
+
require('./does-file-exist-DrcZIPe6.cjs.dev.js');
|
|
11
11
|
require('node:fs');
|
|
12
12
|
|
|
13
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
|
|
15
15
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
16
16
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
17
17
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
18
18
|
|
|
19
|
-
const appDirectory = fs__default
|
|
19
|
+
const appDirectory = fs__default.default.realpathSync(process.cwd());
|
|
20
20
|
async function run(options) {
|
|
21
21
|
console.log('Compiling index.html...');
|
|
22
22
|
const compiled = await mcHtmlTemplate.compileHtml(paths.paths.appIndexHtmlTemplate);
|
|
23
|
-
fs__default
|
|
23
|
+
fs__default.default.writeFileSync(paths.paths.appIndexHtml, compiled.indexHtmlContent, {
|
|
24
24
|
encoding: 'utf8'
|
|
25
25
|
});
|
|
26
26
|
if (options.transformer) {
|
|
@@ -34,9 +34,9 @@ async function run(options) {
|
|
|
34
34
|
throw new Error(`Could not load transformer module "${options.transformer}"\n${error instanceof Error ? error.stack : ''}`);
|
|
35
35
|
}
|
|
36
36
|
} else if (options.printSecurityHeaders) {
|
|
37
|
-
console.log(_JSON$stringify__default
|
|
37
|
+
console.log(_JSON$stringify__default.default(compiled.headers));
|
|
38
38
|
}
|
|
39
|
-
console.log(chalk__default
|
|
39
|
+
console.log(chalk__default.default.green('Compiled successfully.\n'));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
exports
|
|
42
|
+
exports.default = run;
|
|
@@ -5,9 +5,9 @@ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import prompts from 'prompts';
|
|
7
7
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
8
|
-
import { i as isCustomViewData, c as
|
|
9
|
-
import { C as CredentialsStorage } from './credentials-storage-
|
|
10
|
-
import { f as fetchUserOrganizations } from './graphql-requests-
|
|
8
|
+
import { i as isCustomViewData, c as checkCustomViewStatus, p as performCreateCustomView, a as performUpdateCustomView, b as checkCustomApplicationStatus, d as performCreateCustomApplication, e as performUpdateCustomApplication } from './config-sync-helpers-BLXJp1-D.esm.js';
|
|
9
|
+
import { C as CredentialsStorage } from './credentials-storage-B79bb0Ns.esm.js';
|
|
10
|
+
import { f as fetchUserOrganizations } from './graphql-requests-DCLX_2y0.esm.js';
|
|
11
11
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
12
12
|
import 'lodash/omit';
|
|
13
13
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
@@ -28,13 +28,13 @@ import '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
|
28
28
|
import 'node:fs';
|
|
29
29
|
import 'node:os';
|
|
30
30
|
import 'node:path';
|
|
31
|
-
import './does-file-exist-
|
|
31
|
+
import './does-file-exist-C7l6j7NP.esm.js';
|
|
32
32
|
import '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
33
33
|
import 'graphql';
|
|
34
34
|
import 'graphql-request';
|
|
35
35
|
import '@commercetools-frontend/constants';
|
|
36
36
|
import '@commercetools/http-user-agent';
|
|
37
|
-
import './package-
|
|
37
|
+
import './package-BiK3ergJ.esm.js';
|
|
38
38
|
|
|
39
39
|
const credentialsStorage = new CredentialsStorage();
|
|
40
40
|
async function promptForOrganization(_ref) {
|
|
@@ -7,9 +7,9 @@ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
7
7
|
var chalk = require('chalk');
|
|
8
8
|
var prompts = require('prompts');
|
|
9
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
10
|
-
var configSyncHelpers = require('./config-sync-helpers-
|
|
11
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
12
|
-
var graphqlRequests = require('./graphql-requests-
|
|
10
|
+
var configSyncHelpers = require('./config-sync-helpers-DUK45F_R.cjs.dev.js');
|
|
11
|
+
var credentialsStorage$1 = require('./credentials-storage-B0tDCH7i.cjs.dev.js');
|
|
12
|
+
var graphqlRequests = require('./graphql-requests-BeUd4g3v.cjs.dev.js');
|
|
13
13
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
14
14
|
require('lodash/omit');
|
|
15
15
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -30,15 +30,15 @@ require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
|
30
30
|
require('node:fs');
|
|
31
31
|
require('node:os');
|
|
32
32
|
require('node:path');
|
|
33
|
-
require('./does-file-exist-
|
|
33
|
+
require('./does-file-exist-DrcZIPe6.cjs.dev.js');
|
|
34
34
|
require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
35
35
|
require('graphql');
|
|
36
36
|
require('graphql-request');
|
|
37
37
|
require('@commercetools-frontend/constants');
|
|
38
38
|
require('@commercetools/http-user-agent');
|
|
39
|
-
require('./package-
|
|
39
|
+
require('./package-B1Y3_DDl.cjs.dev.js');
|
|
40
40
|
|
|
41
|
-
function _interopDefault (e) { return e && e.__esModule ? e : {
|
|
41
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
42
42
|
|
|
43
43
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
44
44
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
@@ -69,11 +69,11 @@ async function promptForOrganization(_ref) {
|
|
|
69
69
|
name: organization.name
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const organizationChoices = _mapInstanceProperty__default
|
|
72
|
+
const organizationChoices = _mapInstanceProperty__default.default(_context = userOrganizations.results).call(_context, organization => ({
|
|
73
73
|
title: organization.name,
|
|
74
74
|
value: organization.id
|
|
75
75
|
}));
|
|
76
|
-
const _await$prompts = await prompts__default
|
|
76
|
+
const _await$prompts = await prompts__default.default({
|
|
77
77
|
type: 'select',
|
|
78
78
|
name: 'organizationId',
|
|
79
79
|
message: 'Select an Organization',
|
|
@@ -84,7 +84,7 @@ async function promptForOrganization(_ref) {
|
|
|
84
84
|
if (!selectedOrganizationId) {
|
|
85
85
|
throw new Error(`No Organization selected, aborting.`);
|
|
86
86
|
}
|
|
87
|
-
const organizationName = _findInstanceProperty__default
|
|
87
|
+
const organizationName = _findInstanceProperty__default.default(organizationChoices).call(organizationChoices, _ref2 => {
|
|
88
88
|
let value = _ref2.value;
|
|
89
89
|
return value === selectedOrganizationId;
|
|
90
90
|
}).title;
|
|
@@ -98,15 +98,15 @@ async function confirmAction(_ref3) {
|
|
|
98
98
|
let message = _ref3.message,
|
|
99
99
|
dryRun = _ref3.dryRun,
|
|
100
100
|
dryRunMessage = _ref3.dryRunMessage;
|
|
101
|
-
const _await$prompts2 = await prompts__default
|
|
101
|
+
const _await$prompts2 = await prompts__default.default({
|
|
102
102
|
type: 'text',
|
|
103
103
|
name: 'confirmation',
|
|
104
|
-
message: _filterInstanceProperty__default
|
|
104
|
+
message: _filterInstanceProperty__default.default(_context2 = [message, dryRun && chalk__default.default.gray(dryRunMessage)]).call(_context2, Boolean).join('\n'),
|
|
105
105
|
initial: 'yes'
|
|
106
106
|
}),
|
|
107
107
|
confirmation = _await$prompts2.confirmation;
|
|
108
108
|
if (!confirmation || confirmation.toLowerCase().charAt(0) !== 'y') {
|
|
109
|
-
console.log(chalk__default
|
|
109
|
+
console.log(chalk__default.default.red('Aborted.'));
|
|
110
110
|
return false;
|
|
111
111
|
}
|
|
112
112
|
return true;
|
|
@@ -130,7 +130,7 @@ async function createOrUpdateCustomApplication(_ref4) {
|
|
|
130
130
|
entityType: 'Custom Application'
|
|
131
131
|
});
|
|
132
132
|
const confirmed = await confirmAction({
|
|
133
|
-
message: `You are about to create a new Custom Application in the "${chalk__default
|
|
133
|
+
message: `You are about to create a new Custom Application in the "${chalk__default.default.green(organization.name)}" organization. Are you sure you want to proceed?`,
|
|
134
134
|
dryRun: options.dryRun,
|
|
135
135
|
dryRunMessage: 'Using "--dry-run", no data will be created.'
|
|
136
136
|
});
|
|
@@ -148,15 +148,15 @@ async function createOrUpdateCustomApplication(_ref4) {
|
|
|
148
148
|
|
|
149
149
|
// Check for changes
|
|
150
150
|
if (!status.configDiff) {
|
|
151
|
-
console.log(chalk__default
|
|
152
|
-
console.log(`You can inspect the Custom Application data in the Merchant Center at "${chalk__default
|
|
151
|
+
console.log(chalk__default.default.green(`Custom Application up-to-date.`));
|
|
152
|
+
console.log(`You can inspect the Custom Application data in the Merchant Center at "${chalk__default.default.gray(status.link)}".`);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
console.log('Changes detected:');
|
|
156
156
|
console.log(status.configDiff);
|
|
157
157
|
console.log();
|
|
158
158
|
const confirmed = await confirmAction({
|
|
159
|
-
message: `You are about to update the Custom Application "${chalk__default
|
|
159
|
+
message: `You are about to update the Custom Application "${chalk__default.default.green(localCustomEntityData.entryPointUriPath)}" with the changes above. Are you sure you want to proceed?`,
|
|
160
160
|
dryRun: options.dryRun,
|
|
161
161
|
dryRunMessage: 'Using "--dry-run", no data will be updated.'
|
|
162
162
|
});
|
|
@@ -191,7 +191,7 @@ async function createOrUpdateCustomView(_ref5) {
|
|
|
191
191
|
entityType: 'Custom View'
|
|
192
192
|
});
|
|
193
193
|
const confirmed = await confirmAction({
|
|
194
|
-
message: `You are about to create a new Custom View in the "${chalk__default
|
|
194
|
+
message: `You are about to create a new Custom View in the "${chalk__default.default.green(organization.name)}" organization. Are you sure you want to proceed?`,
|
|
195
195
|
dryRun: options.dryRun,
|
|
196
196
|
dryRunMessage: 'Using "--dry-run", no data will be created.'
|
|
197
197
|
});
|
|
@@ -209,15 +209,15 @@ async function createOrUpdateCustomView(_ref5) {
|
|
|
209
209
|
|
|
210
210
|
// Check for changes
|
|
211
211
|
if (!status.configDiff) {
|
|
212
|
-
console.log(chalk__default
|
|
213
|
-
console.log(`You can inspect the Custom View data in the Merchant Center at "${chalk__default
|
|
212
|
+
console.log(chalk__default.default.green(`Custom View up-to-date.`));
|
|
213
|
+
console.log(`You can inspect the Custom View data in the Merchant Center at "${chalk__default.default.gray(status.link)}".`);
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
console.log('Changes detected:');
|
|
217
217
|
console.log(status.configDiff);
|
|
218
218
|
console.log();
|
|
219
219
|
const confirmed = await confirmAction({
|
|
220
|
-
message: `You are about to update the Custom View "${chalk__default
|
|
220
|
+
message: `You are about to update the Custom View "${chalk__default.default.green(localCustomEntityData.defaultLabel)}" with the changes above. Are you sure you want to proceed?`,
|
|
221
221
|
dryRun: options.dryRun,
|
|
222
222
|
dryRunMessage: 'Using "--dry-run", no data will be updated.'
|
|
223
223
|
});
|
|
@@ -238,7 +238,7 @@ async function run(options) {
|
|
|
238
238
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
239
239
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier,
|
|
240
240
|
customViewId = _applicationConfig$en.customViewId;
|
|
241
|
-
console.log(`Using Merchant Center environment "${chalk__default
|
|
241
|
+
console.log(`Using Merchant Center environment "${chalk__default.default.green(mcApiUrl)}".`);
|
|
242
242
|
console.log();
|
|
243
243
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
244
244
|
if (!isSessionValid) {
|
|
@@ -262,4 +262,4 @@ async function run(options) {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
exports
|
|
265
|
+
exports.default = run;
|