@commercetools-frontend/mc-scripts 21.7.0 → 21.8.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/LICENSE +1 -1
- package/README.md +1 -42
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.d.ts +1 -0
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +7 -0
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.js +7 -0
- package/{build/config/application-runtime.js → application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js} +2 -2
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +5 -0
- package/application-runtime/package.json +4 -0
- package/bin/cli.js +1 -1
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.d.ts +1 -0
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +354 -0
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.js +7 -0
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +354 -0
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +338 -0
- package/cli/package.json +4 -0
- package/config/create-webpack-config-for-development.js +7 -1
- package/config/create-webpack-config-for-production.js +7 -1
- package/config/vendors-to-transpile.js +5 -1
- package/dist/build-8582b673.esm.js +209 -0
- package/dist/build-9395925a.cjs.prod.js +224 -0
- package/dist/build-97278377.cjs.dev.js +224 -0
- package/dist/build-vite-6c987a60.cjs.dev.js +109 -0
- package/dist/build-vite-76d44332.cjs.prod.js +109 -0
- package/dist/build-vite-a9602b19.esm.js +97 -0
- package/dist/commercetools-frontend-mc-scripts.cjs.d.ts +1 -0
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +30 -0
- package/dist/commercetools-frontend-mc-scripts.cjs.js +7 -0
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +30 -0
- package/dist/commercetools-frontend-mc-scripts.esm.js +22 -0
- package/dist/compile-html-0c588a89.cjs.dev.js +93 -0
- package/dist/compile-html-4832f8c5.esm.js +83 -0
- package/dist/compile-html-7654b5e6.cjs.prod.js +93 -0
- package/dist/config-sync-20bc05e8.esm.js +868 -0
- package/dist/config-sync-62824317.cjs.prod.js +887 -0
- package/dist/config-sync-d52e73f6.cjs.dev.js +892 -0
- package/dist/create-postcss-config-4cbe10ab.cjs.dev.js +90 -0
- package/dist/create-postcss-config-8ea16440.cjs.prod.js +90 -0
- package/{build/config/create-postcss-config.js → dist/create-postcss-config-c1aa3525.esm.js} +27 -25
- package/{build/config/create-webpack-config-for-development.js → dist/create-webpack-config-for-development-8a8b84d6.esm.js} +92 -56
- package/dist/create-webpack-config-for-development-a5e73092.cjs.prod.js +418 -0
- package/dist/create-webpack-config-for-development-e2735e02.cjs.dev.js +418 -0
- package/dist/create-webpack-config-for-production-4e7b56c0.cjs.prod.js +468 -0
- package/{build/config/create-webpack-config-for-production.js → dist/create-webpack-config-for-production-7dc669e5.esm.js} +117 -52
- package/dist/create-webpack-config-for-production-d9bf281c.cjs.dev.js +468 -0
- package/dist/declarations/src/application-runtime.d.ts +1 -0
- package/dist/declarations/src/cli.d.ts +4 -0
- package/dist/declarations/src/commands/build-vite.d.ts +2 -0
- package/dist/declarations/src/commands/build.d.ts +2 -0
- package/dist/declarations/src/commands/compile-html.d.ts +3 -0
- package/dist/declarations/src/commands/config-sync.d.ts +3 -0
- package/dist/declarations/src/commands/login.d.ts +2 -0
- package/dist/declarations/src/commands/serve.d.ts +2 -0
- package/dist/declarations/src/commands/start-vite.d.ts +2 -0
- package/dist/declarations/src/commands/start.d.ts +2 -0
- package/dist/declarations/src/config/create-postcss-config.d.ts +4 -0
- package/dist/declarations/src/config/create-webpack-config-for-development.d.ts +10 -0
- package/dist/declarations/src/config/create-webpack-config-for-production.d.ts +10 -0
- package/dist/declarations/src/config/has-jsx-runtime.d.ts +2 -0
- package/dist/declarations/src/config/paths.d.ts +12 -0
- package/dist/declarations/src/config/vendors-to-transpile.d.ts +2 -0
- package/dist/declarations/src/config/webpack-dev-server.config.d.ts +6 -0
- package/dist/declarations/src/deprecated-entry-points.d.ts +7 -0
- package/dist/declarations/src/generated/core.d.ts +710 -0
- package/dist/declarations/src/generated/settings.d.ts +2383 -0
- package/dist/declarations/src/index.d.ts +3 -0
- package/dist/declarations/src/postcss.d.ts +1 -0
- package/dist/declarations/src/types.d.ts +82 -0
- package/dist/declarations/src/utils/auth.d.ts +6 -0
- package/dist/declarations/src/utils/credentials-storage.d.ts +11 -0
- package/dist/declarations/src/utils/get-config-diff.d.ts +3 -0
- package/dist/declarations/src/utils/graphql-requests.d.ts +80 -0
- package/dist/declarations/src/utils/user-agent.d.ts +2 -0
- package/dist/declarations/src/version.d.ts +2 -0
- package/dist/declarations/src/webpack-plugins/final-stats-writer-plugin.d.ts +12 -0
- package/dist/declarations/src/webpack-plugins/local-html-webpack-plugin.d.ts +5 -0
- package/dist/declarations/src/webpack.d.ts +2 -0
- package/dist/has-jsx-runtime-0b03b72e.cjs.prod.js +17 -0
- package/dist/has-jsx-runtime-3d4bb633.cjs.dev.js +17 -0
- package/{build/config/has-jsx-runtime.js → dist/has-jsx-runtime-8314226e.esm.js} +1 -3
- package/dist/login-706ccc9a.cjs.prod.js +165 -0
- package/dist/login-779552b7.cjs.dev.js +165 -0
- package/dist/login-7d94659e.esm.js +155 -0
- package/dist/package-a98de907.esm.js +133 -0
- package/dist/package-aaf61bf0.cjs.dev.js +135 -0
- package/dist/package-b5c040f3.cjs.prod.js +135 -0
- package/dist/paths-16823f56.cjs.dev.js +55 -0
- package/dist/paths-76b66e74.cjs.prod.js +55 -0
- package/dist/paths-ed23d5a1.esm.js +46 -0
- package/dist/serve-12de323b.cjs.dev.js +70 -0
- package/dist/serve-784f4fcd.cjs.prod.js +70 -0
- package/dist/serve-d6b437b1.esm.js +62 -0
- package/dist/start-2b953ab0.cjs.dev.js +209 -0
- package/dist/start-e3ccd672.cjs.prod.js +209 -0
- package/dist/start-e924bd5d.esm.js +194 -0
- package/dist/start-vite-737bacca.cjs.dev.js +149 -0
- package/dist/start-vite-b0f58ae4.cjs.prod.js +149 -0
- package/dist/start-vite-ec5d40b5.esm.js +136 -0
- package/dist/user-agent-5da1830b.cjs.dev.js +106 -0
- package/dist/user-agent-8044acd6.esm.js +94 -0
- package/dist/user-agent-d18809af.cjs.prod.js +106 -0
- package/dist/vendors-to-transpile-367e0ba8.cjs.prod.js +5 -0
- package/dist/vendors-to-transpile-68e03526.esm.js +3 -0
- package/dist/vendors-to-transpile-b51af5d3.cjs.dev.js +5 -0
- package/package.json +41 -39
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.d.ts +1 -0
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +14 -0
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.js +7 -0
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +14 -0
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +6 -0
- package/postcss/package.json +4 -0
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.d.ts +1 -0
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +51 -0
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.js +7 -0
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +51 -0
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +42 -0
- package/webpack/package.json +4 -0
- package/build/bin/cli.js +0 -264
- package/build/commands/build-vite.js +0 -91
- package/build/commands/build.js +0 -140
- package/build/commands/compile-html.js +0 -53
- package/build/commands/config-sync.js +0 -176
- package/build/commands/login.js +0 -60
- package/build/commands/serve.js +0 -37
- package/build/commands/start-vite.js +0 -138
- package/build/commands/start.js +0 -108
- package/build/config/paths.js +0 -38
- package/build/config/vendors-to-transpile.js +0 -3
- package/build/config/webpack-dev-server.config.js +0 -69
- package/build/index.js +0 -16
- package/build/utils/auth.js +0 -34
- package/build/utils/auth.spec.js +0 -61
- package/build/utils/create-custom-application.settings.graphql +0 -8
- package/build/utils/credentials-storage.js +0 -72
- package/build/utils/credentials-storage.spec.js +0 -69
- package/build/utils/fetch-custom-application.settings.graphql +0 -36
- package/build/utils/fetch-user-organizations.core.graphql +0 -9
- package/build/utils/get-config-diff.js +0 -308
- package/build/utils/get-config-diff.spec.js +0 -285
- package/build/utils/graphql-requests.js +0 -105
- package/build/utils/graphql-requests.spec.js +0 -159
- package/build/utils/require-graphql.js +0 -15
- package/build/utils/update-custom-application.settings.graphql +0 -13
- package/build/utils/user-agent.js +0 -15
- package/build/webpack-plugins/final-stats-writer-plugin.js +0 -50
- package/build/webpack-plugins/local-html-webpack-plugin.js +0 -38
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/esm/asyncToGenerator';
|
|
2
|
+
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
3
|
+
import prompts from 'prompts';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { processConfig } from '@commercetools-frontend/application-config';
|
|
6
|
+
import { u as userAgent, C as CredentialsStorage } from './user-agent-8044acd6.esm.js';
|
|
7
|
+
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
8
|
+
import fetch from 'node-fetch';
|
|
9
|
+
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
10
|
+
import '@babel/runtime-corejs3/helpers/createClass';
|
|
11
|
+
import '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
12
|
+
import 'fs';
|
|
13
|
+
import 'path';
|
|
14
|
+
import 'os';
|
|
15
|
+
import '@commercetools/http-user-agent';
|
|
16
|
+
import './package-a98de907.esm.js';
|
|
17
|
+
|
|
18
|
+
var getAuthToken = /*#__PURE__*/function () {
|
|
19
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mcApiUrl, payload) {
|
|
20
|
+
var response, text, parsed, errorMessage, authToken;
|
|
21
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22
|
+
while (1) {
|
|
23
|
+
switch (_context.prev = _context.next) {
|
|
24
|
+
case 0:
|
|
25
|
+
_context.next = 2;
|
|
26
|
+
return fetch("".concat(mcApiUrl, "/tokens/cli"), {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
headers: {
|
|
29
|
+
Accept: 'application/json',
|
|
30
|
+
'Content-Type': 'application/json',
|
|
31
|
+
'x-user-agent': userAgent
|
|
32
|
+
},
|
|
33
|
+
body: _JSON$stringify(payload)
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
case 2:
|
|
37
|
+
response = _context.sent;
|
|
38
|
+
|
|
39
|
+
if (response.ok) {
|
|
40
|
+
_context.next = 10;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_context.next = 6;
|
|
45
|
+
return response.text();
|
|
46
|
+
|
|
47
|
+
case 6:
|
|
48
|
+
text = _context.sent;
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
parsed = JSON.parse(text);
|
|
52
|
+
} catch (error) {}
|
|
53
|
+
|
|
54
|
+
errorMessage = parsed ? parsed.message : text;
|
|
55
|
+
throw new Error(errorMessage);
|
|
56
|
+
|
|
57
|
+
case 10:
|
|
58
|
+
_context.next = 12;
|
|
59
|
+
return response.json();
|
|
60
|
+
|
|
61
|
+
case 12:
|
|
62
|
+
authToken = _context.sent;
|
|
63
|
+
return _context.abrupt("return", authToken);
|
|
64
|
+
|
|
65
|
+
case 14:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, _callee);
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
return function getAuthToken(_x, _x2) {
|
|
74
|
+
return _ref.apply(this, arguments);
|
|
75
|
+
};
|
|
76
|
+
}();
|
|
77
|
+
|
|
78
|
+
var credentialsStorage = new CredentialsStorage();
|
|
79
|
+
|
|
80
|
+
function run() {
|
|
81
|
+
return _run.apply(this, arguments);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function _run() {
|
|
85
|
+
_run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
86
|
+
var applicationConfig, mcApiUrl, _yield$prompts, email, _yield$prompts2, password, credentials;
|
|
87
|
+
|
|
88
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
89
|
+
while (1) {
|
|
90
|
+
switch (_context.prev = _context.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
applicationConfig = processConfig();
|
|
93
|
+
mcApiUrl = applicationConfig.env.mcApiUrl;
|
|
94
|
+
|
|
95
|
+
if (!credentialsStorage.isSessionValid(mcApiUrl)) {
|
|
96
|
+
_context.next = 5;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log("You already have a valid session for the ".concat(mcApiUrl, " environment.\n"));
|
|
101
|
+
return _context.abrupt("return");
|
|
102
|
+
|
|
103
|
+
case 5:
|
|
104
|
+
console.log(chalk.gray("Enter the login credentials for the ".concat(mcApiUrl, " environment.\n")));
|
|
105
|
+
_context.next = 8;
|
|
106
|
+
return prompts({
|
|
107
|
+
type: 'text',
|
|
108
|
+
name: 'email',
|
|
109
|
+
message: 'Email'
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
case 8:
|
|
113
|
+
_yield$prompts = _context.sent;
|
|
114
|
+
email = _yield$prompts.email;
|
|
115
|
+
_context.next = 12;
|
|
116
|
+
return prompts({
|
|
117
|
+
type: 'invisible',
|
|
118
|
+
name: 'password',
|
|
119
|
+
message: 'Password (hidden)'
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
case 12:
|
|
123
|
+
_yield$prompts2 = _context.sent;
|
|
124
|
+
password = _yield$prompts2.password;
|
|
125
|
+
|
|
126
|
+
if (!(!email || !password)) {
|
|
127
|
+
_context.next = 16;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
throw new Error("Missing email or password values. Aborting.");
|
|
132
|
+
|
|
133
|
+
case 16:
|
|
134
|
+
_context.next = 18;
|
|
135
|
+
return getAuthToken(mcApiUrl, {
|
|
136
|
+
email: email,
|
|
137
|
+
password: password
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
case 18:
|
|
141
|
+
credentials = _context.sent;
|
|
142
|
+
credentialsStorage.setToken(mcApiUrl, credentials);
|
|
143
|
+
console.log(chalk.green("Login successful.\n"));
|
|
144
|
+
|
|
145
|
+
case 21:
|
|
146
|
+
case "end":
|
|
147
|
+
return _context.stop();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, _callee);
|
|
151
|
+
}));
|
|
152
|
+
return _run.apply(this, arguments);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export { run as default };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var pkgJson = {
|
|
2
|
+
name: "@commercetools-frontend/mc-scripts",
|
|
3
|
+
version: "21.8.0",
|
|
4
|
+
description: "Configuration and scripts for developing a MC application",
|
|
5
|
+
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
|
+
repository: {
|
|
7
|
+
type: "git",
|
|
8
|
+
url: "https://github.com/commercetools/merchant-center-application-kit.git",
|
|
9
|
+
directory: "packages/mc-scripts"
|
|
10
|
+
},
|
|
11
|
+
homepage: "https://docs.commercetools.com/custom-applications",
|
|
12
|
+
keywords: [
|
|
13
|
+
"javascript",
|
|
14
|
+
"frontend",
|
|
15
|
+
"react",
|
|
16
|
+
"toolkit"
|
|
17
|
+
],
|
|
18
|
+
license: "MIT",
|
|
19
|
+
publishConfig: {
|
|
20
|
+
access: "public"
|
|
21
|
+
},
|
|
22
|
+
main: "dist/commercetools-frontend-mc-scripts.cjs.js",
|
|
23
|
+
module: "dist/commercetools-frontend-mc-scripts.esm.js",
|
|
24
|
+
preconstruct: {
|
|
25
|
+
entrypoints: [
|
|
26
|
+
"./index.ts",
|
|
27
|
+
"./application-runtime.ts",
|
|
28
|
+
"./cli.ts",
|
|
29
|
+
"./postcss.ts",
|
|
30
|
+
"./webpack.ts"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
files: [
|
|
34
|
+
"bin",
|
|
35
|
+
"cli",
|
|
36
|
+
"dist",
|
|
37
|
+
"config",
|
|
38
|
+
"application-runtime",
|
|
39
|
+
"postcss",
|
|
40
|
+
"webpack",
|
|
41
|
+
"package.json",
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"README.md"
|
|
44
|
+
],
|
|
45
|
+
bin: "./bin/cli.js",
|
|
46
|
+
browserslist: {
|
|
47
|
+
production: [
|
|
48
|
+
">1%",
|
|
49
|
+
"not op_mini all",
|
|
50
|
+
"not dead"
|
|
51
|
+
],
|
|
52
|
+
development: [
|
|
53
|
+
"last 2 firefox versions",
|
|
54
|
+
"last 2 chrome versions"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
dependencies: {
|
|
58
|
+
"@babel/core": "^7.17.9",
|
|
59
|
+
"@babel/runtime": "^7.17.9",
|
|
60
|
+
"@babel/runtime-corejs3": "^7.17.9",
|
|
61
|
+
"@commercetools-frontend/application-config": "21.8.0",
|
|
62
|
+
"@commercetools-frontend/assets": "21.8.0",
|
|
63
|
+
"@commercetools-frontend/babel-preset-mc-app": "21.8.0",
|
|
64
|
+
"@commercetools-frontend/constants": "21.8.0",
|
|
65
|
+
"@commercetools-frontend/mc-dev-authentication": "21.8.0",
|
|
66
|
+
"@commercetools-frontend/mc-html-template": "21.8.0",
|
|
67
|
+
"@commercetools/http-user-agent": "2.1.2",
|
|
68
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
|
|
69
|
+
"@rollup/plugin-graphql": "1.1.0",
|
|
70
|
+
"@svgr/webpack": "6.2.1",
|
|
71
|
+
"@types/prompts": "^2.0.14",
|
|
72
|
+
"@vitejs/plugin-react": "1.3.2",
|
|
73
|
+
autoprefixer: "^10.4.4",
|
|
74
|
+
"babel-loader": "8.2.5",
|
|
75
|
+
browserslist: "^4.20.2",
|
|
76
|
+
cac: "6.7.12",
|
|
77
|
+
chalk: "4.1.2",
|
|
78
|
+
"core-js": "^3.21.1",
|
|
79
|
+
"css-loader": "6.7.1",
|
|
80
|
+
"css-minimizer-webpack-plugin": "3.4.1",
|
|
81
|
+
dotenv: "16.0.0",
|
|
82
|
+
"dotenv-expand": "8.0.3",
|
|
83
|
+
"fs-extra": "10.1.0",
|
|
84
|
+
"graphql-request": "^4.2.0",
|
|
85
|
+
"graphql-tag": "^2.12.6",
|
|
86
|
+
"html-webpack-plugin": "5.5.0",
|
|
87
|
+
"json-loader": "0.5.7",
|
|
88
|
+
lodash: "4.17.21",
|
|
89
|
+
"mini-css-extract-plugin": "2.6.0",
|
|
90
|
+
"moment-locales-webpack-plugin": "1.2.0",
|
|
91
|
+
"node-fetch": "2.6.7",
|
|
92
|
+
postcss: "8.4.13",
|
|
93
|
+
"postcss-custom-media": "8.0.0",
|
|
94
|
+
"postcss-custom-properties": "12.1.4",
|
|
95
|
+
"postcss-import": "14.1.0",
|
|
96
|
+
"postcss-loader": "6.2.1",
|
|
97
|
+
"postcss-reporter": "7.0.5",
|
|
98
|
+
prettier: "2.6.2",
|
|
99
|
+
prompts: "^2.4.2",
|
|
100
|
+
"querystring-es3": "^0.2.1",
|
|
101
|
+
rcfile: "1.0.3",
|
|
102
|
+
"react-dev-utils": "12.0.1",
|
|
103
|
+
"react-refresh": "0.13.0",
|
|
104
|
+
"serve-handler": "6.1.3",
|
|
105
|
+
shelljs: "0.8.5",
|
|
106
|
+
"style-loader": "3.3.1",
|
|
107
|
+
"svg-url-loader": "7.1.1",
|
|
108
|
+
"terser-webpack-plugin": "5.3.1",
|
|
109
|
+
"thread-loader": "3.0.4",
|
|
110
|
+
url: "^0.11.0",
|
|
111
|
+
vite: "2.9.8",
|
|
112
|
+
webpack: "5.72.0",
|
|
113
|
+
"webpack-bundle-analyzer": "4.5.0",
|
|
114
|
+
"webpack-dev-server": "4.9.0",
|
|
115
|
+
webpackbar: "5.0.2"
|
|
116
|
+
},
|
|
117
|
+
devDependencies: {
|
|
118
|
+
"@tsconfig/node16": "^1.0.2",
|
|
119
|
+
"@types/lodash": "^4.14.181",
|
|
120
|
+
"@types/mock-fs": "^4.13.1",
|
|
121
|
+
"@types/moment-locales-webpack-plugin": "^1.2.3",
|
|
122
|
+
"@types/node-fetch": "2.6.1",
|
|
123
|
+
"@types/serve-handler": "^6.1.1",
|
|
124
|
+
"mock-fs": "^5.1.2",
|
|
125
|
+
msw: "0.39.2",
|
|
126
|
+
rimraf: "3.0.2"
|
|
127
|
+
},
|
|
128
|
+
engines: {
|
|
129
|
+
node: ">=14"
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { pkgJson as p };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pkgJson = {
|
|
4
|
+
name: "@commercetools-frontend/mc-scripts",
|
|
5
|
+
version: "21.8.0",
|
|
6
|
+
description: "Configuration and scripts for developing a MC application",
|
|
7
|
+
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
8
|
+
repository: {
|
|
9
|
+
type: "git",
|
|
10
|
+
url: "https://github.com/commercetools/merchant-center-application-kit.git",
|
|
11
|
+
directory: "packages/mc-scripts"
|
|
12
|
+
},
|
|
13
|
+
homepage: "https://docs.commercetools.com/custom-applications",
|
|
14
|
+
keywords: [
|
|
15
|
+
"javascript",
|
|
16
|
+
"frontend",
|
|
17
|
+
"react",
|
|
18
|
+
"toolkit"
|
|
19
|
+
],
|
|
20
|
+
license: "MIT",
|
|
21
|
+
publishConfig: {
|
|
22
|
+
access: "public"
|
|
23
|
+
},
|
|
24
|
+
main: "dist/commercetools-frontend-mc-scripts.cjs.js",
|
|
25
|
+
module: "dist/commercetools-frontend-mc-scripts.esm.js",
|
|
26
|
+
preconstruct: {
|
|
27
|
+
entrypoints: [
|
|
28
|
+
"./index.ts",
|
|
29
|
+
"./application-runtime.ts",
|
|
30
|
+
"./cli.ts",
|
|
31
|
+
"./postcss.ts",
|
|
32
|
+
"./webpack.ts"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
files: [
|
|
36
|
+
"bin",
|
|
37
|
+
"cli",
|
|
38
|
+
"dist",
|
|
39
|
+
"config",
|
|
40
|
+
"application-runtime",
|
|
41
|
+
"postcss",
|
|
42
|
+
"webpack",
|
|
43
|
+
"package.json",
|
|
44
|
+
"LICENSE",
|
|
45
|
+
"README.md"
|
|
46
|
+
],
|
|
47
|
+
bin: "./bin/cli.js",
|
|
48
|
+
browserslist: {
|
|
49
|
+
production: [
|
|
50
|
+
">1%",
|
|
51
|
+
"not op_mini all",
|
|
52
|
+
"not dead"
|
|
53
|
+
],
|
|
54
|
+
development: [
|
|
55
|
+
"last 2 firefox versions",
|
|
56
|
+
"last 2 chrome versions"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
dependencies: {
|
|
60
|
+
"@babel/core": "^7.17.9",
|
|
61
|
+
"@babel/runtime": "^7.17.9",
|
|
62
|
+
"@babel/runtime-corejs3": "^7.17.9",
|
|
63
|
+
"@commercetools-frontend/application-config": "21.8.0",
|
|
64
|
+
"@commercetools-frontend/assets": "21.8.0",
|
|
65
|
+
"@commercetools-frontend/babel-preset-mc-app": "21.8.0",
|
|
66
|
+
"@commercetools-frontend/constants": "21.8.0",
|
|
67
|
+
"@commercetools-frontend/mc-dev-authentication": "21.8.0",
|
|
68
|
+
"@commercetools-frontend/mc-html-template": "21.8.0",
|
|
69
|
+
"@commercetools/http-user-agent": "2.1.2",
|
|
70
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
|
|
71
|
+
"@rollup/plugin-graphql": "1.1.0",
|
|
72
|
+
"@svgr/webpack": "6.2.1",
|
|
73
|
+
"@types/prompts": "^2.0.14",
|
|
74
|
+
"@vitejs/plugin-react": "1.3.2",
|
|
75
|
+
autoprefixer: "^10.4.4",
|
|
76
|
+
"babel-loader": "8.2.5",
|
|
77
|
+
browserslist: "^4.20.2",
|
|
78
|
+
cac: "6.7.12",
|
|
79
|
+
chalk: "4.1.2",
|
|
80
|
+
"core-js": "^3.21.1",
|
|
81
|
+
"css-loader": "6.7.1",
|
|
82
|
+
"css-minimizer-webpack-plugin": "3.4.1",
|
|
83
|
+
dotenv: "16.0.0",
|
|
84
|
+
"dotenv-expand": "8.0.3",
|
|
85
|
+
"fs-extra": "10.1.0",
|
|
86
|
+
"graphql-request": "^4.2.0",
|
|
87
|
+
"graphql-tag": "^2.12.6",
|
|
88
|
+
"html-webpack-plugin": "5.5.0",
|
|
89
|
+
"json-loader": "0.5.7",
|
|
90
|
+
lodash: "4.17.21",
|
|
91
|
+
"mini-css-extract-plugin": "2.6.0",
|
|
92
|
+
"moment-locales-webpack-plugin": "1.2.0",
|
|
93
|
+
"node-fetch": "2.6.7",
|
|
94
|
+
postcss: "8.4.13",
|
|
95
|
+
"postcss-custom-media": "8.0.0",
|
|
96
|
+
"postcss-custom-properties": "12.1.4",
|
|
97
|
+
"postcss-import": "14.1.0",
|
|
98
|
+
"postcss-loader": "6.2.1",
|
|
99
|
+
"postcss-reporter": "7.0.5",
|
|
100
|
+
prettier: "2.6.2",
|
|
101
|
+
prompts: "^2.4.2",
|
|
102
|
+
"querystring-es3": "^0.2.1",
|
|
103
|
+
rcfile: "1.0.3",
|
|
104
|
+
"react-dev-utils": "12.0.1",
|
|
105
|
+
"react-refresh": "0.13.0",
|
|
106
|
+
"serve-handler": "6.1.3",
|
|
107
|
+
shelljs: "0.8.5",
|
|
108
|
+
"style-loader": "3.3.1",
|
|
109
|
+
"svg-url-loader": "7.1.1",
|
|
110
|
+
"terser-webpack-plugin": "5.3.1",
|
|
111
|
+
"thread-loader": "3.0.4",
|
|
112
|
+
url: "^0.11.0",
|
|
113
|
+
vite: "2.9.8",
|
|
114
|
+
webpack: "5.72.0",
|
|
115
|
+
"webpack-bundle-analyzer": "4.5.0",
|
|
116
|
+
"webpack-dev-server": "4.9.0",
|
|
117
|
+
webpackbar: "5.0.2"
|
|
118
|
+
},
|
|
119
|
+
devDependencies: {
|
|
120
|
+
"@tsconfig/node16": "^1.0.2",
|
|
121
|
+
"@types/lodash": "^4.14.181",
|
|
122
|
+
"@types/mock-fs": "^4.13.1",
|
|
123
|
+
"@types/moment-locales-webpack-plugin": "^1.2.3",
|
|
124
|
+
"@types/node-fetch": "2.6.1",
|
|
125
|
+
"@types/serve-handler": "^6.1.1",
|
|
126
|
+
"mock-fs": "^5.1.2",
|
|
127
|
+
msw: "0.39.2",
|
|
128
|
+
rimraf: "3.0.2"
|
|
129
|
+
},
|
|
130
|
+
engines: {
|
|
131
|
+
node: ">=14"
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
exports.pkgJson = pkgJson;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pkgJson = {
|
|
4
|
+
name: "@commercetools-frontend/mc-scripts",
|
|
5
|
+
version: "21.8.0",
|
|
6
|
+
description: "Configuration and scripts for developing a MC application",
|
|
7
|
+
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
8
|
+
repository: {
|
|
9
|
+
type: "git",
|
|
10
|
+
url: "https://github.com/commercetools/merchant-center-application-kit.git",
|
|
11
|
+
directory: "packages/mc-scripts"
|
|
12
|
+
},
|
|
13
|
+
homepage: "https://docs.commercetools.com/custom-applications",
|
|
14
|
+
keywords: [
|
|
15
|
+
"javascript",
|
|
16
|
+
"frontend",
|
|
17
|
+
"react",
|
|
18
|
+
"toolkit"
|
|
19
|
+
],
|
|
20
|
+
license: "MIT",
|
|
21
|
+
publishConfig: {
|
|
22
|
+
access: "public"
|
|
23
|
+
},
|
|
24
|
+
main: "dist/commercetools-frontend-mc-scripts.cjs.js",
|
|
25
|
+
module: "dist/commercetools-frontend-mc-scripts.esm.js",
|
|
26
|
+
preconstruct: {
|
|
27
|
+
entrypoints: [
|
|
28
|
+
"./index.ts",
|
|
29
|
+
"./application-runtime.ts",
|
|
30
|
+
"./cli.ts",
|
|
31
|
+
"./postcss.ts",
|
|
32
|
+
"./webpack.ts"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
files: [
|
|
36
|
+
"bin",
|
|
37
|
+
"cli",
|
|
38
|
+
"dist",
|
|
39
|
+
"config",
|
|
40
|
+
"application-runtime",
|
|
41
|
+
"postcss",
|
|
42
|
+
"webpack",
|
|
43
|
+
"package.json",
|
|
44
|
+
"LICENSE",
|
|
45
|
+
"README.md"
|
|
46
|
+
],
|
|
47
|
+
bin: "./bin/cli.js",
|
|
48
|
+
browserslist: {
|
|
49
|
+
production: [
|
|
50
|
+
">1%",
|
|
51
|
+
"not op_mini all",
|
|
52
|
+
"not dead"
|
|
53
|
+
],
|
|
54
|
+
development: [
|
|
55
|
+
"last 2 firefox versions",
|
|
56
|
+
"last 2 chrome versions"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
dependencies: {
|
|
60
|
+
"@babel/core": "^7.17.9",
|
|
61
|
+
"@babel/runtime": "^7.17.9",
|
|
62
|
+
"@babel/runtime-corejs3": "^7.17.9",
|
|
63
|
+
"@commercetools-frontend/application-config": "21.8.0",
|
|
64
|
+
"@commercetools-frontend/assets": "21.8.0",
|
|
65
|
+
"@commercetools-frontend/babel-preset-mc-app": "21.8.0",
|
|
66
|
+
"@commercetools-frontend/constants": "21.8.0",
|
|
67
|
+
"@commercetools-frontend/mc-dev-authentication": "21.8.0",
|
|
68
|
+
"@commercetools-frontend/mc-html-template": "21.8.0",
|
|
69
|
+
"@commercetools/http-user-agent": "2.1.2",
|
|
70
|
+
"@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
|
|
71
|
+
"@rollup/plugin-graphql": "1.1.0",
|
|
72
|
+
"@svgr/webpack": "6.2.1",
|
|
73
|
+
"@types/prompts": "^2.0.14",
|
|
74
|
+
"@vitejs/plugin-react": "1.3.2",
|
|
75
|
+
autoprefixer: "^10.4.4",
|
|
76
|
+
"babel-loader": "8.2.5",
|
|
77
|
+
browserslist: "^4.20.2",
|
|
78
|
+
cac: "6.7.12",
|
|
79
|
+
chalk: "4.1.2",
|
|
80
|
+
"core-js": "^3.21.1",
|
|
81
|
+
"css-loader": "6.7.1",
|
|
82
|
+
"css-minimizer-webpack-plugin": "3.4.1",
|
|
83
|
+
dotenv: "16.0.0",
|
|
84
|
+
"dotenv-expand": "8.0.3",
|
|
85
|
+
"fs-extra": "10.1.0",
|
|
86
|
+
"graphql-request": "^4.2.0",
|
|
87
|
+
"graphql-tag": "^2.12.6",
|
|
88
|
+
"html-webpack-plugin": "5.5.0",
|
|
89
|
+
"json-loader": "0.5.7",
|
|
90
|
+
lodash: "4.17.21",
|
|
91
|
+
"mini-css-extract-plugin": "2.6.0",
|
|
92
|
+
"moment-locales-webpack-plugin": "1.2.0",
|
|
93
|
+
"node-fetch": "2.6.7",
|
|
94
|
+
postcss: "8.4.13",
|
|
95
|
+
"postcss-custom-media": "8.0.0",
|
|
96
|
+
"postcss-custom-properties": "12.1.4",
|
|
97
|
+
"postcss-import": "14.1.0",
|
|
98
|
+
"postcss-loader": "6.2.1",
|
|
99
|
+
"postcss-reporter": "7.0.5",
|
|
100
|
+
prettier: "2.6.2",
|
|
101
|
+
prompts: "^2.4.2",
|
|
102
|
+
"querystring-es3": "^0.2.1",
|
|
103
|
+
rcfile: "1.0.3",
|
|
104
|
+
"react-dev-utils": "12.0.1",
|
|
105
|
+
"react-refresh": "0.13.0",
|
|
106
|
+
"serve-handler": "6.1.3",
|
|
107
|
+
shelljs: "0.8.5",
|
|
108
|
+
"style-loader": "3.3.1",
|
|
109
|
+
"svg-url-loader": "7.1.1",
|
|
110
|
+
"terser-webpack-plugin": "5.3.1",
|
|
111
|
+
"thread-loader": "3.0.4",
|
|
112
|
+
url: "^0.11.0",
|
|
113
|
+
vite: "2.9.8",
|
|
114
|
+
webpack: "5.72.0",
|
|
115
|
+
"webpack-bundle-analyzer": "4.5.0",
|
|
116
|
+
"webpack-dev-server": "4.9.0",
|
|
117
|
+
webpackbar: "5.0.2"
|
|
118
|
+
},
|
|
119
|
+
devDependencies: {
|
|
120
|
+
"@tsconfig/node16": "^1.0.2",
|
|
121
|
+
"@types/lodash": "^4.14.181",
|
|
122
|
+
"@types/mock-fs": "^4.13.1",
|
|
123
|
+
"@types/moment-locales-webpack-plugin": "^1.2.3",
|
|
124
|
+
"@types/node-fetch": "2.6.1",
|
|
125
|
+
"@types/serve-handler": "^6.1.1",
|
|
126
|
+
"mock-fs": "^5.1.2",
|
|
127
|
+
msw: "0.39.2",
|
|
128
|
+
rimraf: "3.0.2"
|
|
129
|
+
},
|
|
130
|
+
engines: {
|
|
131
|
+
node: ">=14"
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
exports.pkgJson = pkgJson;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
4
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
11
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
12
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
13
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
14
|
+
|
|
15
|
+
var moduleFileExtensions = ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx']; // Make sure any symlinks in the project folder are resolved:
|
|
16
|
+
// https://github.com/facebook/create-react-app/issues/637
|
|
17
|
+
|
|
18
|
+
var appDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
19
|
+
|
|
20
|
+
var resolveApp = function resolveApp(relativePath) {
|
|
21
|
+
return path__default["default"].resolve(appDirectory, relativePath);
|
|
22
|
+
}; // Resolve file paths in the order given
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var resolveModule = function resolveModule(resolveFn, filePath) {
|
|
26
|
+
var extension = _findInstanceProperty__default["default"](moduleFileExtensions).call(moduleFileExtensions, function (extension) {
|
|
27
|
+
var _context;
|
|
28
|
+
|
|
29
|
+
return fs__default["default"].existsSync(resolveFn(_concatInstanceProperty__default["default"](_context = "".concat(filePath, ".")).call(_context, extension)));
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (extension) {
|
|
33
|
+
var _context2;
|
|
34
|
+
|
|
35
|
+
return resolveFn(_concatInstanceProperty__default["default"](_context2 = "".concat(filePath, ".")).call(_context2, extension));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return resolveFn("".concat(filePath, ".js"));
|
|
39
|
+
}; // Resolve the absolute path of the caller location. This is necessary
|
|
40
|
+
// to point to files within that folder.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
var paths = {
|
|
44
|
+
appPackageJson: resolveApp('package.json'),
|
|
45
|
+
appBuild: resolveApp('public'),
|
|
46
|
+
appIndexHtmlTemplate: resolveApp('public/index.html.template'),
|
|
47
|
+
appIndexHtml: resolveApp('public/index.html'),
|
|
48
|
+
appWebpackConfig: resolveModule(resolveApp, "webpack.config.".concat(process.env.NODE_ENV === 'production' ? 'prod' : 'dev')),
|
|
49
|
+
yarnLockFile: resolveApp('yarn.lock'),
|
|
50
|
+
appRoot: resolveApp('.'),
|
|
51
|
+
entryPoint: resolveModule(resolveApp, 'src/index'),
|
|
52
|
+
sourceFolders: [resolveApp('src')]
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.paths = paths;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
4
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
11
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
12
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
13
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
14
|
+
|
|
15
|
+
var moduleFileExtensions = ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx']; // Make sure any symlinks in the project folder are resolved:
|
|
16
|
+
// https://github.com/facebook/create-react-app/issues/637
|
|
17
|
+
|
|
18
|
+
var appDirectory = fs__default["default"].realpathSync(process.cwd());
|
|
19
|
+
|
|
20
|
+
var resolveApp = function resolveApp(relativePath) {
|
|
21
|
+
return path__default["default"].resolve(appDirectory, relativePath);
|
|
22
|
+
}; // Resolve file paths in the order given
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var resolveModule = function resolveModule(resolveFn, filePath) {
|
|
26
|
+
var extension = _findInstanceProperty__default["default"](moduleFileExtensions).call(moduleFileExtensions, function (extension) {
|
|
27
|
+
var _context;
|
|
28
|
+
|
|
29
|
+
return fs__default["default"].existsSync(resolveFn(_concatInstanceProperty__default["default"](_context = "".concat(filePath, ".")).call(_context, extension)));
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (extension) {
|
|
33
|
+
var _context2;
|
|
34
|
+
|
|
35
|
+
return resolveFn(_concatInstanceProperty__default["default"](_context2 = "".concat(filePath, ".")).call(_context2, extension));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return resolveFn("".concat(filePath, ".js"));
|
|
39
|
+
}; // Resolve the absolute path of the caller location. This is necessary
|
|
40
|
+
// to point to files within that folder.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
var paths = {
|
|
44
|
+
appPackageJson: resolveApp('package.json'),
|
|
45
|
+
appBuild: resolveApp('public'),
|
|
46
|
+
appIndexHtmlTemplate: resolveApp('public/index.html.template'),
|
|
47
|
+
appIndexHtml: resolveApp('public/index.html'),
|
|
48
|
+
appWebpackConfig: resolveModule(resolveApp, "webpack.config.".concat('prod' )),
|
|
49
|
+
yarnLockFile: resolveApp('yarn.lock'),
|
|
50
|
+
appRoot: resolveApp('.'),
|
|
51
|
+
entryPoint: resolveModule(resolveApp, 'src/index'),
|
|
52
|
+
sourceFolders: [resolveApp('src')]
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.paths = paths;
|