@commercetools-frontend/mc-scripts 21.8.1 → 21.11.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 +22 -17
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +22 -17
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +22 -17
- package/dist/{build-cac1a859.esm.js → build-194c0f0e.esm.js} +3 -3
- package/dist/{build-3521a4f3.cjs.dev.js → build-5a0744fe.cjs.dev.js} +3 -3
- package/dist/{build-acb29f36.cjs.prod.js → build-c09ffe9f.cjs.prod.js} +3 -3
- package/dist/{build-vite-6c987a60.cjs.dev.js → build-vite-3b82522e.cjs.dev.js} +44 -2
- package/dist/{build-vite-a9602b19.esm.js → build-vite-93abdc95.esm.js} +44 -2
- package/dist/{build-vite-76d44332.cjs.prod.js → build-vite-b7cd993a.cjs.prod.js} +44 -2
- 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-a6565737.esm.js → config-sync-56a5d505.esm.js} +2 -2
- package/dist/{config-sync-9540c47f.cjs.dev.js → config-sync-90d9f475.cjs.dev.js} +2 -2
- package/dist/{config-sync-7bd51e9b.cjs.prod.js → config-sync-c9f2d1ea.cjs.prod.js} +2 -2
- package/dist/{create-postcss-config-07259760.cjs.dev.js → create-postcss-config-583a2d68.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-9e14f015.esm.js → create-postcss-config-869bd4ab.esm.js} +1 -1
- package/dist/{create-postcss-config-c1122bfa.cjs.prod.js → create-postcss-config-d0b0712b.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-development-20fbe5a5.cjs.dev.js → create-webpack-config-for-development-4279881f.cjs.dev.js} +5 -4
- package/dist/{create-webpack-config-for-development-eb1432fe.esm.js → create-webpack-config-for-development-6e035844.esm.js} +5 -4
- package/dist/{create-webpack-config-for-development-b70e9af1.cjs.prod.js → create-webpack-config-for-development-9943b0b1.cjs.prod.js} +5 -4
- package/dist/{create-webpack-config-for-production-331c8877.esm.js → create-webpack-config-for-production-9598634c.esm.js} +5 -4
- package/dist/{create-webpack-config-for-production-e894ffc1.cjs.prod.js → create-webpack-config-for-production-c2d84600.cjs.prod.js} +5 -4
- package/dist/{create-webpack-config-for-production-4e58ee43.cjs.dev.js → create-webpack-config-for-production-cdb23542.cjs.dev.js} +5 -4
- package/dist/declarations/src/config/moment-locales.d.ts +2 -0
- package/dist/declarations/src/generated/settings.d.ts +110 -8
- package/dist/declarations/src/vite-plugins/vite-plugin-custom-application.d.ts +4 -0
- package/dist/declarations/src/vite-plugins/vite-plugin-dynamic-base-assets-globals.d.ts +3 -0
- package/dist/declarations/src/vite-plugins/vite-plugin-svgr.d.ts +3 -0
- package/dist/{login-e943a53a.cjs.prod.js → login-1f08ef78.cjs.prod.js} +2 -2
- package/dist/{login-435f4c2b.esm.js → login-c491f3b4.esm.js} +2 -2
- package/dist/{login-d1cbdeca.cjs.dev.js → login-f183d706.cjs.dev.js} +2 -2
- package/dist/{package-fab41a01.cjs.prod.js → package-16806805.cjs.prod.js} +25 -21
- package/dist/{package-8a5733b4.cjs.dev.js → package-47f66a69.cjs.dev.js} +25 -21
- package/dist/{package-8b6676c0.esm.js → package-8bf24527.esm.js} +25 -21
- package/dist/{start-52af291f.esm.js → start-2bbf8459.esm.js} +3 -3
- package/dist/{start-dfef24e1.cjs.dev.js → start-65562171.cjs.dev.js} +3 -3
- package/dist/{start-086879f3.cjs.prod.js → start-b4c252fa.cjs.prod.js} +3 -3
- package/dist/{start-vite-737bacca.cjs.dev.js → start-vite-22de08dc.cjs.dev.js} +7 -5
- package/dist/{start-vite-ec5d40b5.esm.js → start-vite-dc046cba.esm.js} +7 -5
- package/dist/{start-vite-b0f58ae4.cjs.prod.js → start-vite-fe13330b.cjs.prod.js} +7 -5
- package/dist/{user-agent-7d6d1d4a.esm.js → user-agent-d4180a88.esm.js} +1 -1
- package/dist/{user-agent-94518666.cjs.prod.js → user-agent-d9f1c07f.cjs.prod.js} +1 -1
- package/dist/{user-agent-866e4833.cjs.dev.js → user-agent-e10cefc1.cjs.dev.js} +1 -1
- package/dist/vite-plugin-svgr-4205f2b5.cjs.dev.js +110 -0
- package/dist/vite-plugin-svgr-eb8524fa.esm.js +85 -0
- package/dist/vite-plugin-svgr-f3bbedbe.cjs.prod.js +110 -0
- package/package.json +25 -21
- 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 +4 -4
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +4 -4
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +4 -4
|
@@ -13,7 +13,7 @@ var path = require('path');
|
|
|
13
13
|
var cac = require('cac');
|
|
14
14
|
var dotenv = require('dotenv');
|
|
15
15
|
var dotenvExpand = require('dotenv-expand');
|
|
16
|
-
var _package = require('../../dist/package-
|
|
16
|
+
var _package = require('../../dist/package-47f66a69.cjs.dev.js');
|
|
17
17
|
|
|
18
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
19
19
|
|
|
@@ -37,15 +37,14 @@ process.on('unhandledRejection', function (err) {
|
|
|
37
37
|
var applicationDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
38
38
|
|
|
39
39
|
var run = function run() {
|
|
40
|
-
cli.help();
|
|
41
|
-
cli.version(_package.pkgJson.version);
|
|
42
40
|
cli.option('--env <path>', "(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed."); // Default command
|
|
43
41
|
|
|
44
|
-
cli.command('').action(function () {
|
|
42
|
+
cli.command('').usage('\n\n Develop and build Custom Applications.').action(function () {
|
|
45
43
|
cli.outputHelp();
|
|
46
44
|
}); // Command: start
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
var usageStart = 'Starts the application in development mode using Webpack Dev Server.';
|
|
47
|
+
cli.command('start', usageStart).usage("\n\n ".concat(usageStart)).alias('dev').action( /*#__PURE__*/function () {
|
|
49
48
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(options) {
|
|
50
49
|
var shouldUseExperimentalBundler, startCommand;
|
|
51
50
|
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
@@ -71,7 +70,7 @@ var run = function run() {
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
_context.next = 8;
|
|
74
|
-
return Promise.resolve().then(function () { return require('../../dist/start-vite-
|
|
73
|
+
return Promise.resolve().then(function () { return require('../../dist/start-vite-22de08dc.cjs.dev.js'); });
|
|
75
74
|
|
|
76
75
|
case 8:
|
|
77
76
|
_context.t0 = _context.sent;
|
|
@@ -80,7 +79,7 @@ var run = function run() {
|
|
|
80
79
|
|
|
81
80
|
case 11:
|
|
82
81
|
_context.next = 13;
|
|
83
|
-
return Promise.resolve().then(function () { return require('../../dist/start-
|
|
82
|
+
return Promise.resolve().then(function () { return require('../../dist/start-65562171.cjs.dev.js'); });
|
|
84
83
|
|
|
85
84
|
case 13:
|
|
86
85
|
_context.t0 = _context.sent;
|
|
@@ -103,7 +102,8 @@ var run = function run() {
|
|
|
103
102
|
};
|
|
104
103
|
}()); // Command: build
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
var usageBuild = 'Bundles the application in production mode. Outputs a "public" folder.';
|
|
106
|
+
cli.command('build', usageBuild).usage("\n\n ".concat(usageBuild)).option('--build-only', '(optional) If defined, the command only creates the production bundles without compiling the "index.html".', {
|
|
107
107
|
default: false
|
|
108
108
|
}).action( /*#__PURE__*/function () {
|
|
109
109
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(options) {
|
|
@@ -122,7 +122,6 @@ var run = function run() {
|
|
|
122
122
|
|
|
123
123
|
if (shouldUseExperimentalBundler) {
|
|
124
124
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
125
|
-
console.warn('NOTE that the "cdnURL" value is not supported at the moment when using Vite.');
|
|
126
125
|
console.log('');
|
|
127
126
|
}
|
|
128
127
|
|
|
@@ -132,7 +131,7 @@ var run = function run() {
|
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
_context2.next = 8;
|
|
135
|
-
return Promise.resolve().then(function () { return require('../../dist/build-vite-
|
|
134
|
+
return Promise.resolve().then(function () { return require('../../dist/build-vite-3b82522e.cjs.dev.js'); });
|
|
136
135
|
|
|
137
136
|
case 8:
|
|
138
137
|
_context2.t0 = _context2.sent;
|
|
@@ -141,7 +140,7 @@ var run = function run() {
|
|
|
141
140
|
|
|
142
141
|
case 11:
|
|
143
142
|
_context2.next = 13;
|
|
144
|
-
return Promise.resolve().then(function () { return require('../../dist/build-
|
|
143
|
+
return Promise.resolve().then(function () { return require('../../dist/build-5a0744fe.cjs.dev.js'); });
|
|
145
144
|
|
|
146
145
|
case 13:
|
|
147
146
|
_context2.t0 = _context2.sent;
|
|
@@ -183,7 +182,8 @@ var run = function run() {
|
|
|
183
182
|
};
|
|
184
183
|
}()); // Command: compile-html
|
|
185
184
|
|
|
186
|
-
|
|
185
|
+
var usageCompileHtml = 'Compiles "index.html.template" file into a "index.html" with all the required runtime configuration. The security headers are also compiled and injected into the "index.html".';
|
|
186
|
+
cli.command('compile-html', usageCompileHtml).usage("\n\n ".concat(usageCompileHtml)).option('--transformer <path>', '(optional) The path to a JS module that can be used to generate a configuration for a specific cloud provider (e.g. Vercel, Netlify).').option('--print-security-headers', '(optional) If defined, the compiled security headers are printed to stdout.', {
|
|
187
187
|
default: false
|
|
188
188
|
}).action( /*#__PURE__*/function () {
|
|
189
189
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(options) {
|
|
@@ -218,7 +218,8 @@ var run = function run() {
|
|
|
218
218
|
};
|
|
219
219
|
}()); // Command: serve
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
var usageServe = 'Serves previously built and compiled application from the "public" folder.';
|
|
222
|
+
cli.command('serve', usageServe).usage("\n\n ".concat(usageServe)).action( /*#__PURE__*/function () {
|
|
222
223
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(options) {
|
|
223
224
|
var serveCommand;
|
|
224
225
|
return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context4) {
|
|
@@ -251,7 +252,8 @@ var run = function run() {
|
|
|
251
252
|
};
|
|
252
253
|
}()); // Command: login
|
|
253
254
|
|
|
254
|
-
|
|
255
|
+
var usageLogin = 'Log in to your Merchant Center account through the CLI, using the cloud environment information from the Custom Application config file. An API token is generated and stored in a configuration file for the related cloud environment, and valid for 36 hours.';
|
|
256
|
+
cli.command('login', usageLogin).usage("\n\n ".concat(usageLogin)).action( /*#__PURE__*/function () {
|
|
255
257
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(options) {
|
|
256
258
|
var loginCommand;
|
|
257
259
|
return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context5) {
|
|
@@ -264,7 +266,7 @@ var run = function run() {
|
|
|
264
266
|
|
|
265
267
|
process.env.NODE_ENV = 'production';
|
|
266
268
|
_context5.next = 4;
|
|
267
|
-
return Promise.resolve().then(function () { return require('../../dist/login-
|
|
269
|
+
return Promise.resolve().then(function () { return require('../../dist/login-f183d706.cjs.dev.js'); });
|
|
268
270
|
|
|
269
271
|
case 4:
|
|
270
272
|
loginCommand = _context5.sent;
|
|
@@ -284,7 +286,8 @@ var run = function run() {
|
|
|
284
286
|
};
|
|
285
287
|
}()); // Command: config:sync
|
|
286
288
|
|
|
287
|
-
|
|
289
|
+
var usageConfigSync = 'Synchronizes the local Custom Application config with the Merchant Center. A new Custom Application will be created if none existed, otherwise it will be updated.';
|
|
290
|
+
cli.command('config:sync', usageConfigSync).usage("\n\n ".concat(usageConfigSync)).option('--dry-run', '(optional) Executes the command but does not send any mutation request.', {
|
|
288
291
|
default: false
|
|
289
292
|
}).action( /*#__PURE__*/function () {
|
|
290
293
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(options) {
|
|
@@ -299,7 +302,7 @@ var run = function run() {
|
|
|
299
302
|
|
|
300
303
|
process.env.NODE_ENV = 'production';
|
|
301
304
|
_context6.next = 4;
|
|
302
|
-
return Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
305
|
+
return Promise.resolve().then(function () { return require('../../dist/config-sync-90d9f475.cjs.dev.js'); });
|
|
303
306
|
|
|
304
307
|
case 4:
|
|
305
308
|
configSyncCommand = _context6.sent;
|
|
@@ -318,6 +321,8 @@ var run = function run() {
|
|
|
318
321
|
return _ref6.apply(this, arguments);
|
|
319
322
|
};
|
|
320
323
|
}());
|
|
324
|
+
cli.help();
|
|
325
|
+
cli.version(_package.pkgJson.version);
|
|
321
326
|
cli.parse();
|
|
322
327
|
}; // Load dotenv files into the process environment.
|
|
323
328
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
@@ -13,7 +13,7 @@ var path = require('path');
|
|
|
13
13
|
var cac = require('cac');
|
|
14
14
|
var dotenv = require('dotenv');
|
|
15
15
|
var dotenvExpand = require('dotenv-expand');
|
|
16
|
-
var _package = require('../../dist/package-
|
|
16
|
+
var _package = require('../../dist/package-16806805.cjs.prod.js');
|
|
17
17
|
|
|
18
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
19
19
|
|
|
@@ -37,15 +37,14 @@ process.on('unhandledRejection', function (err) {
|
|
|
37
37
|
var applicationDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
38
38
|
|
|
39
39
|
var run = function run() {
|
|
40
|
-
cli.help();
|
|
41
|
-
cli.version(_package.pkgJson.version);
|
|
42
40
|
cli.option('--env <path>', "(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed."); // Default command
|
|
43
41
|
|
|
44
|
-
cli.command('').action(function () {
|
|
42
|
+
cli.command('').usage('\n\n Develop and build Custom Applications.').action(function () {
|
|
45
43
|
cli.outputHelp();
|
|
46
44
|
}); // Command: start
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
var usageStart = 'Starts the application in development mode using Webpack Dev Server.';
|
|
47
|
+
cli.command('start', usageStart).usage("\n\n ".concat(usageStart)).alias('dev').action( /*#__PURE__*/function () {
|
|
49
48
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(options) {
|
|
50
49
|
var shouldUseExperimentalBundler, startCommand;
|
|
51
50
|
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
@@ -71,7 +70,7 @@ var run = function run() {
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
_context.next = 8;
|
|
74
|
-
return Promise.resolve().then(function () { return require('../../dist/start-vite-
|
|
73
|
+
return Promise.resolve().then(function () { return require('../../dist/start-vite-fe13330b.cjs.prod.js'); });
|
|
75
74
|
|
|
76
75
|
case 8:
|
|
77
76
|
_context.t0 = _context.sent;
|
|
@@ -80,7 +79,7 @@ var run = function run() {
|
|
|
80
79
|
|
|
81
80
|
case 11:
|
|
82
81
|
_context.next = 13;
|
|
83
|
-
return Promise.resolve().then(function () { return require('../../dist/start-
|
|
82
|
+
return Promise.resolve().then(function () { return require('../../dist/start-b4c252fa.cjs.prod.js'); });
|
|
84
83
|
|
|
85
84
|
case 13:
|
|
86
85
|
_context.t0 = _context.sent;
|
|
@@ -103,7 +102,8 @@ var run = function run() {
|
|
|
103
102
|
};
|
|
104
103
|
}()); // Command: build
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
var usageBuild = 'Bundles the application in production mode. Outputs a "public" folder.';
|
|
106
|
+
cli.command('build', usageBuild).usage("\n\n ".concat(usageBuild)).option('--build-only', '(optional) If defined, the command only creates the production bundles without compiling the "index.html".', {
|
|
107
107
|
default: false
|
|
108
108
|
}).action( /*#__PURE__*/function () {
|
|
109
109
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(options) {
|
|
@@ -122,7 +122,6 @@ var run = function run() {
|
|
|
122
122
|
|
|
123
123
|
if (shouldUseExperimentalBundler) {
|
|
124
124
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
125
|
-
console.warn('NOTE that the "cdnURL" value is not supported at the moment when using Vite.');
|
|
126
125
|
console.log('');
|
|
127
126
|
}
|
|
128
127
|
|
|
@@ -132,7 +131,7 @@ var run = function run() {
|
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
_context2.next = 8;
|
|
135
|
-
return Promise.resolve().then(function () { return require('../../dist/build-vite-
|
|
134
|
+
return Promise.resolve().then(function () { return require('../../dist/build-vite-b7cd993a.cjs.prod.js'); });
|
|
136
135
|
|
|
137
136
|
case 8:
|
|
138
137
|
_context2.t0 = _context2.sent;
|
|
@@ -141,7 +140,7 @@ var run = function run() {
|
|
|
141
140
|
|
|
142
141
|
case 11:
|
|
143
142
|
_context2.next = 13;
|
|
144
|
-
return Promise.resolve().then(function () { return require('../../dist/build-
|
|
143
|
+
return Promise.resolve().then(function () { return require('../../dist/build-c09ffe9f.cjs.prod.js'); });
|
|
145
144
|
|
|
146
145
|
case 13:
|
|
147
146
|
_context2.t0 = _context2.sent;
|
|
@@ -183,7 +182,8 @@ var run = function run() {
|
|
|
183
182
|
};
|
|
184
183
|
}()); // Command: compile-html
|
|
185
184
|
|
|
186
|
-
|
|
185
|
+
var usageCompileHtml = 'Compiles "index.html.template" file into a "index.html" with all the required runtime configuration. The security headers are also compiled and injected into the "index.html".';
|
|
186
|
+
cli.command('compile-html', usageCompileHtml).usage("\n\n ".concat(usageCompileHtml)).option('--transformer <path>', '(optional) The path to a JS module that can be used to generate a configuration for a specific cloud provider (e.g. Vercel, Netlify).').option('--print-security-headers', '(optional) If defined, the compiled security headers are printed to stdout.', {
|
|
187
187
|
default: false
|
|
188
188
|
}).action( /*#__PURE__*/function () {
|
|
189
189
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(options) {
|
|
@@ -218,7 +218,8 @@ var run = function run() {
|
|
|
218
218
|
};
|
|
219
219
|
}()); // Command: serve
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
var usageServe = 'Serves previously built and compiled application from the "public" folder.';
|
|
222
|
+
cli.command('serve', usageServe).usage("\n\n ".concat(usageServe)).action( /*#__PURE__*/function () {
|
|
222
223
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(options) {
|
|
223
224
|
var serveCommand;
|
|
224
225
|
return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context4) {
|
|
@@ -251,7 +252,8 @@ var run = function run() {
|
|
|
251
252
|
};
|
|
252
253
|
}()); // Command: login
|
|
253
254
|
|
|
254
|
-
|
|
255
|
+
var usageLogin = 'Log in to your Merchant Center account through the CLI, using the cloud environment information from the Custom Application config file. An API token is generated and stored in a configuration file for the related cloud environment, and valid for 36 hours.';
|
|
256
|
+
cli.command('login', usageLogin).usage("\n\n ".concat(usageLogin)).action( /*#__PURE__*/function () {
|
|
255
257
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(options) {
|
|
256
258
|
var loginCommand;
|
|
257
259
|
return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context5) {
|
|
@@ -264,7 +266,7 @@ var run = function run() {
|
|
|
264
266
|
|
|
265
267
|
process.env.NODE_ENV = 'production';
|
|
266
268
|
_context5.next = 4;
|
|
267
|
-
return Promise.resolve().then(function () { return require('../../dist/login-
|
|
269
|
+
return Promise.resolve().then(function () { return require('../../dist/login-1f08ef78.cjs.prod.js'); });
|
|
268
270
|
|
|
269
271
|
case 4:
|
|
270
272
|
loginCommand = _context5.sent;
|
|
@@ -284,7 +286,8 @@ var run = function run() {
|
|
|
284
286
|
};
|
|
285
287
|
}()); // Command: config:sync
|
|
286
288
|
|
|
287
|
-
|
|
289
|
+
var usageConfigSync = 'Synchronizes the local Custom Application config with the Merchant Center. A new Custom Application will be created if none existed, otherwise it will be updated.';
|
|
290
|
+
cli.command('config:sync', usageConfigSync).usage("\n\n ".concat(usageConfigSync)).option('--dry-run', '(optional) Executes the command but does not send any mutation request.', {
|
|
288
291
|
default: false
|
|
289
292
|
}).action( /*#__PURE__*/function () {
|
|
290
293
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(options) {
|
|
@@ -299,7 +302,7 @@ var run = function run() {
|
|
|
299
302
|
|
|
300
303
|
process.env.NODE_ENV = 'production';
|
|
301
304
|
_context6.next = 4;
|
|
302
|
-
return Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
305
|
+
return Promise.resolve().then(function () { return require('../../dist/config-sync-c9f2d1ea.cjs.prod.js'); });
|
|
303
306
|
|
|
304
307
|
case 4:
|
|
305
308
|
configSyncCommand = _context6.sent;
|
|
@@ -318,6 +321,8 @@ var run = function run() {
|
|
|
318
321
|
return _ref6.apply(this, arguments);
|
|
319
322
|
};
|
|
320
323
|
}());
|
|
324
|
+
cli.help();
|
|
325
|
+
cli.version(_package.pkgJson.version);
|
|
321
326
|
cli.parse();
|
|
322
327
|
}; // Load dotenv files into the process environment.
|
|
323
328
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
@@ -9,7 +9,7 @@ import path from 'path';
|
|
|
9
9
|
import { cac } from 'cac';
|
|
10
10
|
import dotenv from 'dotenv';
|
|
11
11
|
import dotenvExpand from 'dotenv-expand';
|
|
12
|
-
import { p as pkgJson } from '../../dist/package-
|
|
12
|
+
import { p as pkgJson } from '../../dist/package-8bf24527.esm.js';
|
|
13
13
|
|
|
14
14
|
var cli = cac('mc-scripts'); // Makes the script crash on unhandled rejections instead of silently
|
|
15
15
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
@@ -22,15 +22,14 @@ process.on('unhandledRejection', function (err) {
|
|
|
22
22
|
var applicationDirectory = fs.realpathSync(process.cwd());
|
|
23
23
|
|
|
24
24
|
var run = function run() {
|
|
25
|
-
cli.help();
|
|
26
|
-
cli.version(pkgJson.version);
|
|
27
25
|
cli.option('--env <path>', "(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed."); // Default command
|
|
28
26
|
|
|
29
|
-
cli.command('').action(function () {
|
|
27
|
+
cli.command('').usage('\n\n Develop and build Custom Applications.').action(function () {
|
|
30
28
|
cli.outputHelp();
|
|
31
29
|
}); // Command: start
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
var usageStart = 'Starts the application in development mode using Webpack Dev Server.';
|
|
32
|
+
cli.command('start', usageStart).usage("\n\n ".concat(usageStart)).alias('dev').action( /*#__PURE__*/function () {
|
|
34
33
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
|
|
35
34
|
var shouldUseExperimentalBundler, startCommand;
|
|
36
35
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -56,7 +55,7 @@ var run = function run() {
|
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
_context.next = 8;
|
|
59
|
-
return import('../../dist/start-vite-
|
|
58
|
+
return import('../../dist/start-vite-dc046cba.esm.js');
|
|
60
59
|
|
|
61
60
|
case 8:
|
|
62
61
|
_context.t0 = _context.sent;
|
|
@@ -65,7 +64,7 @@ var run = function run() {
|
|
|
65
64
|
|
|
66
65
|
case 11:
|
|
67
66
|
_context.next = 13;
|
|
68
|
-
return import('../../dist/start-
|
|
67
|
+
return import('../../dist/start-2bbf8459.esm.js');
|
|
69
68
|
|
|
70
69
|
case 13:
|
|
71
70
|
_context.t0 = _context.sent;
|
|
@@ -88,7 +87,8 @@ var run = function run() {
|
|
|
88
87
|
};
|
|
89
88
|
}()); // Command: build
|
|
90
89
|
|
|
91
|
-
|
|
90
|
+
var usageBuild = 'Bundles the application in production mode. Outputs a "public" folder.';
|
|
91
|
+
cli.command('build', usageBuild).usage("\n\n ".concat(usageBuild)).option('--build-only', '(optional) If defined, the command only creates the production bundles without compiling the "index.html".', {
|
|
92
92
|
default: false
|
|
93
93
|
}).action( /*#__PURE__*/function () {
|
|
94
94
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(options) {
|
|
@@ -107,7 +107,6 @@ var run = function run() {
|
|
|
107
107
|
|
|
108
108
|
if (shouldUseExperimentalBundler) {
|
|
109
109
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
110
|
-
console.warn('NOTE that the "cdnURL" value is not supported at the moment when using Vite.');
|
|
111
110
|
console.log('');
|
|
112
111
|
}
|
|
113
112
|
|
|
@@ -117,7 +116,7 @@ var run = function run() {
|
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
_context2.next = 8;
|
|
120
|
-
return import('../../dist/build-vite-
|
|
119
|
+
return import('../../dist/build-vite-93abdc95.esm.js');
|
|
121
120
|
|
|
122
121
|
case 8:
|
|
123
122
|
_context2.t0 = _context2.sent;
|
|
@@ -126,7 +125,7 @@ var run = function run() {
|
|
|
126
125
|
|
|
127
126
|
case 11:
|
|
128
127
|
_context2.next = 13;
|
|
129
|
-
return import('../../dist/build-
|
|
128
|
+
return import('../../dist/build-194c0f0e.esm.js');
|
|
130
129
|
|
|
131
130
|
case 13:
|
|
132
131
|
_context2.t0 = _context2.sent;
|
|
@@ -168,7 +167,8 @@ var run = function run() {
|
|
|
168
167
|
};
|
|
169
168
|
}()); // Command: compile-html
|
|
170
169
|
|
|
171
|
-
|
|
170
|
+
var usageCompileHtml = 'Compiles "index.html.template" file into a "index.html" with all the required runtime configuration. The security headers are also compiled and injected into the "index.html".';
|
|
171
|
+
cli.command('compile-html', usageCompileHtml).usage("\n\n ".concat(usageCompileHtml)).option('--transformer <path>', '(optional) The path to a JS module that can be used to generate a configuration for a specific cloud provider (e.g. Vercel, Netlify).').option('--print-security-headers', '(optional) If defined, the compiled security headers are printed to stdout.', {
|
|
172
172
|
default: false
|
|
173
173
|
}).action( /*#__PURE__*/function () {
|
|
174
174
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
|
|
@@ -203,7 +203,8 @@ var run = function run() {
|
|
|
203
203
|
};
|
|
204
204
|
}()); // Command: serve
|
|
205
205
|
|
|
206
|
-
|
|
206
|
+
var usageServe = 'Serves previously built and compiled application from the "public" folder.';
|
|
207
|
+
cli.command('serve', usageServe).usage("\n\n ".concat(usageServe)).action( /*#__PURE__*/function () {
|
|
207
208
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(options) {
|
|
208
209
|
var serveCommand;
|
|
209
210
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
@@ -236,7 +237,8 @@ var run = function run() {
|
|
|
236
237
|
};
|
|
237
238
|
}()); // Command: login
|
|
238
239
|
|
|
239
|
-
|
|
240
|
+
var usageLogin = 'Log in to your Merchant Center account through the CLI, using the cloud environment information from the Custom Application config file. An API token is generated and stored in a configuration file for the related cloud environment, and valid for 36 hours.';
|
|
241
|
+
cli.command('login', usageLogin).usage("\n\n ".concat(usageLogin)).action( /*#__PURE__*/function () {
|
|
240
242
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(options) {
|
|
241
243
|
var loginCommand;
|
|
242
244
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -249,7 +251,7 @@ var run = function run() {
|
|
|
249
251
|
|
|
250
252
|
process.env.NODE_ENV = 'production';
|
|
251
253
|
_context5.next = 4;
|
|
252
|
-
return import('../../dist/login-
|
|
254
|
+
return import('../../dist/login-c491f3b4.esm.js');
|
|
253
255
|
|
|
254
256
|
case 4:
|
|
255
257
|
loginCommand = _context5.sent;
|
|
@@ -269,7 +271,8 @@ var run = function run() {
|
|
|
269
271
|
};
|
|
270
272
|
}()); // Command: config:sync
|
|
271
273
|
|
|
272
|
-
|
|
274
|
+
var usageConfigSync = 'Synchronizes the local Custom Application config with the Merchant Center. A new Custom Application will be created if none existed, otherwise it will be updated.';
|
|
275
|
+
cli.command('config:sync', usageConfigSync).usage("\n\n ".concat(usageConfigSync)).option('--dry-run', '(optional) Executes the command but does not send any mutation request.', {
|
|
273
276
|
default: false
|
|
274
277
|
}).action( /*#__PURE__*/function () {
|
|
275
278
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(options) {
|
|
@@ -284,7 +287,7 @@ var run = function run() {
|
|
|
284
287
|
|
|
285
288
|
process.env.NODE_ENV = 'production';
|
|
286
289
|
_context6.next = 4;
|
|
287
|
-
return import('../../dist/config-sync-
|
|
290
|
+
return import('../../dist/config-sync-56a5d505.esm.js');
|
|
288
291
|
|
|
289
292
|
case 4:
|
|
290
293
|
configSyncCommand = _context6.sent;
|
|
@@ -303,6 +306,8 @@ var run = function run() {
|
|
|
303
306
|
return _ref6.apply(this, arguments);
|
|
304
307
|
};
|
|
305
308
|
}());
|
|
309
|
+
cli.help();
|
|
310
|
+
cli.version(pkgJson.version);
|
|
306
311
|
cli.parse();
|
|
307
312
|
}; // Load dotenv files into the process environment.
|
|
308
313
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
@@ -11,7 +11,7 @@ import FileSizeReporter from 'react-dev-utils/FileSizeReporter';
|
|
|
11
11
|
import printBuildError from 'react-dev-utils/printBuildError';
|
|
12
12
|
import { packageLocation } from '@commercetools-frontend/assets';
|
|
13
13
|
import { p as paths } from './paths-ed23d5a1.esm.js';
|
|
14
|
-
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-
|
|
14
|
+
import { c as createWebpackConfigForProduction } from './create-webpack-config-for-production-9598634c.esm.js';
|
|
15
15
|
import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
16
16
|
import '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
17
17
|
import 'fs';
|
|
@@ -40,10 +40,10 @@ import '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
|
40
40
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
41
41
|
import '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
42
42
|
import './vendors-to-transpile-68e03526.esm.js';
|
|
43
|
-
import './create-postcss-config-
|
|
43
|
+
import './create-postcss-config-869bd4ab.esm.js';
|
|
44
44
|
import '@babel/runtime-corejs3/helpers/toConsumableArray';
|
|
45
45
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
46
|
-
import './package-
|
|
46
|
+
import './package-8bf24527.esm.js';
|
|
47
47
|
import './has-jsx-runtime-8314226e.esm.js';
|
|
48
48
|
|
|
49
49
|
var measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild;
|
|
@@ -13,7 +13,7 @@ var FileSizeReporter = require('react-dev-utils/FileSizeReporter');
|
|
|
13
13
|
var printBuildError = require('react-dev-utils/printBuildError');
|
|
14
14
|
var assets = require('@commercetools-frontend/assets');
|
|
15
15
|
var paths = require('./paths-16823f56.cjs.dev.js');
|
|
16
|
-
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-
|
|
16
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-cdb23542.cjs.dev.js');
|
|
17
17
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
18
18
|
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
19
19
|
require('fs');
|
|
@@ -42,10 +42,10 @@ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
|
42
42
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
43
43
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
44
44
|
require('./vendors-to-transpile-b51af5d3.cjs.dev.js');
|
|
45
|
-
require('./create-postcss-config-
|
|
45
|
+
require('./create-postcss-config-583a2d68.cjs.dev.js');
|
|
46
46
|
require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
47
47
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
48
|
-
require('./package-
|
|
48
|
+
require('./package-47f66a69.cjs.dev.js');
|
|
49
49
|
require('./has-jsx-runtime-3d4bb633.cjs.dev.js');
|
|
50
50
|
|
|
51
51
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -13,7 +13,7 @@ var FileSizeReporter = require('react-dev-utils/FileSizeReporter');
|
|
|
13
13
|
var printBuildError = require('react-dev-utils/printBuildError');
|
|
14
14
|
var assets = require('@commercetools-frontend/assets');
|
|
15
15
|
var paths = require('./paths-76b66e74.cjs.prod.js');
|
|
16
|
-
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-
|
|
16
|
+
var createWebpackConfigForProduction = require('./create-webpack-config-for-production-c2d84600.cjs.prod.js');
|
|
17
17
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
18
18
|
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
19
19
|
require('fs');
|
|
@@ -42,10 +42,10 @@ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
|
42
42
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
43
43
|
require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
44
44
|
require('./vendors-to-transpile-367e0ba8.cjs.prod.js');
|
|
45
|
-
require('./create-postcss-config-
|
|
45
|
+
require('./create-postcss-config-d0b0712b.cjs.prod.js');
|
|
46
46
|
require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
47
47
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
48
|
-
require('./package-
|
|
48
|
+
require('./package-16806805.cjs.prod.js');
|
|
49
49
|
require('./has-jsx-runtime-0b03b72e.cjs.prod.js');
|
|
50
50
|
|
|
51
51
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -12,9 +12,11 @@ var pluginReact = require('@vitejs/plugin-react');
|
|
|
12
12
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
13
13
|
var assets = require('@commercetools-frontend/assets');
|
|
14
14
|
var paths = require('./paths-16823f56.cjs.dev.js');
|
|
15
|
+
var vitePluginSvgr = require('./vite-plugin-svgr-4205f2b5.cjs.dev.js');
|
|
15
16
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
16
17
|
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
17
18
|
require('fs');
|
|
19
|
+
require('@rollup/pluginutils');
|
|
18
20
|
|
|
19
21
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
20
22
|
|
|
@@ -26,6 +28,31 @@ var path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
26
28
|
var pluginGraphql__default = /*#__PURE__*/_interopDefault(pluginGraphql);
|
|
27
29
|
var pluginReact__default = /*#__PURE__*/_interopDefault(pluginReact);
|
|
28
30
|
|
|
31
|
+
// This script/function is injected into the `index.html` and used by Vite
|
|
32
|
+
// on runtime to build the assets URL (for example when using a separate CDN for the assets).
|
|
33
|
+
// Inspired by https://github.com/vitejs/vite/blob/main/playground/assets/vite.config-runtime-base.js
|
|
34
|
+
var dynamicBaseAssetsCode = "globalThis.__toCdnUrl = filePath => window.app.cdnUrl.replace(/\\/$/, '') + '/' + filePath;";
|
|
35
|
+
|
|
36
|
+
function vitePluginDynamicBaseAssetsGlobals() {
|
|
37
|
+
return {
|
|
38
|
+
name: 'dynamic-base-assets-globals',
|
|
39
|
+
transformIndexHtml: function transformIndexHtml(html, ctx) {
|
|
40
|
+
if (ctx.bundle) {
|
|
41
|
+
// Only inject during build
|
|
42
|
+
return [{
|
|
43
|
+
tag: 'script',
|
|
44
|
+
attrs: {
|
|
45
|
+
type: 'module'
|
|
46
|
+
},
|
|
47
|
+
children: dynamicBaseAssetsCode
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return html;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
29
56
|
function run() {
|
|
30
57
|
return _run.apply(this, arguments);
|
|
31
58
|
}
|
|
@@ -56,13 +83,14 @@ function _run() {
|
|
|
56
83
|
_context.next = 7;
|
|
57
84
|
return vite.build({
|
|
58
85
|
root: paths.paths.appRoot,
|
|
86
|
+
base: './',
|
|
87
|
+
// <-- Important to allow configuring the runtime base path.
|
|
59
88
|
define: {
|
|
60
89
|
'process.env.DEBUG': _JSON$stringify__default["default"](false),
|
|
61
90
|
'process.env.NODE_ENV': _JSON$stringify__default["default"]('production')
|
|
62
91
|
},
|
|
63
92
|
build: {
|
|
64
93
|
outDir: 'public',
|
|
65
|
-
assetsDir: '.',
|
|
66
94
|
rollupOptions: {
|
|
67
95
|
// This is necessary to instruct Vite that the `index.html` (template)
|
|
68
96
|
// is located in the `/public` folder.
|
|
@@ -74,12 +102,26 @@ function _run() {
|
|
|
74
102
|
server: {
|
|
75
103
|
port: DEFAULT_PORT
|
|
76
104
|
},
|
|
105
|
+
experimental: {
|
|
106
|
+
// https://vitejs.dev/guide/build.html#advanced-base-options
|
|
107
|
+
renderBuiltUrl: function renderBuiltUrl(filename, _ref) {
|
|
108
|
+
var hostType = _ref.hostType;
|
|
109
|
+
|
|
110
|
+
if (hostType === 'html') {
|
|
111
|
+
return "__CDN_URL__".concat(filename);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
runtime: "window.__toCdnUrl(".concat(_JSON$stringify__default["default"](filename), ")")
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
},
|
|
77
119
|
plugins: [pluginGraphql__default["default"](), pluginReact__default["default"]({
|
|
78
120
|
jsxImportSource: '@emotion/react',
|
|
79
121
|
babel: {
|
|
80
122
|
plugins: ['@emotion/babel-plugin']
|
|
81
123
|
}
|
|
82
|
-
})]
|
|
124
|
+
}), vitePluginSvgr.vitePluginSvgr(), vitePluginDynamicBaseAssetsGlobals()]
|
|
83
125
|
});
|
|
84
126
|
|
|
85
127
|
case 7:
|