@commercetools-frontend/mc-scripts 23.1.0 → 23.2.1
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 +37 -51
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +37 -51
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +37 -51
- package/dist/{build-94a01179.cjs.dev.js → build-360f081d.cjs.dev.js} +3 -3
- package/dist/{build-c720e4d7.cjs.prod.js → build-6bd0ac22.cjs.prod.js} +3 -3
- package/dist/{build-9640295c.esm.js → build-d10bc41b.esm.js} +3 -3
- 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-d2077369.esm.js → config-sync-1b8ae40b.esm.js} +3 -3
- package/dist/{config-sync-1c4636a6.cjs.dev.js → config-sync-482a69fe.cjs.dev.js} +3 -3
- package/dist/{config-sync-967a9fab.cjs.prod.js → config-sync-d53518fd.cjs.prod.js} +3 -3
- package/dist/{create-postcss-config-47fae289.cjs.prod.js → create-postcss-config-5e470fa7.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-e8fa8956.esm.js → create-postcss-config-c5cf6d30.esm.js} +1 -1
- package/dist/{create-postcss-config-68e115f6.cjs.dev.js → create-postcss-config-fe0eda38.cjs.dev.js} +1 -1
- package/dist/{create-webpack-config-for-development-f2dbeafa.cjs.prod.js → create-webpack-config-for-development-48c400cd.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-development-0d9ec796.esm.js → create-webpack-config-for-development-bde94f6a.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-a66f87e6.cjs.dev.js → create-webpack-config-for-development-ea1e020f.cjs.dev.js} +1 -1
- package/dist/{create-webpack-config-for-production-a597400a.cjs.prod.js → create-webpack-config-for-production-03fb373c.cjs.prod.js} +1 -1
- package/dist/{create-webpack-config-for-production-4071a0c3.esm.js → create-webpack-config-for-production-98949ba8.esm.js} +1 -1
- package/dist/{create-webpack-config-for-production-e6dd702e.cjs.dev.js → create-webpack-config-for-production-c5364376.cjs.dev.js} +1 -1
- package/dist/{credentials-storage-4c423f74.cjs.dev.js → credentials-storage-8246aab4.cjs.dev.js} +1 -1
- package/dist/{credentials-storage-64827f92.cjs.prod.js → credentials-storage-8cf72194.cjs.prod.js} +1 -1
- package/dist/{credentials-storage-97a14511.esm.js → credentials-storage-caf1c2ad.esm.js} +1 -1
- package/dist/declarations/src/types.d.ts +0 -1
- package/dist/{deployment-previews-set-9023a268.cjs.dev.js → deployment-previews-set-14da3831.cjs.dev.js} +3 -3
- package/dist/{deployment-previews-set-b321a144.cjs.prod.js → deployment-previews-set-b2dc5c83.cjs.prod.js} +3 -3
- package/dist/{deployment-previews-set-39bd02e4.esm.js → deployment-previews-set-b6c92418.esm.js} +3 -3
- package/dist/{graphql-requests-a6de54e9.cjs.dev.js → graphql-requests-02024fb9.cjs.dev.js} +1 -1
- package/dist/{graphql-requests-146c02b2.esm.js → graphql-requests-9b0cf79b.esm.js} +1 -1
- package/dist/{graphql-requests-8d85e249.cjs.prod.js → graphql-requests-a42d578d.cjs.prod.js} +1 -1
- package/dist/{login-bc55f9dc.esm.js → login-35a7c23c.esm.js} +2 -2
- package/dist/{login-62f1dbbc.cjs.dev.js → login-ecf933dc.cjs.dev.js} +2 -2
- package/dist/{login-26fb7df4.cjs.prod.js → login-f13ca0a8.cjs.prod.js} +2 -2
- package/dist/{package-a60c74f2.cjs.prod.js → package-68bccd43.cjs.dev.js} +9 -9
- package/dist/{package-d3a871ef.cjs.dev.js → package-9161a458.cjs.prod.js} +9 -9
- package/dist/{package-b8b5ab54.esm.js → package-fdee3971.esm.js} +9 -9
- package/dist/{serve-6a951584.esm.js → serve-1036c2de.esm.js} +20 -6
- package/dist/{serve-f898c45e.cjs.dev.js → serve-50d33f0b.cjs.dev.js} +22 -6
- package/dist/{serve-5666b16a.cjs.prod.js → serve-8a506da6.cjs.prod.js} +22 -6
- package/dist/{start-34a4672f.esm.js → start-13e3a0ba.esm.js} +3 -3
- package/dist/{start-7cb33cfd.cjs.prod.js → start-5dc189f3.cjs.prod.js} +3 -3
- package/dist/{start-6d2995eb.cjs.dev.js → start-be2ffdfc.cjs.dev.js} +3 -3
- package/dist/{start-vite-7858b472.cjs.prod.js → start-vite-7b4df74e.cjs.prod.js} +4 -1
- package/dist/{start-vite-dd5cfb03.esm.js → start-vite-91fe1256.esm.js} +4 -1
- package/dist/{start-vite-703346c3.cjs.dev.js → start-vite-b93c91c5.cjs.dev.js} +4 -1
- package/package.json +9 -9
- 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
|
@@ -7,10 +7,10 @@ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
7
7
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
8
8
|
var fs = require('fs');
|
|
9
9
|
var path = require('path');
|
|
10
|
-
var
|
|
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-68bccd43.cjs.dev.js');
|
|
14
14
|
var doesFileExist = require('../../dist/does-file-exist-eb86baca.cjs.dev.js');
|
|
15
15
|
require('node:fs');
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ var path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
24
24
|
var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
25
25
|
var dotenvExpand__default = /*#__PURE__*/_interopDefault(dotenvExpand);
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
commander.program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(_package.pkgJson.version).option('--env [path]', `(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
28
28
|
|
|
29
29
|
// Makes the script crash on unhandled rejections instead of silently
|
|
30
30
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
@@ -36,19 +36,13 @@ process.on('unhandledRejection', err => {
|
|
|
36
36
|
// Get the current directory where the CLI is executed from. Usually this is the application folder.
|
|
37
37
|
const applicationDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
38
38
|
async function run() {
|
|
39
|
-
cli.option('--env <path>', `(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
40
|
-
|
|
41
|
-
// Default command
|
|
42
|
-
cli.command('').usage('\n\n Develop and build Custom Applications.').action(() => {
|
|
43
|
-
cli.outputHelp();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
39
|
// Command: start
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
commander.program.command('start').alias('dev').description('Starts the application in development mode using Webpack Dev Server.').action(async () => {
|
|
41
|
+
const globalOptions = commander.program.opts();
|
|
42
|
+
|
|
49
43
|
// Load dotenv files into the process environment.
|
|
50
44
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
51
|
-
loadDotEnvFiles(
|
|
45
|
+
loadDotEnvFiles(globalOptions);
|
|
52
46
|
|
|
53
47
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
54
48
|
process.env.BABEL_ENV = 'development';
|
|
@@ -58,18 +52,16 @@ async function run() {
|
|
|
58
52
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
59
53
|
console.log('');
|
|
60
54
|
}
|
|
61
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-
|
|
55
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-b93c91c5.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-be2ffdfc.cjs.dev.js'); });
|
|
62
56
|
await startCommand.default();
|
|
63
57
|
});
|
|
64
58
|
|
|
65
59
|
// Command: build
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
default: false
|
|
69
|
-
}).action(async options => {
|
|
60
|
+
commander.program.command('build').description('Bundles the application in production mode. Outputs a "public" folder.').option('--build-only', '(optional) If defined, the command only creates the production bundles without compiling the "index.html".', false).action(async options => {
|
|
61
|
+
const globalOptions = commander.program.opts();
|
|
70
62
|
// Load dotenv files into the process environment.
|
|
71
63
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
72
|
-
loadDotEnvFiles(
|
|
64
|
+
loadDotEnvFiles(globalOptions);
|
|
73
65
|
|
|
74
66
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
75
67
|
process.env.BABEL_ENV = 'production';
|
|
@@ -79,7 +71,7 @@ async function run() {
|
|
|
79
71
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
80
72
|
console.log('');
|
|
81
73
|
}
|
|
82
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-8131eae2.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-
|
|
74
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-8131eae2.cjs.dev.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-360f081d.cjs.dev.js'); });
|
|
83
75
|
await buildCommand.default();
|
|
84
76
|
const shouldAlsoCompile = !options.buildOnly;
|
|
85
77
|
if (shouldAlsoCompile) {
|
|
@@ -92,13 +84,12 @@ async function run() {
|
|
|
92
84
|
});
|
|
93
85
|
|
|
94
86
|
// Command: compile-html
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}).action(async options => {
|
|
87
|
+
commander.program.command('compile-html').description('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".').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.', false).action(async options => {
|
|
88
|
+
const globalOptions = commander.program.opts();
|
|
89
|
+
|
|
99
90
|
// Load dotenv files into the process environment.
|
|
100
91
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
101
|
-
loadDotEnvFiles(
|
|
92
|
+
loadDotEnvFiles(globalOptions);
|
|
102
93
|
|
|
103
94
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
104
95
|
process.env.NODE_ENV = 'production';
|
|
@@ -107,66 +98,61 @@ async function run() {
|
|
|
107
98
|
});
|
|
108
99
|
|
|
109
100
|
// Command: serve
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
commander.program.command('serve').description('Serves previously built and compiled application from the "public" folder.').action(async () => {
|
|
102
|
+
const globalOptions = commander.program.opts();
|
|
103
|
+
|
|
112
104
|
// Load dotenv files into the process environment.
|
|
113
105
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
114
|
-
loadDotEnvFiles(
|
|
106
|
+
loadDotEnvFiles(globalOptions);
|
|
115
107
|
|
|
116
108
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
117
109
|
process.env.NODE_ENV = 'production';
|
|
118
|
-
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-
|
|
110
|
+
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-50d33f0b.cjs.dev.js'); });
|
|
119
111
|
await serveCommand.default();
|
|
120
112
|
});
|
|
121
113
|
|
|
122
114
|
// Command: login
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
commander.program.command('login').description('Log in to your Merchant Center account through the CLI, using the cloud environment information from the Merchant Center customization config file. An API token is generated and stored in a configuration file for the related cloud environment, and valid for 36 hours.').action(async () => {
|
|
116
|
+
const globalOptions = commander.program.opts();
|
|
117
|
+
|
|
125
118
|
// Load dotenv files into the process environment.
|
|
126
119
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
127
|
-
loadDotEnvFiles(
|
|
120
|
+
loadDotEnvFiles(globalOptions);
|
|
128
121
|
|
|
129
122
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
130
123
|
process.env.NODE_ENV = 'production';
|
|
131
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
124
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-ecf933dc.cjs.dev.js'); });
|
|
132
125
|
await loginCommand.default();
|
|
133
126
|
});
|
|
134
127
|
|
|
135
128
|
// Command: config:sync
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}).action(async options => {
|
|
129
|
+
commander.program.command('config:sync').description('Synchronizes the local Merchant Center customization config with the Merchant Center. A new Merchant Center customization will be created if none existed, otherwise it will be updated.').option('--dry-run', '(optional) Executes the command but does not send any mutation request.', false).action(async options => {
|
|
130
|
+
const globalOptions = commander.program.opts();
|
|
131
|
+
|
|
140
132
|
// Load dotenv files into the process environment.
|
|
141
133
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
142
|
-
loadDotEnvFiles(
|
|
134
|
+
loadDotEnvFiles(globalOptions);
|
|
143
135
|
|
|
144
136
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
145
137
|
process.env.NODE_ENV = 'production';
|
|
146
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
138
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-482a69fe.cjs.dev.js'); });
|
|
147
139
|
await configSyncCommand.default(options);
|
|
148
140
|
});
|
|
149
141
|
|
|
150
142
|
// Command: deployment-previews:set
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}).action(async options => {
|
|
143
|
+
commander.program.command('deployment-previews:set').description('Creates or updates a deployment preview for the Custom Application.').option('--alias [deployment-preview-alias]', "(optional) Alias to be used for the deployment preview. If you don't provide an alias, the command will prompt you for it.").option('--url [deployment-preview-url]', "(optional) URL to be used for the deployment preview. If you don't provide a URL, the command will prompt you for it.").option('--dry-run', '(optional) Executes the command but does not send any mutation request.', false).action(async options => {
|
|
144
|
+
const globalOptions = commander.program.opts();
|
|
145
|
+
|
|
155
146
|
// Load dotenv files into the process environment.
|
|
156
147
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
157
|
-
loadDotEnvFiles(
|
|
148
|
+
loadDotEnvFiles(globalOptions);
|
|
158
149
|
|
|
159
150
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
160
151
|
process.env.NODE_ENV = 'production';
|
|
161
|
-
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-
|
|
152
|
+
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-14da3831.cjs.dev.js'); });
|
|
162
153
|
await deploymentsSetCommand.default(options);
|
|
163
154
|
});
|
|
164
|
-
|
|
165
|
-
cli.version(_package.pkgJson.version);
|
|
166
|
-
cli.parse(process.argv, {
|
|
167
|
-
run: false
|
|
168
|
-
});
|
|
169
|
-
await cli.runMatchedCommand();
|
|
155
|
+
commander.program.parse();
|
|
170
156
|
}
|
|
171
157
|
|
|
172
158
|
// Load dotenv files into the process environment.
|
|
@@ -7,10 +7,10 @@ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
7
7
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
8
8
|
var fs = require('fs');
|
|
9
9
|
var path = require('path');
|
|
10
|
-
var
|
|
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-9161a458.cjs.prod.js');
|
|
14
14
|
var doesFileExist = require('../../dist/does-file-exist-be53305d.cjs.prod.js');
|
|
15
15
|
require('node:fs');
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ var path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
24
24
|
var dotenv__default = /*#__PURE__*/_interopDefault(dotenv);
|
|
25
25
|
var dotenvExpand__default = /*#__PURE__*/_interopDefault(dotenvExpand);
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
commander.program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(_package.pkgJson.version).option('--env [path]', `(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
28
28
|
|
|
29
29
|
// Makes the script crash on unhandled rejections instead of silently
|
|
30
30
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
@@ -36,19 +36,13 @@ process.on('unhandledRejection', err => {
|
|
|
36
36
|
// Get the current directory where the CLI is executed from. Usually this is the application folder.
|
|
37
37
|
const applicationDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
38
38
|
async function run() {
|
|
39
|
-
cli.option('--env <path>', `(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
40
|
-
|
|
41
|
-
// Default command
|
|
42
|
-
cli.command('').usage('\n\n Develop and build Custom Applications.').action(() => {
|
|
43
|
-
cli.outputHelp();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
39
|
// Command: start
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
commander.program.command('start').alias('dev').description('Starts the application in development mode using Webpack Dev Server.').action(async () => {
|
|
41
|
+
const globalOptions = commander.program.opts();
|
|
42
|
+
|
|
49
43
|
// Load dotenv files into the process environment.
|
|
50
44
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
51
|
-
loadDotEnvFiles(
|
|
45
|
+
loadDotEnvFiles(globalOptions);
|
|
52
46
|
|
|
53
47
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
54
48
|
process.env.BABEL_ENV = 'development';
|
|
@@ -58,18 +52,16 @@ async function run() {
|
|
|
58
52
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
59
53
|
console.log('');
|
|
60
54
|
}
|
|
61
|
-
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-
|
|
55
|
+
const startCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/start-vite-7b4df74e.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/start-5dc189f3.cjs.prod.js'); });
|
|
62
56
|
await startCommand.default();
|
|
63
57
|
});
|
|
64
58
|
|
|
65
59
|
// Command: build
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
default: false
|
|
69
|
-
}).action(async options => {
|
|
60
|
+
commander.program.command('build').description('Bundles the application in production mode. Outputs a "public" folder.').option('--build-only', '(optional) If defined, the command only creates the production bundles without compiling the "index.html".', false).action(async options => {
|
|
61
|
+
const globalOptions = commander.program.opts();
|
|
70
62
|
// Load dotenv files into the process environment.
|
|
71
63
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
72
|
-
loadDotEnvFiles(
|
|
64
|
+
loadDotEnvFiles(globalOptions);
|
|
73
65
|
|
|
74
66
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
75
67
|
process.env.BABEL_ENV = 'production';
|
|
@@ -79,7 +71,7 @@ async function run() {
|
|
|
79
71
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
80
72
|
console.log('');
|
|
81
73
|
}
|
|
82
|
-
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-44c5100f.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-
|
|
74
|
+
const buildCommand = shouldUseExperimentalBundler ? await Promise.resolve().then(function () { return require('../../dist/build-vite-44c5100f.cjs.prod.js'); }) : await Promise.resolve().then(function () { return require('../../dist/build-6bd0ac22.cjs.prod.js'); });
|
|
83
75
|
await buildCommand.default();
|
|
84
76
|
const shouldAlsoCompile = !options.buildOnly;
|
|
85
77
|
if (shouldAlsoCompile) {
|
|
@@ -92,13 +84,12 @@ async function run() {
|
|
|
92
84
|
});
|
|
93
85
|
|
|
94
86
|
// Command: compile-html
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}).action(async options => {
|
|
87
|
+
commander.program.command('compile-html').description('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".').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.', false).action(async options => {
|
|
88
|
+
const globalOptions = commander.program.opts();
|
|
89
|
+
|
|
99
90
|
// Load dotenv files into the process environment.
|
|
100
91
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
101
|
-
loadDotEnvFiles(
|
|
92
|
+
loadDotEnvFiles(globalOptions);
|
|
102
93
|
|
|
103
94
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
104
95
|
process.env.NODE_ENV = 'production';
|
|
@@ -107,66 +98,61 @@ async function run() {
|
|
|
107
98
|
});
|
|
108
99
|
|
|
109
100
|
// Command: serve
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
commander.program.command('serve').description('Serves previously built and compiled application from the "public" folder.').action(async () => {
|
|
102
|
+
const globalOptions = commander.program.opts();
|
|
103
|
+
|
|
112
104
|
// Load dotenv files into the process environment.
|
|
113
105
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
114
|
-
loadDotEnvFiles(
|
|
106
|
+
loadDotEnvFiles(globalOptions);
|
|
115
107
|
|
|
116
108
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
117
109
|
process.env.NODE_ENV = 'production';
|
|
118
|
-
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-
|
|
110
|
+
const serveCommand = await Promise.resolve().then(function () { return require('../../dist/serve-8a506da6.cjs.prod.js'); });
|
|
119
111
|
await serveCommand.default();
|
|
120
112
|
});
|
|
121
113
|
|
|
122
114
|
// Command: login
|
|
123
|
-
|
|
124
|
-
|
|
115
|
+
commander.program.command('login').description('Log in to your Merchant Center account through the CLI, using the cloud environment information from the Merchant Center customization config file. An API token is generated and stored in a configuration file for the related cloud environment, and valid for 36 hours.').action(async () => {
|
|
116
|
+
const globalOptions = commander.program.opts();
|
|
117
|
+
|
|
125
118
|
// Load dotenv files into the process environment.
|
|
126
119
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
127
|
-
loadDotEnvFiles(
|
|
120
|
+
loadDotEnvFiles(globalOptions);
|
|
128
121
|
|
|
129
122
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
130
123
|
process.env.NODE_ENV = 'production';
|
|
131
|
-
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-
|
|
124
|
+
const loginCommand = await Promise.resolve().then(function () { return require('../../dist/login-f13ca0a8.cjs.prod.js'); });
|
|
132
125
|
await loginCommand.default();
|
|
133
126
|
});
|
|
134
127
|
|
|
135
128
|
// Command: config:sync
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}).action(async options => {
|
|
129
|
+
commander.program.command('config:sync').description('Synchronizes the local Merchant Center customization config with the Merchant Center. A new Merchant Center customization will be created if none existed, otherwise it will be updated.').option('--dry-run', '(optional) Executes the command but does not send any mutation request.', false).action(async options => {
|
|
130
|
+
const globalOptions = commander.program.opts();
|
|
131
|
+
|
|
140
132
|
// Load dotenv files into the process environment.
|
|
141
133
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
142
|
-
loadDotEnvFiles(
|
|
134
|
+
loadDotEnvFiles(globalOptions);
|
|
143
135
|
|
|
144
136
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
145
137
|
process.env.NODE_ENV = 'production';
|
|
146
|
-
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-
|
|
138
|
+
const configSyncCommand = await Promise.resolve().then(function () { return require('../../dist/config-sync-d53518fd.cjs.prod.js'); });
|
|
147
139
|
await configSyncCommand.default(options);
|
|
148
140
|
});
|
|
149
141
|
|
|
150
142
|
// Command: deployment-previews:set
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}).action(async options => {
|
|
143
|
+
commander.program.command('deployment-previews:set').description('Creates or updates a deployment preview for the Custom Application.').option('--alias [deployment-preview-alias]', "(optional) Alias to be used for the deployment preview. If you don't provide an alias, the command will prompt you for it.").option('--url [deployment-preview-url]', "(optional) URL to be used for the deployment preview. If you don't provide a URL, the command will prompt you for it.").option('--dry-run', '(optional) Executes the command but does not send any mutation request.', false).action(async options => {
|
|
144
|
+
const globalOptions = commander.program.opts();
|
|
145
|
+
|
|
155
146
|
// Load dotenv files into the process environment.
|
|
156
147
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
157
|
-
loadDotEnvFiles(
|
|
148
|
+
loadDotEnvFiles(globalOptions);
|
|
158
149
|
|
|
159
150
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
160
151
|
process.env.NODE_ENV = 'production';
|
|
161
|
-
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-
|
|
152
|
+
const deploymentsSetCommand = await Promise.resolve().then(function () { return require('../../dist/deployment-previews-set-b2dc5c83.cjs.prod.js'); });
|
|
162
153
|
await deploymentsSetCommand.default(options);
|
|
163
154
|
});
|
|
164
|
-
|
|
165
|
-
cli.version(_package.pkgJson.version);
|
|
166
|
-
cli.parse(process.argv, {
|
|
167
|
-
run: false
|
|
168
|
-
});
|
|
169
|
-
await cli.runMatchedCommand();
|
|
155
|
+
commander.program.parse();
|
|
170
156
|
}
|
|
171
157
|
|
|
172
158
|
// Load dotenv files into the process environment.
|
|
@@ -3,14 +3,14 @@ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
3
3
|
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
|
-
import {
|
|
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-fdee3971.esm.js';
|
|
10
10
|
import { d as doesFileExist } from '../../dist/does-file-exist-32618334.esm.js';
|
|
11
11
|
import 'node:fs';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
program.name('mc-scripts').description('CLI to develop and build Merchant Center customizations.').version(pkgJson.version).option('--env [path]', `(optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.`);
|
|
14
14
|
|
|
15
15
|
// Makes the script crash on unhandled rejections instead of silently
|
|
16
16
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
@@ -22,19 +22,13 @@ process.on('unhandledRejection', err => {
|
|
|
22
22
|
// Get the current directory where the CLI is executed from. Usually this is the application folder.
|
|
23
23
|
const applicationDirectory = fs.realpathSync(process.cwd());
|
|
24
24
|
async function run() {
|
|
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.`);
|
|
26
|
-
|
|
27
|
-
// Default command
|
|
28
|
-
cli.command('').usage('\n\n Develop and build Custom Applications.').action(() => {
|
|
29
|
-
cli.outputHelp();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
25
|
// Command: start
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
program.command('start').alias('dev').description('Starts the application in development mode using Webpack Dev Server.').action(async () => {
|
|
27
|
+
const globalOptions = program.opts();
|
|
28
|
+
|
|
35
29
|
// Load dotenv files into the process environment.
|
|
36
30
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
37
|
-
loadDotEnvFiles(
|
|
31
|
+
loadDotEnvFiles(globalOptions);
|
|
38
32
|
|
|
39
33
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
40
34
|
process.env.BABEL_ENV = 'development';
|
|
@@ -44,18 +38,16 @@ async function run() {
|
|
|
44
38
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
45
39
|
console.log('');
|
|
46
40
|
}
|
|
47
|
-
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-
|
|
41
|
+
const startCommand = shouldUseExperimentalBundler ? await import('../../dist/start-vite-91fe1256.esm.js') : await import('../../dist/start-13e3a0ba.esm.js');
|
|
48
42
|
await startCommand.default();
|
|
49
43
|
});
|
|
50
44
|
|
|
51
45
|
// Command: build
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
default: false
|
|
55
|
-
}).action(async options => {
|
|
46
|
+
program.command('build').description('Bundles the application in production mode. Outputs a "public" folder.').option('--build-only', '(optional) If defined, the command only creates the production bundles without compiling the "index.html".', false).action(async options => {
|
|
47
|
+
const globalOptions = program.opts();
|
|
56
48
|
// Load dotenv files into the process environment.
|
|
57
49
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
58
|
-
loadDotEnvFiles(
|
|
50
|
+
loadDotEnvFiles(globalOptions);
|
|
59
51
|
|
|
60
52
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
61
53
|
process.env.BABEL_ENV = 'production';
|
|
@@ -65,7 +57,7 @@ async function run() {
|
|
|
65
57
|
console.log('Experimental Vite bundler enabled! 🚀');
|
|
66
58
|
console.log('');
|
|
67
59
|
}
|
|
68
|
-
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-23f6852c.esm.js') : await import('../../dist/build-
|
|
60
|
+
const buildCommand = shouldUseExperimentalBundler ? await import('../../dist/build-vite-23f6852c.esm.js') : await import('../../dist/build-d10bc41b.esm.js');
|
|
69
61
|
await buildCommand.default();
|
|
70
62
|
const shouldAlsoCompile = !options.buildOnly;
|
|
71
63
|
if (shouldAlsoCompile) {
|
|
@@ -78,13 +70,12 @@ async function run() {
|
|
|
78
70
|
});
|
|
79
71
|
|
|
80
72
|
// Command: compile-html
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}).action(async options => {
|
|
73
|
+
program.command('compile-html').description('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".').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.', false).action(async options => {
|
|
74
|
+
const globalOptions = program.opts();
|
|
75
|
+
|
|
85
76
|
// Load dotenv files into the process environment.
|
|
86
77
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
87
|
-
loadDotEnvFiles(
|
|
78
|
+
loadDotEnvFiles(globalOptions);
|
|
88
79
|
|
|
89
80
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
90
81
|
process.env.NODE_ENV = 'production';
|
|
@@ -93,66 +84,61 @@ async function run() {
|
|
|
93
84
|
});
|
|
94
85
|
|
|
95
86
|
// Command: serve
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
program.command('serve').description('Serves previously built and compiled application from the "public" folder.').action(async () => {
|
|
88
|
+
const globalOptions = program.opts();
|
|
89
|
+
|
|
98
90
|
// Load dotenv files into the process environment.
|
|
99
91
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
100
|
-
loadDotEnvFiles(
|
|
92
|
+
loadDotEnvFiles(globalOptions);
|
|
101
93
|
|
|
102
94
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
103
95
|
process.env.NODE_ENV = 'production';
|
|
104
|
-
const serveCommand = await import('../../dist/serve-
|
|
96
|
+
const serveCommand = await import('../../dist/serve-1036c2de.esm.js');
|
|
105
97
|
await serveCommand.default();
|
|
106
98
|
});
|
|
107
99
|
|
|
108
100
|
// Command: login
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
program.command('login').description('Log in to your Merchant Center account through the CLI, using the cloud environment information from the Merchant Center customization config file. An API token is generated and stored in a configuration file for the related cloud environment, and valid for 36 hours.').action(async () => {
|
|
102
|
+
const globalOptions = program.opts();
|
|
103
|
+
|
|
111
104
|
// Load dotenv files into the process environment.
|
|
112
105
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
113
|
-
loadDotEnvFiles(
|
|
106
|
+
loadDotEnvFiles(globalOptions);
|
|
114
107
|
|
|
115
108
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
116
109
|
process.env.NODE_ENV = 'production';
|
|
117
|
-
const loginCommand = await import('../../dist/login-
|
|
110
|
+
const loginCommand = await import('../../dist/login-35a7c23c.esm.js');
|
|
118
111
|
await loginCommand.default();
|
|
119
112
|
});
|
|
120
113
|
|
|
121
114
|
// Command: config:sync
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}).action(async options => {
|
|
115
|
+
program.command('config:sync').description('Synchronizes the local Merchant Center customization config with the Merchant Center. A new Merchant Center customization will be created if none existed, otherwise it will be updated.').option('--dry-run', '(optional) Executes the command but does not send any mutation request.', false).action(async options => {
|
|
116
|
+
const globalOptions = program.opts();
|
|
117
|
+
|
|
126
118
|
// Load dotenv files into the process environment.
|
|
127
119
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
128
|
-
loadDotEnvFiles(
|
|
120
|
+
loadDotEnvFiles(globalOptions);
|
|
129
121
|
|
|
130
122
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
131
123
|
process.env.NODE_ENV = 'production';
|
|
132
|
-
const configSyncCommand = await import('../../dist/config-sync-
|
|
124
|
+
const configSyncCommand = await import('../../dist/config-sync-1b8ae40b.esm.js');
|
|
133
125
|
await configSyncCommand.default(options);
|
|
134
126
|
});
|
|
135
127
|
|
|
136
128
|
// Command: deployment-previews:set
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}).action(async options => {
|
|
129
|
+
program.command('deployment-previews:set').description('Creates or updates a deployment preview for the Custom Application.').option('--alias [deployment-preview-alias]', "(optional) Alias to be used for the deployment preview. If you don't provide an alias, the command will prompt you for it.").option('--url [deployment-preview-url]', "(optional) URL to be used for the deployment preview. If you don't provide a URL, the command will prompt you for it.").option('--dry-run', '(optional) Executes the command but does not send any mutation request.', false).action(async options => {
|
|
130
|
+
const globalOptions = program.opts();
|
|
131
|
+
|
|
141
132
|
// Load dotenv files into the process environment.
|
|
142
133
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
143
|
-
loadDotEnvFiles(
|
|
134
|
+
loadDotEnvFiles(globalOptions);
|
|
144
135
|
|
|
145
136
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
146
137
|
process.env.NODE_ENV = 'production';
|
|
147
|
-
const deploymentsSetCommand = await import('../../dist/deployment-previews-set-
|
|
138
|
+
const deploymentsSetCommand = await import('../../dist/deployment-previews-set-b6c92418.esm.js');
|
|
148
139
|
await deploymentsSetCommand.default(options);
|
|
149
140
|
});
|
|
150
|
-
|
|
151
|
-
cli.version(pkgJson.version);
|
|
152
|
-
cli.parse(process.argv, {
|
|
153
|
-
run: false
|
|
154
|
-
});
|
|
155
|
-
await cli.runMatchedCommand();
|
|
141
|
+
program.parse();
|
|
156
142
|
}
|
|
157
143
|
|
|
158
144
|
// Load dotenv files into the process environment.
|
|
@@ -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-c5364376.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,9 +40,9 @@ 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-fe0eda38.cjs.dev.js');
|
|
44
44
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
|
-
require('./package-
|
|
45
|
+
require('./package-68bccd43.cjs.dev.js');
|
|
46
46
|
require('./has-jsx-runtime-aa5d21ee.cjs.dev.js');
|
|
47
47
|
require('./optimizations-7789145e.cjs.dev.js');
|
|
48
48
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
@@ -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-03fb373c.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,9 +40,9 @@ 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-5e470fa7.cjs.prod.js');
|
|
44
44
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
|
-
require('./package-
|
|
45
|
+
require('./package-9161a458.cjs.prod.js');
|
|
46
46
|
require('./has-jsx-runtime-c3202df5.cjs.prod.js');
|
|
47
47
|
require('./optimizations-fb93514f.cjs.prod.js');
|
|
48
48
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|