@commercetools-frontend/mc-scripts 20.9.3 → 20.10.4
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.
|
@@ -146,6 +146,7 @@ module.exports = function createWebpackConfigForDevelopment(options = {}) {
|
|
|
146
146
|
}), // Makes some environment variables available to the JS code, for example:
|
|
147
147
|
// if (process.env.NODE_ENV === 'development') { ... }.
|
|
148
148
|
new webpack.DefinePlugin({
|
|
149
|
+
__DEV__: 'true',
|
|
149
150
|
'process.env': {
|
|
150
151
|
NODE_ENV: JSON.stringify('development')
|
|
151
152
|
}
|
|
@@ -173,6 +173,7 @@ module.exports = function createWebpackConfigForProduction(options = {}) {
|
|
|
173
173
|
}), // Makes some environment variables available to the JS code, for example:
|
|
174
174
|
// if (process.env.NODE_ENV === 'production') { ... }.
|
|
175
175
|
new webpack.DefinePlugin({
|
|
176
|
+
__DEV__: 'false',
|
|
176
177
|
'process.env': {
|
|
177
178
|
NODE_ENV: JSON.stringify('production')
|
|
178
179
|
}
|
|
@@ -10,10 +10,8 @@ const {
|
|
|
10
10
|
processHeaders
|
|
11
11
|
} = require('@commercetools-frontend/mc-html-template');
|
|
12
12
|
|
|
13
|
-
const devAuthentication = require('@commercetools-frontend/mc-dev-authentication');
|
|
13
|
+
const devAuthentication = require('@commercetools-frontend/mc-dev-authentication');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
const isOidcForDevelopmentEnabled = process.env.ENABLE_OIDC_FOR_DEVELOPMENT === 'true' || process.env.ENABLE_OIDC_FOR_DEVELOPMENT === true;
|
|
17
15
|
const applicationConfig = processConfig();
|
|
18
16
|
const compiledHeaders = processHeaders(applicationConfig);
|
|
19
17
|
const host = process.env.HOST || '0.0.0.0'; // We support configuring the sockjs pathname during development.
|
|
@@ -66,6 +64,8 @@ module.exports = ({
|
|
|
66
64
|
onBeforeSetupMiddleware({
|
|
67
65
|
app
|
|
68
66
|
}) {
|
|
67
|
+
var _applicationConfig$en, _applicationConfig$en2;
|
|
68
|
+
|
|
69
69
|
app.set('views', devAuthentication.views);
|
|
70
70
|
app.set('view engine', devAuthentication.config.viewEngine); // This lets us open files from the runtime error overlay.
|
|
71
71
|
|
|
@@ -81,7 +81,14 @@ module.exports = ({
|
|
|
81
81
|
}));
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
if (
|
|
84
|
+
if ((_applicationConfig$en = applicationConfig.env.__DEVELOPMENT__) !== null && _applicationConfig$en !== void 0 && (_applicationConfig$en2 = _applicationConfig$en.oidc) !== null && _applicationConfig$en2 !== void 0 && _applicationConfig$en2.authorizeUrl) {
|
|
85
|
+
var _applicationConfig$en3, _applicationConfig$en4;
|
|
86
|
+
|
|
87
|
+
// Handle login page for OIDC workflow when developing against a local MC API.
|
|
88
|
+
if ((_applicationConfig$en3 = applicationConfig.env.__DEVELOPMENT__) !== null && _applicationConfig$en3 !== void 0 && (_applicationConfig$en4 = _applicationConfig$en3.oidc) !== null && _applicationConfig$en4 !== void 0 && _applicationConfig$en4.authorizeUrl.startsWith('http://localhost')) {
|
|
89
|
+
app.use('/login/authorize', devAuthentication.middlewares.createLoginMiddleware(applicationConfig.env));
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
85
92
|
app.use('/login', devAuthentication.middlewares.createLoginMiddleware(applicationConfig.env)); // Intercept the /logout page and "remove" the auth cookie value
|
|
86
93
|
|
|
87
94
|
app.use('/logout', devAuthentication.middlewares.createLogoutMiddleware(applicationConfig.env));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/mc-scripts",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.10.4",
|
|
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": {
|
|
@@ -30,53 +30,53 @@
|
|
|
30
30
|
"build:bundles:watch": "yarn build -w"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@babel/runtime": "7.
|
|
34
|
-
"@babel/runtime-corejs3": "7.
|
|
35
|
-
"@commercetools-frontend/application-config": "20.
|
|
36
|
-
"@commercetools-frontend/assets": "20.
|
|
37
|
-
"@commercetools-frontend/babel-preset-mc-app": "20.
|
|
38
|
-
"@commercetools-frontend/mc-dev-authentication": "
|
|
39
|
-
"@commercetools-frontend/mc-html-template": "20.
|
|
40
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.
|
|
33
|
+
"@babel/runtime": "7.15.4",
|
|
34
|
+
"@babel/runtime-corejs3": "7.15.4",
|
|
35
|
+
"@commercetools-frontend/application-config": "20.10.4",
|
|
36
|
+
"@commercetools-frontend/assets": "20.10.1",
|
|
37
|
+
"@commercetools-frontend/babel-preset-mc-app": "20.10.4",
|
|
38
|
+
"@commercetools-frontend/mc-dev-authentication": "20.10.3",
|
|
39
|
+
"@commercetools-frontend/mc-html-template": "20.10.4",
|
|
40
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.1",
|
|
41
41
|
"@svgr/webpack": "5.5.0",
|
|
42
|
-
"autoprefixer": "10.3.
|
|
43
|
-
"babel-loader": "8.2.
|
|
44
|
-
"browserslist": "4.
|
|
45
|
-
"core-js": "3.
|
|
42
|
+
"autoprefixer": "10.3.7",
|
|
43
|
+
"babel-loader": "8.2.3",
|
|
44
|
+
"browserslist": "4.17.5",
|
|
45
|
+
"core-js": "3.19.0",
|
|
46
46
|
"css-loader": "5.2.7",
|
|
47
|
-
"css-minimizer-webpack-plugin": "3.
|
|
47
|
+
"css-minimizer-webpack-plugin": "3.1.1",
|
|
48
48
|
"dotenv": "10.0.0",
|
|
49
49
|
"dotenv-expand": "5.1.0",
|
|
50
50
|
"fs-extra": "10.0.0",
|
|
51
51
|
"graphql-tag": "^2.11.0",
|
|
52
|
-
"html-webpack-plugin": "5.
|
|
52
|
+
"html-webpack-plugin": "5.5.0",
|
|
53
53
|
"json-loader": "0.5.7",
|
|
54
54
|
"mini-css-extract-plugin": "1.6.2",
|
|
55
55
|
"moment-locales-webpack-plugin": "1.2.0",
|
|
56
|
-
"mri": "1.
|
|
57
|
-
"postcss": "8.3.
|
|
56
|
+
"mri": "1.2.0",
|
|
57
|
+
"postcss": "8.3.11",
|
|
58
58
|
"postcss-color-mod-function": "3.0.3",
|
|
59
59
|
"postcss-custom-media": "8.0.0",
|
|
60
60
|
"postcss-custom-properties": "11.0.0",
|
|
61
61
|
"postcss-import": "14.0.2",
|
|
62
|
-
"postcss-loader": "6.
|
|
63
|
-
"postcss-reporter": "7.0.
|
|
62
|
+
"postcss-loader": "6.2.0",
|
|
63
|
+
"postcss-reporter": "7.0.4",
|
|
64
64
|
"react-dev-utils": "11.0.4",
|
|
65
65
|
"react-refresh": "0.10.0",
|
|
66
66
|
"serve-handler": "6.1.3",
|
|
67
67
|
"shelljs": "0.8.4",
|
|
68
|
-
"style-loader": "3.
|
|
68
|
+
"style-loader": "3.3.1",
|
|
69
69
|
"svg-url-loader": "7.1.1",
|
|
70
|
-
"terser-webpack-plugin": "5.
|
|
70
|
+
"terser-webpack-plugin": "5.2.4",
|
|
71
71
|
"thread-loader": "3.0.4",
|
|
72
|
-
"webpack": "5.
|
|
73
|
-
"webpack-bundle-analyzer": "4.
|
|
74
|
-
"webpack-dev-server": "4.
|
|
72
|
+
"webpack": "5.60.0",
|
|
73
|
+
"webpack-bundle-analyzer": "4.5.0",
|
|
74
|
+
"webpack-dev-server": "4.3.1",
|
|
75
75
|
"webpackbar": "5.0.0-3"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@babel/plugin-transform-runtime": "7.
|
|
79
|
-
"@babel/preset-env": "7.
|
|
78
|
+
"@babel/plugin-transform-runtime": "7.15.8",
|
|
79
|
+
"@babel/preset-env": "7.15.8"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": ">=12 || >=14"
|