@commercetools-frontend/mc-scripts 20.12.1 → 21.0.0-rc.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/build/bin/cli.js +39 -20
- package/build/commands/build.js +15 -1
- package/build/commands/compile-html.js +10 -52
- package/build/commands/serve.js +3 -10
- package/build/commands/start.js +1 -1
- package/build/config/create-webpack-config-for-development.js +7 -8
- package/build/config/create-webpack-config-for-production.js +10 -17
- package/build/config/paths.js +3 -4
- package/package.json +25 -25
package/build/bin/cli.js
CHANGED
|
@@ -22,7 +22,8 @@ const spawn = require('react-dev-utils/crossSpawn');
|
|
|
22
22
|
const flags = mri(process.argv.slice(2), {
|
|
23
23
|
alias: {
|
|
24
24
|
help: ['h']
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
boolean: ['build-only']
|
|
26
27
|
});
|
|
27
28
|
const commands = flags._;
|
|
28
29
|
|
|
@@ -30,22 +31,25 @@ if (commands.length === 0 || flags.help && commands.length === 0) {
|
|
|
30
31
|
console.log(`
|
|
31
32
|
Usage: mc-scripts [global-options] [command] [options]
|
|
32
33
|
|
|
34
|
+
https://docs.commercetools.com/custom-applications/api-reference/cli.
|
|
35
|
+
|
|
33
36
|
Global options:
|
|
34
37
|
|
|
35
|
-
--env <path>
|
|
38
|
+
--env <path> (optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.
|
|
36
39
|
|
|
37
40
|
Commands:
|
|
38
41
|
|
|
39
|
-
build
|
|
42
|
+
build Bundles the application in production mode. Outputs a "public" folder.
|
|
43
|
+
--build-only (optional) If defined, the command only creates the production bundles without compiling the "index.html".
|
|
40
44
|
|
|
41
|
-
compile-html
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
--inline-csp (optional) If defined, the CSP config is inlined in the HTML head as a meta tag. This might be useful to keep using a static config for a hosting provider without the dynamically generated Content-Security-Policy header.
|
|
45
|
+
compile-html Compiles "index.html.template" file into a "index.html" with all the required runtime configuration. Additionally, the security headers are also compiled and printed to stdout, unless you use a "transformer".
|
|
46
|
+
--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).
|
|
47
|
+
--print-security-headers (optional) The path to a JS module that can be used to generate a configuration for a specific cloud provider (e.g. Vercel, Netlify).
|
|
45
48
|
|
|
46
|
-
start
|
|
49
|
+
start Starts the application in development mode using Webpack Dev Server.
|
|
50
|
+
|
|
51
|
+
serve Serves previously built and compiled application from the "public" folder.
|
|
47
52
|
|
|
48
|
-
serve Serves previously built and compiled application from the "public" folder.
|
|
49
53
|
`);
|
|
50
54
|
process.exit(0);
|
|
51
55
|
}
|
|
@@ -62,7 +66,15 @@ const applicationDirectory = fs.realpathSync(process.cwd());
|
|
|
62
66
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
63
67
|
process.env.BABEL_ENV = 'production';
|
|
64
68
|
process.env.NODE_ENV = 'production';
|
|
65
|
-
|
|
69
|
+
const shouldAlsoCompile = !flags['build-only'];
|
|
70
|
+
proxyCommand(command, {
|
|
71
|
+
noExit: shouldAlsoCompile
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
if (shouldAlsoCompile) {
|
|
75
|
+
proxyCommand('compile-html');
|
|
76
|
+
}
|
|
77
|
+
|
|
66
78
|
break;
|
|
67
79
|
}
|
|
68
80
|
|
|
@@ -70,7 +82,7 @@ const applicationDirectory = fs.realpathSync(process.cwd());
|
|
|
70
82
|
{
|
|
71
83
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
72
84
|
process.env.NODE_ENV = 'production';
|
|
73
|
-
proxyCommand();
|
|
85
|
+
proxyCommand(command);
|
|
74
86
|
break;
|
|
75
87
|
}
|
|
76
88
|
|
|
@@ -79,8 +91,8 @@ const applicationDirectory = fs.realpathSync(process.cwd());
|
|
|
79
91
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
80
92
|
process.env.NODE_ENV = 'production'; // Get specific flag for this command.
|
|
81
93
|
|
|
82
|
-
const commandArgs = getArgsForCommand(['transformer'
|
|
83
|
-
proxyCommand({
|
|
94
|
+
const commandArgs = getArgsForCommand(['transformer']);
|
|
95
|
+
proxyCommand(command, {
|
|
84
96
|
commandArgs
|
|
85
97
|
});
|
|
86
98
|
break;
|
|
@@ -91,7 +103,7 @@ const applicationDirectory = fs.realpathSync(process.cwd());
|
|
|
91
103
|
// Do this as the first thing so that any code reading it knows the right env.
|
|
92
104
|
process.env.BABEL_ENV = 'development';
|
|
93
105
|
process.env.NODE_ENV = 'development';
|
|
94
|
-
proxyCommand();
|
|
106
|
+
proxyCommand(command);
|
|
95
107
|
break;
|
|
96
108
|
}
|
|
97
109
|
|
|
@@ -117,14 +129,15 @@ function getArgsForCommand(allowedFlags = []) {
|
|
|
117
129
|
}, []);
|
|
118
130
|
}
|
|
119
131
|
|
|
120
|
-
function proxyCommand({
|
|
121
|
-
commandArgs
|
|
132
|
+
function proxyCommand(fileName, {
|
|
133
|
+
commandArgs,
|
|
134
|
+
noExit
|
|
122
135
|
} = {}) {
|
|
123
136
|
// Load dotenv files into the process environment.
|
|
124
137
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
125
138
|
loadDotEnvFiles(flags); // Spawn the actual command.
|
|
126
139
|
|
|
127
|
-
const result = spawn.sync('node', [require.resolve(`../commands/${
|
|
140
|
+
const result = spawn.sync('node', [require.resolve(`../commands/${fileName}`)].concat(commandArgs), {
|
|
128
141
|
stdio: 'inherit'
|
|
129
142
|
}); // Handle exit signals.
|
|
130
143
|
|
|
@@ -132,13 +145,13 @@ function proxyCommand({
|
|
|
132
145
|
switch (result.signal) {
|
|
133
146
|
case 'SIGKILL':
|
|
134
147
|
{
|
|
135
|
-
console.log(`The command ${
|
|
148
|
+
console.log(`The command ${fileName} failed because the process exited too early. This probably means the system ran out of memory or someone called "kill -9" on the process.`);
|
|
136
149
|
break;
|
|
137
150
|
}
|
|
138
151
|
|
|
139
152
|
case 'SIGTERM':
|
|
140
153
|
{
|
|
141
|
-
console.log(`The command ${
|
|
154
|
+
console.log(`The command ${fileName} failed because the process exited too early. Someone might have called "kill" or "killall", or the system could be shutting down.`);
|
|
142
155
|
break;
|
|
143
156
|
}
|
|
144
157
|
|
|
@@ -149,7 +162,13 @@ function proxyCommand({
|
|
|
149
162
|
process.exit(1);
|
|
150
163
|
}
|
|
151
164
|
|
|
152
|
-
|
|
165
|
+
if (result.status > 0) {
|
|
166
|
+
process.exit(result.status);
|
|
167
|
+
} else {
|
|
168
|
+
if (!noExit) {
|
|
169
|
+
process.exit(result.status);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
153
172
|
} // Load dotenv files into the process environment.
|
|
154
173
|
// This is essentially what `dotenv-cli` does, but it's now built into this CLI.
|
|
155
174
|
// Inspired also by https://create-react-app.dev/docs/adding-custom-environment-variables/#what-other-env-files-can-be-used
|
package/build/commands/build.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// NOTE: `react-dev-utils` does not currently fully support Webpack v5.
|
|
5
5
|
// Most of the imports work, however we might bump into some edge cases.
|
|
6
6
|
// In any case, once they release a compatible version, we should't have problems.
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
7
9
|
const fs = require('fs-extra');
|
|
8
10
|
|
|
9
11
|
const webpack = require('webpack');
|
|
@@ -18,6 +20,10 @@ const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
|
|
|
18
20
|
|
|
19
21
|
const printBuildError = require('react-dev-utils/printBuildError');
|
|
20
22
|
|
|
23
|
+
const {
|
|
24
|
+
packageLocation: applicationStaticAssetsPath
|
|
25
|
+
} = require('@commercetools-frontend/assets');
|
|
26
|
+
|
|
21
27
|
const paths = require('../config/paths');
|
|
22
28
|
|
|
23
29
|
const createWebpackConfigForProduction = require('../config/create-webpack-config-for-production');
|
|
@@ -38,7 +44,9 @@ if (!checkRequiredFiles([])) {
|
|
|
38
44
|
measureFileSizesBeforeBuild(paths.appBuild).then(previousFileSizes => {
|
|
39
45
|
// Remove all content but keep the directory so that
|
|
40
46
|
// if you're in it, you don't end up in Trash
|
|
41
|
-
fs.emptyDirSync(paths.appBuild); //
|
|
47
|
+
fs.emptyDirSync(paths.appBuild); // Copy default files
|
|
48
|
+
|
|
49
|
+
copyDefaultFiles(); // Start the webpack build
|
|
42
50
|
|
|
43
51
|
return build(previousFileSizes);
|
|
44
52
|
}).then(({
|
|
@@ -129,4 +137,10 @@ function build(previousFileSizes) {
|
|
|
129
137
|
});
|
|
130
138
|
});
|
|
131
139
|
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function copyDefaultFiles() {
|
|
143
|
+
fs.copySync(path.join(applicationStaticAssetsPath, 'html-page'), paths.appBuild, {
|
|
144
|
+
dereference: true
|
|
145
|
+
});
|
|
132
146
|
}
|
|
@@ -3,69 +3,25 @@
|
|
|
3
3
|
/* eslint-disable no-console,global-require,import/no-dynamic-require */
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
|
|
6
|
-
const path = require('path');
|
|
7
|
-
|
|
8
|
-
const shelljs = require('shelljs');
|
|
9
|
-
|
|
10
6
|
const mri = require('mri');
|
|
11
7
|
|
|
12
|
-
const
|
|
13
|
-
packageLocation: applicationStaticAssetsPath
|
|
14
|
-
} = require('@commercetools-frontend/assets');
|
|
8
|
+
const chalk = require('react-dev-utils/chalk');
|
|
15
9
|
|
|
16
10
|
const {
|
|
17
11
|
compileHtml
|
|
18
12
|
} = require('@commercetools-frontend/mc-html-template');
|
|
19
13
|
|
|
14
|
+
const paths = require('../config/paths');
|
|
15
|
+
|
|
20
16
|
const flags = mri(process.argv.slice(2), {
|
|
21
|
-
boolean: ['
|
|
17
|
+
boolean: ['print-security-headers']
|
|
22
18
|
});
|
|
23
19
|
const appDirectory = fs.realpathSync(process.cwd());
|
|
24
20
|
|
|
25
|
-
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
|
|
26
|
-
|
|
27
|
-
const publicAssetsPath = resolveApp('public');
|
|
28
|
-
const paths = {
|
|
29
|
-
publicAssetsPath,
|
|
30
|
-
// NOTE: previously, for running the prod server locally, we were copying
|
|
31
|
-
// assets into public/assets and compiling the index.html into public folder.
|
|
32
|
-
// To run the app then we would define the cdnUrl as http://localhost:3001/assets,
|
|
33
|
-
// because of the assets subfolder.
|
|
34
|
-
// However, on the webpack-dev-server, the index.html and the bundles are
|
|
35
|
-
// served from the same folder. It's really complicated to get the config right
|
|
36
|
-
// and eventually it's not worth the effort as it just feels like a bloody workaround.
|
|
37
|
-
// Therefore, we do it a bit different now: keep the webpack-dev-server
|
|
38
|
-
// config as is and adjust the mc-script to serve the files the same way.
|
|
39
|
-
// Remember that for normal production usage, assets are served from a CDN.
|
|
40
|
-
// So now we have a flat public folder instead of an assets subfolder.
|
|
41
|
-
// Which means that the 3 static files (favicon, google**.html, robots.txt)
|
|
42
|
-
// need to be put somewhere else (public-assets) and copy into the public
|
|
43
|
-
// folder when the server starts.
|
|
44
|
-
publicAssetsFolderPath: path.join(applicationStaticAssetsPath, 'html-page/*'),
|
|
45
|
-
indexHtmlTemplatePath: path.join(publicAssetsPath, 'index.html.template'),
|
|
46
|
-
indexHtmlPath: path.join(publicAssetsPath, 'index.html')
|
|
47
|
-
};
|
|
48
|
-
shelljs.rm('-rf', publicAssetsPath);
|
|
49
|
-
shelljs.mkdir('-p', publicAssetsPath);
|
|
50
|
-
shelljs.cp('-R', paths.publicAssetsFolderPath, publicAssetsPath); // Resolve the absolute path of the caller location. This is necessary
|
|
51
|
-
// to point to files within that folder.
|
|
52
|
-
|
|
53
|
-
const assetsFrom = resolveApp('dist/assets'); // Make sure that the `dist/assets` folder is available.
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
fs.accessSync(assetsFrom, fs.F_OK);
|
|
57
|
-
} catch (error) {
|
|
58
|
-
throw new Error('Could not find "dist/assets" folder. Did you run `mc-scripts build` first?');
|
|
59
|
-
} // Copy the `dist/assets` folder into the `public` folder.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
shelljs.cp('-R', path.join(assetsFrom, '/*'), publicAssetsPath);
|
|
63
|
-
|
|
64
21
|
const generateStatic = async () => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
fs.writeFileSync(paths.indexHtmlPath, compiled.indexHtmlContent, {
|
|
22
|
+
console.log('Compiling index.html...');
|
|
23
|
+
const compiled = await compileHtml(paths.appIndexHtmlTemplate);
|
|
24
|
+
fs.writeFileSync(paths.appIndexHtml, compiled.indexHtmlContent, {
|
|
69
25
|
encoding: 'utf8'
|
|
70
26
|
});
|
|
71
27
|
|
|
@@ -81,9 +37,11 @@ const generateStatic = async () => {
|
|
|
81
37
|
} catch (error) {
|
|
82
38
|
throw new Error(`Could not load transformer module "${flags.transformer}"\n${error.stack}`);
|
|
83
39
|
}
|
|
84
|
-
} else {
|
|
40
|
+
} else if (flags['print-security-headers']) {
|
|
85
41
|
console.log(JSON.stringify(compiled.headers));
|
|
86
42
|
}
|
|
43
|
+
|
|
44
|
+
console.log(chalk.green('Compiled successfully.\n'));
|
|
87
45
|
};
|
|
88
46
|
|
|
89
47
|
generateStatic().catch(error => {
|
package/build/commands/serve.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-console,global-require,import/no-dynamic-require */
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
|
|
6
|
-
const path = require('path');
|
|
7
|
-
|
|
8
4
|
const http = require('http');
|
|
9
5
|
|
|
10
6
|
const serveHandler = require('serve-handler');
|
|
11
7
|
|
|
12
|
-
const
|
|
13
|
-
const appDirectory = fs.realpathSync(process.cwd());
|
|
8
|
+
const paths = require('../config/paths');
|
|
14
9
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const publicAssetsPath = resolveApp('public');
|
|
10
|
+
const port = 3001;
|
|
18
11
|
const server = http.createServer((request, response) => {
|
|
19
12
|
// You pass two more arguments for config and middleware
|
|
20
13
|
// More details here: https://github.com/vercel/serve-handler#options
|
|
21
14
|
return serveHandler(request, response, {
|
|
22
|
-
public:
|
|
15
|
+
public: paths.appBuild,
|
|
23
16
|
rewrites: [{
|
|
24
17
|
source: '/favicon*',
|
|
25
18
|
destination: '/favicon.png'
|
package/build/commands/start.js
CHANGED
|
@@ -30,7 +30,6 @@ const defaultToggleFlags = {
|
|
|
30
30
|
disableCoreJs: false
|
|
31
31
|
};
|
|
32
32
|
const defaultOptions = {
|
|
33
|
-
distPath: paths.distPath,
|
|
34
33
|
entryPoint: paths.entryPoint,
|
|
35
34
|
sourceFolders: paths.sourceFolders,
|
|
36
35
|
postcssOptions: {},
|
|
@@ -50,7 +49,6 @@ const reactRefreshOverlayEntry = require.resolve('react-dev-utils/refreshOverlay
|
|
|
50
49
|
* "entry point".
|
|
51
50
|
*
|
|
52
51
|
* @param {Object} options - Options to configure the Webpack config
|
|
53
|
-
* @param {string} options.distPath - The absolute path to the `dist` folder where Webpack should output the assets.
|
|
54
52
|
* @param {string} options.entryPoint - The absolute path to the application entry point file.
|
|
55
53
|
* @param {string[]} options.sourceFolders[] - A list of folders where Webpack should look for source files.
|
|
56
54
|
* @param {Object} options.postcssOptions - Options related to Postcss plugins. See `createPostcssConfig` function.
|
|
@@ -201,15 +199,16 @@ module.exports = function createWebpackConfigForDevelopment(options = {}) {
|
|
|
201
199
|
}, {
|
|
202
200
|
loader: require.resolve('@svgr/webpack'),
|
|
203
201
|
options: {
|
|
204
|
-
// NOTE: disable this and manually add `removeViewBox: false` in the SVGO plugins list
|
|
205
|
-
// See related PR: https://github.com/smooth-code/svgr/pull/137
|
|
206
202
|
icon: false,
|
|
207
203
|
svgoConfig: {
|
|
208
204
|
plugins: [{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
// https://github.com/svg/svgo#default-preset
|
|
206
|
+
name: 'preset-default',
|
|
207
|
+
params: {
|
|
208
|
+
overrides: {
|
|
209
|
+
removeViewBox: false
|
|
210
|
+
}
|
|
211
|
+
}
|
|
213
212
|
}]
|
|
214
213
|
}
|
|
215
214
|
}
|
|
@@ -13,8 +13,7 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
|
13
13
|
|
|
14
14
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
15
15
|
|
|
16
|
-
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
17
|
-
|
|
16
|
+
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
18
17
|
|
|
19
18
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
20
19
|
|
|
@@ -46,7 +45,6 @@ const defaultToggleFlags = {
|
|
|
46
45
|
disableCoreJs: false
|
|
47
46
|
};
|
|
48
47
|
const defaultOptions = {
|
|
49
|
-
distPath: paths.distPath,
|
|
50
48
|
entryPoint: paths.entryPoint,
|
|
51
49
|
sourceFolders: paths.sourceFolders,
|
|
52
50
|
postcssOptions: {},
|
|
@@ -59,7 +57,6 @@ const defaultOptions = {
|
|
|
59
57
|
* "entry point".
|
|
60
58
|
*
|
|
61
59
|
* @param {Object} options - Options to configure the Webpack config
|
|
62
|
-
* @param {string} options.distPath - The absolute path to the `dist` folder where Webpack should output the assets.
|
|
63
60
|
* @param {string} options.entryPoint - The absolute path to the application entry point file.
|
|
64
61
|
* @param {string[]} options.sourceFolders[] - A list of folders where Webpack should look for source files.
|
|
65
62
|
* @param {Object} options.postcssOptions - Options related to Postcss plugins. See `createPostcssConfig` function.
|
|
@@ -158,12 +155,7 @@ module.exports = function createWebpackConfigForProduction(options = {}) {
|
|
|
158
155
|
// Will be injected on runtime. See `packages/application-shell/src/public-path.js`
|
|
159
156
|
publicPath: ''
|
|
160
157
|
},
|
|
161
|
-
plugins: [//
|
|
162
|
-
// dangerouslyAllowCleanPatternsOutsideProject: true,
|
|
163
|
-
// dry: true,
|
|
164
|
-
// cleanOnceBeforeBuildPatterns: [mergedOptions.distPath],
|
|
165
|
-
// }),
|
|
166
|
-
// Allows to "assign" custom options to the `webpack` object.
|
|
158
|
+
plugins: [// Allows to "assign" custom options to the `webpack` object.
|
|
167
159
|
// At the moment, this is used to share some props with `postcss.config`.
|
|
168
160
|
new webpack.LoaderOptionsPlugin({
|
|
169
161
|
options: {
|
|
@@ -186,7 +178,7 @@ module.exports = function createWebpackConfigForProduction(options = {}) {
|
|
|
186
178
|
// This is necessary to programmatically refer to the correct bundle path
|
|
187
179
|
// in the `index.html`.
|
|
188
180
|
new FinalStatsWriterPlugin({
|
|
189
|
-
outputPath:
|
|
181
|
+
outputPath: paths.appBuild,
|
|
190
182
|
includeFields: ['entrypoints', 'assets', 'publicPath', 'time']
|
|
191
183
|
}), mergedOptions.toggleFlags.generateIndexHtml && new HtmlWebpackPlugin({
|
|
192
184
|
inject: false,
|
|
@@ -223,15 +215,16 @@ module.exports = function createWebpackConfigForProduction(options = {}) {
|
|
|
223
215
|
}, {
|
|
224
216
|
loader: require.resolve('@svgr/webpack'),
|
|
225
217
|
options: {
|
|
226
|
-
// NOTE: disable this and manually add `removeViewBox: false` in the SVGO plugins list
|
|
227
|
-
// See related PR: https://github.com/smooth-code/svgr/pull/137
|
|
228
218
|
icon: false,
|
|
229
219
|
svgoConfig: {
|
|
230
220
|
plugins: [{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
221
|
+
// https://github.com/svg/svgo#default-preset
|
|
222
|
+
name: 'preset-default',
|
|
223
|
+
params: {
|
|
224
|
+
overrides: {
|
|
225
|
+
removeViewBox: false
|
|
226
|
+
}
|
|
227
|
+
}
|
|
235
228
|
}]
|
|
236
229
|
}
|
|
237
230
|
}
|
package/build/config/paths.js
CHANGED
|
@@ -26,13 +26,12 @@ const resolveModule = (resolveFn, filePath) => {
|
|
|
26
26
|
|
|
27
27
|
const paths = {
|
|
28
28
|
appPackageJson: resolveApp('package.json'),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
appIndexHtml: resolveApp('
|
|
29
|
+
appBuild: resolveApp('public'),
|
|
30
|
+
appIndexHtmlTemplate: resolveApp('public/index.html.template'),
|
|
31
|
+
appIndexHtml: resolveApp('public/index.html'),
|
|
32
32
|
appWebpackConfig: resolveModule(resolveApp, `webpack.config.${process.env.NODE_ENV === 'production' ? 'prod' : 'dev'}`),
|
|
33
33
|
yarnLockFile: resolveApp('yarn.lock'),
|
|
34
34
|
appRoot: resolveApp('.'),
|
|
35
|
-
distPath: resolveApp('dist'),
|
|
36
35
|
entryPoint: resolveModule(resolveApp, 'src/index'),
|
|
37
36
|
sourceFolders: [resolveApp('src')]
|
|
38
37
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/mc-scripts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0-rc.1",
|
|
4
4
|
"description": "Configuration and scripts for developing a MC application",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -26,57 +26,57 @@
|
|
|
26
26
|
"build:bundles:watch": "yarn build -w"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "7.16.
|
|
30
|
-
"@babel/runtime-corejs3": "7.16.
|
|
31
|
-
"@commercetools-frontend/application-config": "
|
|
32
|
-
"@commercetools-frontend/assets": "
|
|
33
|
-
"@commercetools-frontend/babel-preset-mc-app": "
|
|
34
|
-
"@commercetools-frontend/mc-dev-authentication": "
|
|
35
|
-
"@commercetools-frontend/mc-html-template": "
|
|
36
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.
|
|
37
|
-
"@svgr/webpack": "
|
|
38
|
-
"autoprefixer": "10.4.
|
|
29
|
+
"@babel/runtime": "^7.16.7",
|
|
30
|
+
"@babel/runtime-corejs3": "^7.16.8",
|
|
31
|
+
"@commercetools-frontend/application-config": "21.0.0-rc.1",
|
|
32
|
+
"@commercetools-frontend/assets": "21.0.0-rc.1",
|
|
33
|
+
"@commercetools-frontend/babel-preset-mc-app": "21.0.0-rc.1",
|
|
34
|
+
"@commercetools-frontend/mc-dev-authentication": "21.0.0-rc.1",
|
|
35
|
+
"@commercetools-frontend/mc-html-template": "21.0.0-rc.1",
|
|
36
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
|
|
37
|
+
"@svgr/webpack": "6.2.0",
|
|
38
|
+
"autoprefixer": "10.4.2",
|
|
39
39
|
"babel-loader": "8.2.3",
|
|
40
|
-
"browserslist": "4.
|
|
41
|
-
"core-js": "3.
|
|
40
|
+
"browserslist": "4.19.1",
|
|
41
|
+
"core-js": "^3.20.3",
|
|
42
42
|
"css-loader": "5.2.7",
|
|
43
|
-
"css-minimizer-webpack-plugin": "3.
|
|
43
|
+
"css-minimizer-webpack-plugin": "3.4.1",
|
|
44
44
|
"dotenv": "10.0.0",
|
|
45
45
|
"dotenv-expand": "5.1.0",
|
|
46
46
|
"fs-extra": "10.0.0",
|
|
47
|
-
"graphql-tag": "^2.
|
|
47
|
+
"graphql-tag": "^2.12.6",
|
|
48
48
|
"html-webpack-plugin": "5.5.0",
|
|
49
49
|
"json-loader": "0.5.7",
|
|
50
50
|
"mini-css-extract-plugin": "1.6.2",
|
|
51
51
|
"moment-locales-webpack-plugin": "1.2.0",
|
|
52
52
|
"mri": "1.2.0",
|
|
53
|
-
"postcss": "8.4.
|
|
53
|
+
"postcss": "8.4.5",
|
|
54
54
|
"postcss-color-mod-function": "3.0.3",
|
|
55
55
|
"postcss-custom-media": "8.0.0",
|
|
56
56
|
"postcss-custom-properties": "11.0.0",
|
|
57
57
|
"postcss-import": "14.0.2",
|
|
58
58
|
"postcss-loader": "6.2.1",
|
|
59
|
-
"postcss-reporter": "7.0.
|
|
59
|
+
"postcss-reporter": "7.0.5",
|
|
60
60
|
"react-dev-utils": "11.0.4",
|
|
61
61
|
"react-refresh": "0.11.0",
|
|
62
62
|
"serve-handler": "6.1.3",
|
|
63
|
-
"shelljs": "0.8.
|
|
63
|
+
"shelljs": "0.8.5",
|
|
64
64
|
"style-loader": "3.3.1",
|
|
65
65
|
"svg-url-loader": "7.1.1",
|
|
66
|
-
"terser-webpack-plugin": "5.
|
|
66
|
+
"terser-webpack-plugin": "5.3.0",
|
|
67
67
|
"thread-loader": "3.0.4",
|
|
68
|
-
"webpack": "5.
|
|
68
|
+
"webpack": "5.66.0",
|
|
69
69
|
"webpack-bundle-analyzer": "4.5.0",
|
|
70
|
-
"webpack-dev-server": "4.
|
|
70
|
+
"webpack-dev-server": "4.7.3",
|
|
71
71
|
"webpackbar": "5.0.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@babel/plugin-transform-runtime": "7.16.
|
|
75
|
-
"@babel/preset-env": "7.16.
|
|
74
|
+
"@babel/plugin-transform-runtime": "^7.16.10",
|
|
75
|
+
"@babel/preset-env": "^7.16.11",
|
|
76
76
|
"rimraf": "3.0.2"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
|
-
"node": ">=
|
|
79
|
+
"node": ">=14"
|
|
80
80
|
},
|
|
81
81
|
"babel": {
|
|
82
82
|
"presets": [
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@babel/preset-env",
|
|
85
85
|
{
|
|
86
86
|
"targets": {
|
|
87
|
-
"node": "
|
|
87
|
+
"node": "14"
|
|
88
88
|
},
|
|
89
89
|
"modules": "commonjs",
|
|
90
90
|
"useBuiltIns": "usage",
|