@commercetools-frontend/mc-scripts 27.4.1 → 27.5.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.
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +15 -10
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +15 -10
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +15 -10
- package/dist/{build-8941e757.cjs.prod.js → build-2dde4016.cjs.prod.js} +4 -5
- package/dist/{build-43e4ad06.esm.js → build-51b09598.esm.js} +4 -5
- package/dist/{build-34cff19d.cjs.dev.js → build-7a3a4b48.cjs.dev.js} +4 -5
- package/dist/{build-vite-8cae71a0.esm.js → build-vite-1526e4f8.esm.js} +109 -20
- package/dist/{build-vite-837e7c94.cjs.dev.js → build-vite-2fb9320e.cjs.dev.js} +118 -20
- package/dist/{build-vite-b007241b.cjs.prod.js → build-vite-71889a4a.cjs.prod.js} +118 -20
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
- package/dist/{config-sync-c3777ff2.esm.js → config-sync-38bb2049.esm.js} +3 -3
- package/dist/{config-sync-670fe293.cjs.prod.js → config-sync-74ddb92a.cjs.prod.js} +3 -3
- package/dist/{config-sync-ci-c239e83b.cjs.prod.js → config-sync-ci-0d638a98.cjs.prod.js} +3 -3
- package/dist/{config-sync-ci-2a86810d.cjs.dev.js → config-sync-ci-f083fe23.cjs.dev.js} +3 -3
- package/dist/{config-sync-ci-d2a1a560.esm.js → config-sync-ci-f2adf187.esm.js} +3 -3
- package/dist/{config-sync-91880023.cjs.dev.js → config-sync-eac5312f.cjs.dev.js} +3 -3
- package/dist/{config-sync-helpers-2bbb7ef2.cjs.dev.js → config-sync-helpers-165afb6b.cjs.dev.js} +1 -1
- package/dist/{config-sync-helpers-afd3d75e.cjs.prod.js → config-sync-helpers-1dad1481.cjs.prod.js} +1 -1
- package/dist/{config-sync-helpers-9c2cbd1b.esm.js → config-sync-helpers-2bf06642.esm.js} +1 -1
- package/dist/{create-postcss-config-880af1a5.cjs.dev.js → create-postcss-config-1b021fb2.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-f732c04c.cjs.prod.js → create-postcss-config-434fe673.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-257247d7.esm.js → create-postcss-config-505c5a4e.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-22db7e21.cjs.prod.js → create-webpack-config-for-development-1db101e2.cjs.prod.js} +4 -5
- package/dist/{create-webpack-config-for-development-736b37a1.cjs.dev.js → create-webpack-config-for-development-65abeb3f.cjs.dev.js} +4 -5
- package/dist/{create-webpack-config-for-development-fa4927c0.esm.js → create-webpack-config-for-development-fd981a20.esm.js} +2 -3
- package/dist/{create-webpack-config-for-production-7888ee9e.cjs.dev.js → create-webpack-config-for-production-010a6fb4.cjs.dev.js} +4 -5
- package/dist/{create-webpack-config-for-production-da525cc3.cjs.prod.js → create-webpack-config-for-production-a239ba22.cjs.prod.js} +4 -5
- package/dist/{create-webpack-config-for-production-cfb9e90a.esm.js → create-webpack-config-for-production-bb66207f.esm.js} +2 -3
- package/dist/declarations/src/types.d.ts +3 -0
- package/dist/{deployment-previews-set-4ee2a4e5.esm.js → deployment-previews-set-6ceff6a3.esm.js} +2 -2
- package/dist/{deployment-previews-set-0a6480d0.cjs.prod.js → deployment-previews-set-beeaeb6d.cjs.prod.js} +2 -2
- package/dist/{deployment-previews-set-8c400e53.cjs.dev.js → deployment-previews-set-c4f8a461.cjs.dev.js} +2 -2
- package/dist/{graphql-requests-eb88492d.cjs.prod.js → graphql-requests-4c97fe92.cjs.prod.js} +1 -1
- package/dist/{graphql-requests-569dae6e.esm.js → graphql-requests-53a1f5dd.esm.js} +1 -1
- package/dist/{graphql-requests-25e057ed.cjs.dev.js → graphql-requests-86c87041.cjs.dev.js} +1 -1
- package/dist/{login-c18cb968.esm.js → login-1e4ddcda.esm.js} +1 -1
- package/dist/{login-1fd80a8d.cjs.dev.js → login-382b51ea.cjs.dev.js} +1 -1
- package/dist/{login-a6d93fd3.cjs.prod.js → login-c151a059.cjs.prod.js} +1 -1
- package/dist/{optimizations-bf991634.esm.js → optimizations-54382f7b.esm.js} +24 -9
- package/dist/{optimizations-fb93514f.cjs.prod.js → optimizations-56be74d6.cjs.dev.js} +24 -9
- package/dist/{optimizations-7789145e.cjs.dev.js → optimizations-da5a0cfa.cjs.prod.js} +24 -9
- package/dist/{package-8926f3f0.esm.js → package-02f0532d.esm.js} +13 -14
- package/dist/{package-2bdb4e7b.cjs.prod.js → package-c8f39856.cjs.dev.js} +13 -14
- package/dist/{package-d8f5b403.cjs.dev.js → package-dfc9c56b.cjs.prod.js} +13 -14
- package/dist/serve-00294d34.esm.js +77 -0
- package/dist/serve-81db9f2e.cjs.dev.js +88 -0
- package/dist/serve-d62433a1.cjs.prod.js +88 -0
- package/dist/{start-e1dffbe2.cjs.dev.js → start-32bc9eca.cjs.dev.js} +4 -5
- package/dist/{start-a35e973b.cjs.prod.js → start-5eb60c74.cjs.prod.js} +4 -5
- package/dist/{start-8d77546d.esm.js → start-6fc3b235.esm.js} +4 -5
- package/package.json +13 -14
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +5 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +5 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +5 -6
- package/dist/has-jsx-runtime-aa5d21ee.cjs.dev.js +0 -15
- package/dist/has-jsx-runtime-c3202df5.cjs.prod.js +0 -15
- package/dist/has-jsx-runtime-e3ecb09b.esm.js +0 -13
- package/dist/serve-38456e1b.cjs.dev.js +0 -67
- package/dist/serve-be1f9439.esm.js +0 -57
- package/dist/serve-cc4a766d.cjs.prod.js +0 -67
|
@@ -10,7 +10,7 @@ var path = require('path');
|
|
|
10
10
|
var commander = require('commander');
|
|
11
11
|
var dotenv = require('dotenv');
|
|
12
12
|
var dotenvExpand = require('dotenv-expand');
|
|
13
|
-
var _package = require('../../dist/package-
|
|
13
|
+
var _package = require('../../dist/package-c8f39856.cjs.dev.js');
|
|
14
14
|
var doesFileExist = require('../../dist/does-file-exist-eb86baca.cjs.dev.js');
|
|
15
15
|
require('node:fs');
|
|
16
16
|
|
|
@@ -54,7 +54,7 @@ async function run() {
|
|
|
54
54
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
55
55
|
console.log('');
|
|
56
56
|
}
|
|
57
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-068e9f73.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-
|
|
57
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-068e9f73.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-32bc9eca.cjs.dev.js'); });
|
|
58
58
|
await startCommand.default();
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -73,7 +73,7 @@ async function run() {
|
|
|
73
73
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
74
74
|
console.log('');
|
|
75
75
|
}
|
|
76
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-
|
|
76
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-2fb9320e.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-7a3a4b48.cjs.dev.js'); });
|
|
77
77
|
await buildCommand.default();
|
|
78
78
|
const shouldAlsoCompile = !options.buildOnly;
|
|
79
79
|
if (shouldAlsoCompile) {
|
|
@@ -100,7 +100,7 @@ async function run() {
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
// Command: serve
|
|
103
|
-
commander.program.command('serve').description('Serves previously built and compiled application from the "public" folder.').
|
|
103
|
+
commander.program.command('serve').description('Serves previously built and compiled application from the "public" folder.').option('--handle-auth-routes <enabled>', '(optional) Whether `/login*` and `/logout*` are intercepted by the built-in login/logout handlers (`true`, the default) or passed through to the SPA fallback (`false`). Set to `false` for applications that own those routes themselves (e.g. `application-authentication`).', 'true').action(async options => {
|
|
104
104
|
const globalOptions = commander.program.opts();
|
|
105
105
|
|
|
106
106
|
// Load dotenv files into the process environment.
|
|
@@ -109,8 +109,13 @@ async function run() {
|
|
|
109
109
|
|
|
110
110
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
111
111
|
process.env.NODE_ENV = 'production';
|
|
112
|
-
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-
|
|
113
|
-
await serveCommand.default(
|
|
112
|
+
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-81db9f2e.cjs.dev.js'); });
|
|
113
|
+
const server = await serveCommand.default({
|
|
114
|
+
handleAuthRoutes: options.handleAuthRoutes !== 'false'
|
|
115
|
+
});
|
|
116
|
+
const address = server.address();
|
|
117
|
+
const boundPort = address && typeof address === 'object' ? address.port : '?';
|
|
118
|
+
console.log(`Running at http://localhost:${boundPort}`);
|
|
114
119
|
});
|
|
115
120
|
|
|
116
121
|
// Command: login
|
|
@@ -125,7 +130,7 @@ async function run() {
|
|
|
125
130
|
|
|
126
131
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
127
132
|
process.env.NODE_ENV = 'production';
|
|
128
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
133
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-382b51ea.cjs.dev.js'); });
|
|
129
134
|
await loginCommand.default(options);
|
|
130
135
|
});
|
|
131
136
|
|
|
@@ -139,7 +144,7 @@ async function run() {
|
|
|
139
144
|
|
|
140
145
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
141
146
|
process.env.NODE_ENV = 'production';
|
|
142
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
147
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-eac5312f.cjs.dev.js'); });
|
|
143
148
|
await configSyncCommand.default(options);
|
|
144
149
|
});
|
|
145
150
|
|
|
@@ -152,7 +157,7 @@ async function run() {
|
|
|
152
157
|
|
|
153
158
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
154
159
|
process.env.NODE_ENV = 'production';
|
|
155
|
-
const configSyncCICommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-ci-
|
|
160
|
+
const configSyncCICommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-ci-f083fe23.cjs.dev.js'); });
|
|
156
161
|
await configSyncCICommand.default(options);
|
|
157
162
|
});
|
|
158
163
|
|
|
@@ -166,7 +171,7 @@ async function run() {
|
|
|
166
171
|
|
|
167
172
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
168
173
|
process.env.NODE_ENV = 'production';
|
|
169
|
-
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-
|
|
174
|
+
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-c4f8a461.cjs.dev.js'); });
|
|
170
175
|
await deploymentsSetCommand.default(options);
|
|
171
176
|
});
|
|
172
177
|
commander.program.parse();
|
|
@@ -10,7 +10,7 @@ var path = require('path');
|
|
|
10
10
|
var commander = require('commander');
|
|
11
11
|
var dotenv = require('dotenv');
|
|
12
12
|
var dotenvExpand = require('dotenv-expand');
|
|
13
|
-
var _package = require('../../dist/package-
|
|
13
|
+
var _package = require('../../dist/package-dfc9c56b.cjs.prod.js');
|
|
14
14
|
var doesFileExist = require('../../dist/does-file-exist-be53305d.cjs.prod.js');
|
|
15
15
|
require('node:fs');
|
|
16
16
|
|
|
@@ -54,7 +54,7 @@ async function run() {
|
|
|
54
54
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
55
55
|
console.log('');
|
|
56
56
|
}
|
|
57
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-29078b3a.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-
|
|
57
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-29078b3a.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-5eb60c74.cjs.prod.js'); });
|
|
58
58
|
await startCommand.default();
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -73,7 +73,7 @@ async function run() {
|
|
|
73
73
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
74
74
|
console.log('');
|
|
75
75
|
}
|
|
76
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-
|
|
76
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-71889a4a.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-2dde4016.cjs.prod.js'); });
|
|
77
77
|
await buildCommand.default();
|
|
78
78
|
const shouldAlsoCompile = !options.buildOnly;
|
|
79
79
|
if (shouldAlsoCompile) {
|
|
@@ -100,7 +100,7 @@ async function run() {
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
// Command: serve
|
|
103
|
-
commander.program.command('serve').description('Serves previously built and compiled application from the "public" folder.').
|
|
103
|
+
commander.program.command('serve').description('Serves previously built and compiled application from the "public" folder.').option('--handle-auth-routes <enabled>', '(optional) Whether `/login*` and `/logout*` are intercepted by the built-in login/logout handlers (`true`, the default) or passed through to the SPA fallback (`false`). Set to `false` for applications that own those routes themselves (e.g. `application-authentication`).', 'true').action(async options => {
|
|
104
104
|
const globalOptions = commander.program.opts();
|
|
105
105
|
|
|
106
106
|
// Load dotenv files into the process environment.
|
|
@@ -109,8 +109,13 @@ async function run() {
|
|
|
109
109
|
|
|
110
110
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
111
111
|
process.env.NODE_ENV = 'production';
|
|
112
|
-
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-
|
|
113
|
-
await serveCommand.default(
|
|
112
|
+
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-d62433a1.cjs.prod.js'); });
|
|
113
|
+
const server = await serveCommand.default({
|
|
114
|
+
handleAuthRoutes: options.handleAuthRoutes !== 'false'
|
|
115
|
+
});
|
|
116
|
+
const address = server.address();
|
|
117
|
+
const boundPort = address && typeof address === 'object' ? address.port : '?';
|
|
118
|
+
console.log(`Running at http://localhost:${boundPort}`);
|
|
114
119
|
});
|
|
115
120
|
|
|
116
121
|
// Command: login
|
|
@@ -125,7 +130,7 @@ async function run() {
|
|
|
125
130
|
|
|
126
131
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
127
132
|
process.env.NODE_ENV = 'production';
|
|
128
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
133
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-c151a059.cjs.prod.js'); });
|
|
129
134
|
await loginCommand.default(options);
|
|
130
135
|
});
|
|
131
136
|
|
|
@@ -139,7 +144,7 @@ async function run() {
|
|
|
139
144
|
|
|
140
145
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
141
146
|
process.env.NODE_ENV = 'production';
|
|
142
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
147
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-74ddb92a.cjs.prod.js'); });
|
|
143
148
|
await configSyncCommand.default(options);
|
|
144
149
|
});
|
|
145
150
|
|
|
@@ -152,7 +157,7 @@ async function run() {
|
|
|
152
157
|
|
|
153
158
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
154
159
|
process.env.NODE_ENV = 'production';
|
|
155
|
-
const configSyncCICommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-ci-
|
|
160
|
+
const configSyncCICommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-ci-0d638a98.cjs.prod.js'); });
|
|
156
161
|
await configSyncCICommand.default(options);
|
|
157
162
|
});
|
|
158
163
|
|
|
@@ -166,7 +171,7 @@ async function run() {
|
|
|
166
171
|
|
|
167
172
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
168
173
|
process.env.NODE_ENV = 'production';
|
|
169
|
-
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-
|
|
174
|
+
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-beeaeb6d.cjs.prod.js'); });
|
|
170
175
|
await deploymentsSetCommand.default(options);
|
|
171
176
|
});
|
|
172
177
|
commander.program.parse();
|
|
@@ -6,7 +6,7 @@ import path from 'path';
|
|
|
6
6
|
import { program } from 'commander';
|
|
7
7
|
import dotenv from 'dotenv';
|
|
8
8
|
import dotenvExpand from 'dotenv-expand';
|
|
9
|
-
import { p as pkgJson } from '../../dist/package-
|
|
9
|
+
import { p as pkgJson } from '../../dist/package-02f0532d.esm.js';
|
|
10
10
|
import { d as doesFileExist } from '../../dist/does-file-exist-32618334.esm.js';
|
|
11
11
|
import 'node:fs';
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ async function run() {
|
|
|
40
40
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
41
41
|
console.log('');
|
|
42
42
|
}
|
|
43
|
-
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-7d1161e8.esm.js') : await import('../../dist/start-
|
|
43
|
+
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-7d1161e8.esm.js') : await import('../../dist/start-6fc3b235.esm.js');
|
|
44
44
|
await startCommand.default();
|
|
45
45
|
});
|
|
46
46
|
|
|
@@ -59,7 +59,7 @@ async function run() {
|
|
|
59
59
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
60
60
|
console.log('');
|
|
61
61
|
}
|
|
62
|
-
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-
|
|
62
|
+
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-1526e4f8.esm.js') : await import('../../dist/build-51b09598.esm.js');
|
|
63
63
|
await buildCommand.default();
|
|
64
64
|
const shouldAlsoCompile = !options.buildOnly;
|
|
65
65
|
if (shouldAlsoCompile) {
|
|
@@ -86,7 +86,7 @@ async function run() {
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
// Command: serve
|
|
89
|
-
program.command('serve').description('Serves previously built and compiled application from the "public" folder.').
|
|
89
|
+
program.command('serve').description('Serves previously built and compiled application from the "public" folder.').option('--handle-auth-routes <enabled>', '(optional) Whether `/login*` and `/logout*` are intercepted by the built-in login/logout handlers (`true`, the default) or passed through to the SPA fallback (`false`). Set to `false` for applications that own those routes themselves (e.g. `application-authentication`).', 'true').action(async options => {
|
|
90
90
|
const globalOptions = program.opts();
|
|
91
91
|
|
|
92
92
|
// Load dotenv files into the process environment.
|
|
@@ -95,8 +95,13 @@ async function run() {
|
|
|
95
95
|
|
|
96
96
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
97
97
|
process.env.NODE_ENV = 'production';
|
|
98
|
-
const serveCommand = await import('../../dist/serve-
|
|
99
|
-
await serveCommand.default(
|
|
98
|
+
const serveCommand = await import('../../dist/serve-00294d34.esm.js');
|
|
99
|
+
const server = await serveCommand.default({
|
|
100
|
+
handleAuthRoutes: options.handleAuthRoutes !== 'false'
|
|
101
|
+
});
|
|
102
|
+
const address = server.address();
|
|
103
|
+
const boundPort = address && typeof address === 'object' ? address.port : '?';
|
|
104
|
+
console.log(`Running at http://localhost:${boundPort}`);
|
|
100
105
|
});
|
|
101
106
|
|
|
102
107
|
// Command: login
|
|
@@ -111,7 +116,7 @@ async function run() {
|
|
|
111
116
|
|
|
112
117
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
113
118
|
process.env.NODE_ENV = 'production';
|
|
114
|
-
const loginCommand = await import('../../dist/login-
|
|
119
|
+
const loginCommand = await import('../../dist/login-1e4ddcda.esm.js');
|
|
115
120
|
await loginCommand.default(options);
|
|
116
121
|
});
|
|
117
122
|
|
|
@@ -125,7 +130,7 @@ async function run() {
|
|
|
125
130
|
|
|
126
131
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
127
132
|
process.env.NODE_ENV = 'production';
|
|
128
|
-
const configSyncCommand = await import('../../dist/config-sync-
|
|
133
|
+
const configSyncCommand = await import('../../dist/config-sync-38bb2049.esm.js');
|
|
129
134
|
await configSyncCommand.default(options);
|
|
130
135
|
});
|
|
131
136
|
|
|
@@ -138,7 +143,7 @@ async function run() {
|
|
|
138
143
|
|
|
139
144
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
140
145
|
process.env.NODE_ENV = 'production';
|
|
141
|
-
const configSyncCICommand = await import('../../dist/config-sync-ci-
|
|
146
|
+
const configSyncCICommand = await import('../../dist/config-sync-ci-f2adf187.esm.js');
|
|
142
147
|
await configSyncCICommand.default(options);
|
|
143
148
|
});
|
|
144
149
|
|
|
@@ -152,7 +157,7 @@ async function run() {
|
|
|
152
157
|
|
|
153
158
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
154
159
|
process.env.NODE_ENV = 'production';
|
|
155
|
-
const deploymentsSetCommand = await import('../../dist/deployment-previews-set-
|
|
160
|
+
const deploymentsSetCommand = await import('../../dist/deployment-previews-set-6ceff6a3.esm.js');
|
|
156
161
|
await deploymentsSetCommand.default(options);
|
|
157
162
|
});
|
|
158
163
|
program.parse();
|
|
@@ -10,7 +10,7 @@ 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-
|
|
13
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-a239ba22.cjs.prod.js');
|
|
14
14
|
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
15
15
|
var doesFileExist = require('./does-file-exist-be53305d.cjs.prod.js');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
@@ -40,11 +40,10 @@ 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-434fe673.cjs.prod.js');
|
|
44
44
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
|
-
require('./package-
|
|
46
|
-
require('./
|
|
47
|
-
require('./optimizations-fb93514f.cjs.prod.js');
|
|
45
|
+
require('./package-dfc9c56b.cjs.prod.js');
|
|
46
|
+
require('./optimizations-da5a0cfa.cjs.prod.js');
|
|
48
47
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
49
48
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
50
49
|
require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
@@ -8,7 +8,7 @@ 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-
|
|
11
|
+
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-bb66207f.esm.js';
|
|
12
12
|
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
13
13
|
import { d as doesFileExist } from './does-file-exist-32618334.esm.js';
|
|
14
14
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
@@ -38,11 +38,10 @@ 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-505c5a4e.esm.js';
|
|
42
42
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
43
|
-
import './package-
|
|
44
|
-
import './
|
|
45
|
-
import './optimizations-bf991634.esm.js';
|
|
43
|
+
import './package-02f0532d.esm.js';
|
|
44
|
+
import './optimizations-54382f7b.esm.js';
|
|
46
45
|
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
47
46
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
48
47
|
import './vendors-to-transpile-7dc84a72.esm.js';
|
|
@@ -10,7 +10,7 @@ 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-
|
|
13
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-010a6fb4.cjs.dev.js');
|
|
14
14
|
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
15
15
|
var doesFileExist = require('./does-file-exist-eb86baca.cjs.dev.js');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
@@ -40,11 +40,10 @@ 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-1b021fb2.cjs.dev.js');
|
|
44
44
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
|
-
require('./package-
|
|
46
|
-
require('./
|
|
47
|
-
require('./optimizations-7789145e.cjs.dev.js');
|
|
45
|
+
require('./package-c8f39856.cjs.dev.js');
|
|
46
|
+
require('./optimizations-56be74d6.cjs.dev.js');
|
|
48
47
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
49
48
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
50
49
|
require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
@@ -10,8 +10,16 @@ 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-bf991634.esm.js';
|
|
14
13
|
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
14
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
15
|
+
import _Object$values from '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
16
|
+
import _Map from '@babel/runtime-corejs3/core-js-stable/map';
|
|
17
|
+
import _keysInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/keys';
|
|
18
|
+
import _Set from '@babel/runtime-corejs3/core-js-stable/set';
|
|
19
|
+
import _indexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/index-of';
|
|
20
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
21
|
+
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
22
|
+
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
15
23
|
import { compile } from '@formatjs/cli-lib';
|
|
16
24
|
import { createFilter } from '@rollup/pluginutils';
|
|
17
25
|
import { g as getI18nMessageFormat, h as handleMessageCompilationError } from './i18n-message-complilation-21d3b0aa.esm.js';
|
|
@@ -19,23 +27,10 @@ import fs from 'node:fs';
|
|
|
19
27
|
import path from 'node:path';
|
|
20
28
|
import { globSync } from 'glob';
|
|
21
29
|
import { v as vitePluginSvgr } from './vite-plugin-svgr-de6ee7da.esm.js';
|
|
22
|
-
import '@babel/runtime-corejs3/helpers/defineProperty';
|
|
23
|
-
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
24
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
25
|
-
import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
26
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
27
|
-
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
28
|
-
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
29
|
-
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
30
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
31
|
-
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
32
|
-
import '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
33
|
-
import '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
34
|
-
import 'chalk';
|
|
35
30
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
36
31
|
import 'fs';
|
|
37
32
|
import './does-file-exist-32618334.esm.js';
|
|
38
|
-
import '
|
|
33
|
+
import 'chalk';
|
|
39
34
|
import 'crypto';
|
|
40
35
|
import '@babel/runtime-corejs3/core-js/instance/match-all';
|
|
41
36
|
|
|
@@ -44,6 +39,94 @@ function nonNullable(value) {
|
|
|
44
39
|
return value !== null && value !== undefined;
|
|
45
40
|
}
|
|
46
41
|
|
|
42
|
+
// Structural subset of Rollup's OutputChunk / OutputBundle. We avoid
|
|
43
|
+
// importing the real types because Rollup is a transitive dep via Vite and
|
|
44
|
+
// is not declared in mc-scripts' own `dependencies`. We only touch three
|
|
45
|
+
// fields, so a local type is cheaper than adding a dep.
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Health check: after Rollup produces the output bundle, verify that the
|
|
49
|
+
* graph of cross-chunk imports is a DAG. Chunk-level cycles are a class of
|
|
50
|
+
* bug that doesn't fail at build time but crashes at runtime the moment one
|
|
51
|
+
* chunk reads a variable from its partner before that partner finishes
|
|
52
|
+
* initializing (TDZ). The historical failure mode was `@commercetools-uikit/icons`
|
|
53
|
+
* ↔ `app-shell` under `manualChunks`.
|
|
54
|
+
*/
|
|
55
|
+
function pluginChunkCycleCheck() {
|
|
56
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
57
|
+
const onCycle = options.onCycle ?? 'error';
|
|
58
|
+
return {
|
|
59
|
+
name: 'vite-plugin-chunk-cycle-check',
|
|
60
|
+
apply: 'build',
|
|
61
|
+
// `generateBundle` runs once the chunk graph is final but before files
|
|
62
|
+
// hit disk — the cheapest place to inspect it.
|
|
63
|
+
generateBundle(_, bundle) {
|
|
64
|
+
const cycles = findChunkCycles(bundle);
|
|
65
|
+
if (cycles.length === 0) return;
|
|
66
|
+
const formatted = _mapInstanceProperty(cycles).call(cycles, cycle => ` ${cycle.join(' → ')}`).join('\n');
|
|
67
|
+
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.`;
|
|
68
|
+
if (onCycle === 'error') {
|
|
69
|
+
this.error(message);
|
|
70
|
+
} else {
|
|
71
|
+
this.warn(message);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Pure graph algorithm extracted for direct unit testing. Builds the
|
|
79
|
+
* chunk-to-chunk import graph and returns every elementary cycle found.
|
|
80
|
+
*/
|
|
81
|
+
function findChunkCycles(bundle) {
|
|
82
|
+
var _context;
|
|
83
|
+
const chunks = _filterInstanceProperty(_context = _Object$values(bundle)).call(_context, entry => entry.type === 'chunk');
|
|
84
|
+
const graph = new _Map();
|
|
85
|
+
for (const chunk of chunks) {
|
|
86
|
+
// `imports` covers static imports between chunks. `dynamicImports` are
|
|
87
|
+
// deliberately ignored — those create legitimate lazy boundaries that
|
|
88
|
+
// can back-reference the parent without a runtime cycle.
|
|
89
|
+
graph.set(chunk.fileName, chunk.imports);
|
|
90
|
+
}
|
|
91
|
+
const WHITE = 0;
|
|
92
|
+
const GRAY = 1;
|
|
93
|
+
const BLACK = 2;
|
|
94
|
+
const color = new _Map();
|
|
95
|
+
for (const name of _keysInstanceProperty(graph).call(graph)) color.set(name, WHITE);
|
|
96
|
+
const cycles = [];
|
|
97
|
+
const seenCycleKeys = new _Set();
|
|
98
|
+
const pathStack = [];
|
|
99
|
+
const visit = node => {
|
|
100
|
+
color.set(node, GRAY);
|
|
101
|
+
pathStack.push(node);
|
|
102
|
+
for (const next of graph.get(node) ?? []) {
|
|
103
|
+
// Imports may reference assets or chunks outside our map (e.g. CSS).
|
|
104
|
+
if (!graph.has(next)) continue;
|
|
105
|
+
const nextColor = color.get(next);
|
|
106
|
+
if (nextColor === GRAY) {
|
|
107
|
+
var _context2, _context3, _context4;
|
|
108
|
+
const startIdx = _indexOfInstanceProperty(pathStack).call(pathStack, next);
|
|
109
|
+
const cycle = _concatInstanceProperty(_context2 = _sliceInstanceProperty(pathStack).call(pathStack, startIdx)).call(_context2, next);
|
|
110
|
+
// Normalize so we report each elementary cycle only once regardless
|
|
111
|
+
// of which node in the cycle DFS entered from.
|
|
112
|
+
const key = _sortInstanceProperty(_context3 = _sliceInstanceProperty(_context4 = [...cycle]).call(_context4, 0, -1)).call(_context3).join('|');
|
|
113
|
+
if (!seenCycleKeys.has(key)) {
|
|
114
|
+
seenCycleKeys.add(key);
|
|
115
|
+
cycles.push(cycle);
|
|
116
|
+
}
|
|
117
|
+
} else if (nextColor === WHITE) {
|
|
118
|
+
visit(next);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
pathStack.pop();
|
|
122
|
+
color.set(node, BLACK);
|
|
123
|
+
};
|
|
124
|
+
for (const node of _keysInstanceProperty(graph).call(graph)) {
|
|
125
|
+
if (color.get(node) === WHITE) visit(node);
|
|
126
|
+
}
|
|
127
|
+
return cycles;
|
|
128
|
+
}
|
|
129
|
+
|
|
47
130
|
// This script/function is injected into the `index.html` and used by Vite
|
|
48
131
|
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
49
132
|
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
@@ -151,7 +234,6 @@ async function run() {
|
|
|
151
234
|
fs$1.writeFileSync(paths.appIndexHtml, html, {
|
|
152
235
|
encoding: 'utf8'
|
|
153
236
|
});
|
|
154
|
-
const appDependencies = require(paths.appPackageJson).dependencies;
|
|
155
237
|
await build({
|
|
156
238
|
root: paths.appRoot,
|
|
157
239
|
base: './',
|
|
@@ -170,9 +252,12 @@ async function run() {
|
|
|
170
252
|
// NOTE that after the build, Vite will write the `index.html` (template)
|
|
171
253
|
// at the `/public/public/index.html` location. See `fs.renameSync` below.
|
|
172
254
|
input: paths.appIndexHtml,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
255
|
+
// NOTE: we intentionally do not set `output.manualChunks` here. The
|
|
256
|
+
// declarative form does not claim transitive deps, so shared packages
|
|
257
|
+
// (babel-runtime, emotion, uikit internals) can land in a chunk that
|
|
258
|
+
// also imports back from another chunk — producing a TDZ cycle at
|
|
259
|
+
// runtime (historical "aM is undefined" crash with the icons/app-shell
|
|
260
|
+
// split). Rollup's default chunking handles co-location correctly.
|
|
176
261
|
// Reduce the memory footprint when building sourcemaps.
|
|
177
262
|
// https://github.com/vitejs/vite/issues/2433#issuecomment-1361094727
|
|
178
263
|
cache: false
|
|
@@ -218,7 +303,11 @@ async function run() {
|
|
|
218
303
|
outputDir: paths.appBuild,
|
|
219
304
|
patterns: ['*.react-*.svg'],
|
|
220
305
|
verbose: true // logs the files that are removed
|
|
221
|
-
}), vitePluginDynamicBaseAssetsGlobals(), vitePluginI18nMessageCompilation(),
|
|
306
|
+
}), vitePluginDynamicBaseAssetsGlobals(), vitePluginI18nMessageCompilation(),
|
|
307
|
+
// Fail the build if the emitted chunk graph contains circular imports.
|
|
308
|
+
// Chunk cycles are silent at build time but crash at runtime with TDZ
|
|
309
|
+
// errors (historical "aM is undefined" from the icons/app-shell split).
|
|
310
|
+
pluginChunkCycleCheck(), process.env.ANALYZE_BUNDLE === 'true' && analyzer({
|
|
222
311
|
defaultSizes: 'stat',
|
|
223
312
|
openAnalyzer: true
|
|
224
313
|
}), process.env.ANALYZE_BUNDLE_TREE === 'true' && visualizer({
|