@commercetools-frontend/mc-scripts 20.9.4 → 20.10.6
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.
|
File without changes
|
|
@@ -67,14 +67,16 @@ const generateStatic = async () => {
|
|
|
67
67
|
|
|
68
68
|
if (flags.transformer) {
|
|
69
69
|
try {
|
|
70
|
-
require.resolve(flags.transformer
|
|
70
|
+
const transformerPath = require.resolve(flags.transformer, {
|
|
71
|
+
paths: [appDirectory]
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const transformerFn = require(transformerPath);
|
|
75
|
+
|
|
76
|
+
transformerFn(compiled);
|
|
71
77
|
} catch (error) {
|
|
72
78
|
throw new Error(`Could not load transformer module "${flags.transformer}"\n${error.stack}`);
|
|
73
79
|
}
|
|
74
|
-
|
|
75
|
-
const transformerFn = require(flags.transformer);
|
|
76
|
-
|
|
77
|
-
transformerFn(compiled);
|
|
78
80
|
} else {
|
|
79
81
|
console.log(JSON.stringify(compiled.headers));
|
|
80
82
|
}
|
|
@@ -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.6",
|
|
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": {
|
|
@@ -11,72 +11,69 @@
|
|
|
11
11
|
"homepage": "https://docs.commercetools.com/custom-applications",
|
|
12
12
|
"keywords": ["javascript", "frontend", "react", "toolkit"],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"private": false,
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
17
16
|
},
|
|
18
17
|
"main": "./build/index.js",
|
|
19
18
|
"files": ["build", "config", "package.json", "LICENSE", "README.md"],
|
|
20
|
-
"bin":
|
|
21
|
-
"mc-scripts": "./bin/mc-scripts.js"
|
|
22
|
-
},
|
|
19
|
+
"bin": "./bin/cli.js",
|
|
23
20
|
"browserslist": {
|
|
24
21
|
"production": [">1%", "not op_mini all", "not dead"],
|
|
25
22
|
"development": ["last 2 firefox versions", "last 2 chrome versions"]
|
|
26
23
|
},
|
|
27
24
|
"scripts": {
|
|
28
|
-
"
|
|
29
|
-
"build": "babel src --out-dir build",
|
|
25
|
+
"build": "rimraf build && babel src --out-dir build",
|
|
30
26
|
"build:bundles:watch": "yarn build -w"
|
|
31
27
|
},
|
|
32
28
|
"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.
|
|
29
|
+
"@babel/runtime": "7.15.4",
|
|
30
|
+
"@babel/runtime-corejs3": "7.15.4",
|
|
31
|
+
"@commercetools-frontend/application-config": "20.10.6",
|
|
32
|
+
"@commercetools-frontend/assets": "20.10.6",
|
|
33
|
+
"@commercetools-frontend/babel-preset-mc-app": "20.10.6",
|
|
34
|
+
"@commercetools-frontend/mc-dev-authentication": "20.10.6",
|
|
35
|
+
"@commercetools-frontend/mc-html-template": "20.10.6",
|
|
36
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.1",
|
|
41
37
|
"@svgr/webpack": "5.5.0",
|
|
42
|
-
"autoprefixer": "10.3.
|
|
43
|
-
"babel-loader": "8.2.
|
|
44
|
-
"browserslist": "4.
|
|
45
|
-
"core-js": "3.
|
|
38
|
+
"autoprefixer": "10.3.7",
|
|
39
|
+
"babel-loader": "8.2.3",
|
|
40
|
+
"browserslist": "4.17.5",
|
|
41
|
+
"core-js": "3.19.0",
|
|
46
42
|
"css-loader": "5.2.7",
|
|
47
|
-
"css-minimizer-webpack-plugin": "3.
|
|
43
|
+
"css-minimizer-webpack-plugin": "3.1.1",
|
|
48
44
|
"dotenv": "10.0.0",
|
|
49
45
|
"dotenv-expand": "5.1.0",
|
|
50
46
|
"fs-extra": "10.0.0",
|
|
51
47
|
"graphql-tag": "^2.11.0",
|
|
52
|
-
"html-webpack-plugin": "5.
|
|
48
|
+
"html-webpack-plugin": "5.5.0",
|
|
53
49
|
"json-loader": "0.5.7",
|
|
54
50
|
"mini-css-extract-plugin": "1.6.2",
|
|
55
51
|
"moment-locales-webpack-plugin": "1.2.0",
|
|
56
|
-
"mri": "1.
|
|
57
|
-
"postcss": "8.3.
|
|
52
|
+
"mri": "1.2.0",
|
|
53
|
+
"postcss": "8.3.11",
|
|
58
54
|
"postcss-color-mod-function": "3.0.3",
|
|
59
55
|
"postcss-custom-media": "8.0.0",
|
|
60
56
|
"postcss-custom-properties": "11.0.0",
|
|
61
57
|
"postcss-import": "14.0.2",
|
|
62
|
-
"postcss-loader": "6.
|
|
63
|
-
"postcss-reporter": "7.0.
|
|
58
|
+
"postcss-loader": "6.2.0",
|
|
59
|
+
"postcss-reporter": "7.0.4",
|
|
64
60
|
"react-dev-utils": "11.0.4",
|
|
65
61
|
"react-refresh": "0.10.0",
|
|
66
62
|
"serve-handler": "6.1.3",
|
|
67
63
|
"shelljs": "0.8.4",
|
|
68
|
-
"style-loader": "3.
|
|
64
|
+
"style-loader": "3.3.1",
|
|
69
65
|
"svg-url-loader": "7.1.1",
|
|
70
|
-
"terser-webpack-plugin": "5.
|
|
66
|
+
"terser-webpack-plugin": "5.2.4",
|
|
71
67
|
"thread-loader": "3.0.4",
|
|
72
|
-
"webpack": "5.
|
|
73
|
-
"webpack-bundle-analyzer": "4.
|
|
74
|
-
"webpack-dev-server": "4.
|
|
68
|
+
"webpack": "5.60.0",
|
|
69
|
+
"webpack-bundle-analyzer": "4.5.0",
|
|
70
|
+
"webpack-dev-server": "4.3.1",
|
|
75
71
|
"webpackbar": "5.0.0-3"
|
|
76
72
|
},
|
|
77
73
|
"devDependencies": {
|
|
78
|
-
"@babel/plugin-transform-runtime": "7.15.
|
|
79
|
-
"@babel/preset-env": "7.15.
|
|
74
|
+
"@babel/plugin-transform-runtime": "7.15.8",
|
|
75
|
+
"@babel/preset-env": "7.15.8",
|
|
76
|
+
"rimraf": "3.0.2"
|
|
80
77
|
},
|
|
81
78
|
"engines": {
|
|
82
79
|
"node": ">=12 || >=14"
|