@commercetools-frontend/mc-scripts 21.7.0 → 21.9.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.
Files changed (152) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -42
  3. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.d.ts +1 -0
  4. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +7 -0
  5. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.js +7 -0
  6. package/{build/config/application-runtime.js → application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js} +2 -2
  7. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +5 -0
  8. package/application-runtime/package.json +4 -0
  9. package/bin/cli.js +1 -1
  10. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.d.ts +1 -0
  11. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +361 -0
  12. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.js +7 -0
  13. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +361 -0
  14. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +345 -0
  15. package/cli/package.json +4 -0
  16. package/config/create-webpack-config-for-development.js +7 -1
  17. package/config/create-webpack-config-for-production.js +7 -1
  18. package/config/vendors-to-transpile.js +5 -1
  19. package/dist/build-5357ad26.cjs.prod.js +224 -0
  20. package/dist/build-9b6d7eee.cjs.dev.js +224 -0
  21. package/dist/build-c483e87f.esm.js +209 -0
  22. package/dist/build-vite-3b82522e.cjs.dev.js +151 -0
  23. package/dist/build-vite-93abdc95.esm.js +139 -0
  24. package/dist/build-vite-b7cd993a.cjs.prod.js +151 -0
  25. package/dist/commercetools-frontend-mc-scripts.cjs.d.ts +1 -0
  26. package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +30 -0
  27. package/dist/commercetools-frontend-mc-scripts.cjs.js +7 -0
  28. package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +30 -0
  29. package/dist/commercetools-frontend-mc-scripts.esm.js +22 -0
  30. package/dist/compile-html-4361a0b3.esm.js +77 -0
  31. package/dist/compile-html-d6331c35.cjs.prod.js +87 -0
  32. package/dist/compile-html-d9e731aa.cjs.dev.js +87 -0
  33. package/dist/config-sync-6b31d972.esm.js +840 -0
  34. package/dist/config-sync-a478bc0f.cjs.dev.js +864 -0
  35. package/dist/config-sync-f07734e4.cjs.prod.js +859 -0
  36. package/{build/config/create-postcss-config.js → dist/create-postcss-config-04243dea.esm.js} +27 -25
  37. package/dist/create-postcss-config-760e2dc5.cjs.dev.js +90 -0
  38. package/dist/create-postcss-config-ddc3abee.cjs.prod.js +90 -0
  39. package/dist/create-webpack-config-for-development-76fdab59.cjs.prod.js +419 -0
  40. package/{build/config/create-webpack-config-for-development.js → dist/create-webpack-config-for-development-d93ae4b2.esm.js} +94 -57
  41. package/dist/create-webpack-config-for-development-dfd1c174.cjs.dev.js +419 -0
  42. package/{build/config/create-webpack-config-for-production.js → dist/create-webpack-config-for-production-9290479a.esm.js} +120 -54
  43. package/dist/create-webpack-config-for-production-bc8c1f37.cjs.dev.js +469 -0
  44. package/dist/create-webpack-config-for-production-d652ad1a.cjs.prod.js +469 -0
  45. package/dist/declarations/src/application-runtime.d.ts +1 -0
  46. package/dist/declarations/src/cli.d.ts +4 -0
  47. package/dist/declarations/src/commands/build-vite.d.ts +2 -0
  48. package/dist/declarations/src/commands/build.d.ts +2 -0
  49. package/dist/declarations/src/commands/compile-html.d.ts +3 -0
  50. package/dist/declarations/src/commands/config-sync.d.ts +3 -0
  51. package/dist/declarations/src/commands/login.d.ts +2 -0
  52. package/dist/declarations/src/commands/serve.d.ts +2 -0
  53. package/dist/declarations/src/commands/start-vite.d.ts +2 -0
  54. package/dist/declarations/src/commands/start.d.ts +2 -0
  55. package/dist/declarations/src/config/create-postcss-config.d.ts +4 -0
  56. package/dist/declarations/src/config/create-webpack-config-for-development.d.ts +10 -0
  57. package/dist/declarations/src/config/create-webpack-config-for-production.d.ts +10 -0
  58. package/dist/declarations/src/config/has-jsx-runtime.d.ts +2 -0
  59. package/dist/declarations/src/config/moment-locales.d.ts +2 -0
  60. package/dist/declarations/src/config/paths.d.ts +12 -0
  61. package/dist/declarations/src/config/vendors-to-transpile.d.ts +2 -0
  62. package/dist/declarations/src/config/webpack-dev-server.config.d.ts +6 -0
  63. package/dist/declarations/src/deprecated-entry-points.d.ts +7 -0
  64. package/dist/declarations/src/generated/core.d.ts +710 -0
  65. package/dist/declarations/src/generated/settings.d.ts +2485 -0
  66. package/dist/declarations/src/index.d.ts +3 -0
  67. package/dist/declarations/src/postcss.d.ts +1 -0
  68. package/dist/declarations/src/types.d.ts +82 -0
  69. package/dist/declarations/src/utils/auth.d.ts +6 -0
  70. package/dist/declarations/src/utils/credentials-storage.d.ts +11 -0
  71. package/dist/declarations/src/utils/get-config-diff.d.ts +3 -0
  72. package/dist/declarations/src/utils/graphql-requests.d.ts +80 -0
  73. package/dist/declarations/src/utils/user-agent.d.ts +2 -0
  74. package/dist/declarations/src/version.d.ts +2 -0
  75. package/dist/declarations/src/vite-plugins/vite-plugin-custom-application.d.ts +4 -0
  76. package/dist/declarations/src/vite-plugins/vite-plugin-dynamic-base-assets-globals.d.ts +3 -0
  77. package/dist/declarations/src/vite-plugins/vite-plugin-svgr.d.ts +3 -0
  78. package/dist/declarations/src/webpack-plugins/final-stats-writer-plugin.d.ts +12 -0
  79. package/dist/declarations/src/webpack-plugins/local-html-webpack-plugin.d.ts +5 -0
  80. package/dist/declarations/src/webpack.d.ts +2 -0
  81. package/dist/has-jsx-runtime-0b03b72e.cjs.prod.js +17 -0
  82. package/dist/has-jsx-runtime-3d4bb633.cjs.dev.js +17 -0
  83. package/{build/config/has-jsx-runtime.js → dist/has-jsx-runtime-8314226e.esm.js} +1 -3
  84. package/dist/login-7b7ae27e.esm.js +155 -0
  85. package/dist/login-b13f26e7.cjs.dev.js +165 -0
  86. package/dist/login-c11fb977.cjs.prod.js +165 -0
  87. package/dist/package-4b4fcf02.cjs.prod.js +139 -0
  88. package/dist/package-4c3e3fb7.cjs.dev.js +139 -0
  89. package/dist/package-8e6305bd.esm.js +137 -0
  90. package/dist/paths-16823f56.cjs.dev.js +55 -0
  91. package/dist/paths-76b66e74.cjs.prod.js +55 -0
  92. package/dist/paths-ed23d5a1.esm.js +46 -0
  93. package/dist/serve-12de323b.cjs.dev.js +70 -0
  94. package/dist/serve-784f4fcd.cjs.prod.js +70 -0
  95. package/dist/serve-d6b437b1.esm.js +62 -0
  96. package/dist/start-1b7dad90.cjs.prod.js +209 -0
  97. package/dist/start-45ca01f2.cjs.dev.js +209 -0
  98. package/dist/start-600d06a3.esm.js +194 -0
  99. package/dist/start-vite-22de08dc.cjs.dev.js +151 -0
  100. package/dist/start-vite-dc046cba.esm.js +138 -0
  101. package/dist/start-vite-fe13330b.cjs.prod.js +151 -0
  102. package/dist/user-agent-5f8ec93d.cjs.prod.js +106 -0
  103. package/dist/user-agent-ca628320.esm.js +94 -0
  104. package/dist/user-agent-ee57c98a.cjs.dev.js +106 -0
  105. package/dist/vendors-to-transpile-367e0ba8.cjs.prod.js +5 -0
  106. package/dist/vendors-to-transpile-68e03526.esm.js +3 -0
  107. package/dist/vendors-to-transpile-b51af5d3.cjs.dev.js +5 -0
  108. package/dist/vite-plugin-svgr-4205f2b5.cjs.dev.js +110 -0
  109. package/dist/vite-plugin-svgr-eb8524fa.esm.js +85 -0
  110. package/dist/vite-plugin-svgr-f3bbedbe.cjs.prod.js +110 -0
  111. package/package.json +56 -50
  112. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.d.ts +1 -0
  113. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +14 -0
  114. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.js +7 -0
  115. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +14 -0
  116. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +6 -0
  117. package/postcss/package.json +4 -0
  118. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.d.ts +1 -0
  119. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +51 -0
  120. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.js +7 -0
  121. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +51 -0
  122. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +42 -0
  123. package/webpack/package.json +4 -0
  124. package/build/bin/cli.js +0 -264
  125. package/build/commands/build-vite.js +0 -91
  126. package/build/commands/build.js +0 -140
  127. package/build/commands/compile-html.js +0 -53
  128. package/build/commands/config-sync.js +0 -176
  129. package/build/commands/login.js +0 -60
  130. package/build/commands/serve.js +0 -37
  131. package/build/commands/start-vite.js +0 -138
  132. package/build/commands/start.js +0 -108
  133. package/build/config/paths.js +0 -38
  134. package/build/config/vendors-to-transpile.js +0 -3
  135. package/build/config/webpack-dev-server.config.js +0 -69
  136. package/build/index.js +0 -16
  137. package/build/utils/auth.js +0 -34
  138. package/build/utils/auth.spec.js +0 -61
  139. package/build/utils/create-custom-application.settings.graphql +0 -8
  140. package/build/utils/credentials-storage.js +0 -72
  141. package/build/utils/credentials-storage.spec.js +0 -69
  142. package/build/utils/fetch-custom-application.settings.graphql +0 -36
  143. package/build/utils/fetch-user-organizations.core.graphql +0 -9
  144. package/build/utils/get-config-diff.js +0 -308
  145. package/build/utils/get-config-diff.spec.js +0 -285
  146. package/build/utils/graphql-requests.js +0 -105
  147. package/build/utils/graphql-requests.spec.js +0 -159
  148. package/build/utils/require-graphql.js +0 -15
  149. package/build/utils/update-custom-application.settings.graphql +0 -13
  150. package/build/utils/user-agent.js +0 -15
  151. package/build/webpack-plugins/final-stats-writer-plugin.js +0 -50
  152. package/build/webpack-plugins/local-html-webpack-plugin.js +0 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/mc-scripts",
3
- "version": "21.7.0",
3
+ "version": "21.9.0",
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": {
@@ -14,49 +14,74 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "main": "./build/index.js",
18
- "files": ["build", "config", "package.json", "LICENSE", "README.md"],
17
+ "main": "dist/commercetools-frontend-mc-scripts.cjs.js",
18
+ "module": "dist/commercetools-frontend-mc-scripts.esm.js",
19
+ "preconstruct": {
20
+ "entrypoints": [
21
+ "./index.ts",
22
+ "./application-runtime.ts",
23
+ "./cli.ts",
24
+ "./postcss.ts",
25
+ "./webpack.ts"
26
+ ]
27
+ },
28
+ "files": [
29
+ "bin",
30
+ "cli",
31
+ "dist",
32
+ "config",
33
+ "application-runtime",
34
+ "postcss",
35
+ "webpack",
36
+ "package.json",
37
+ "LICENSE",
38
+ "README.md"
39
+ ],
19
40
  "bin": "./bin/cli.js",
20
41
  "browserslist": {
21
42
  "production": [">1%", "not op_mini all", "not dead"],
22
43
  "development": ["last 2 firefox versions", "last 2 chrome versions"]
23
44
  },
24
- "scripts": {
25
- "build": "rimraf build && babel src --out-dir build && ../../scripts/copy-graphql-files.mjs src build",
26
- "build:bundles:watch": "yarn build -w"
27
- },
28
45
  "dependencies": {
29
- "@babel/core": "^7.17.9",
30
- "@babel/runtime": "^7.17.9",
31
- "@babel/runtime-corejs3": "^7.17.9",
32
- "@commercetools-frontend/application-config": "21.7.0",
33
- "@commercetools-frontend/assets": "21.0.0",
34
- "@commercetools-frontend/babel-preset-mc-app": "21.3.4",
35
- "@commercetools-frontend/constants": "21.3.4",
36
- "@commercetools-frontend/mc-dev-authentication": "21.7.0",
37
- "@commercetools-frontend/mc-html-template": "21.7.0",
46
+ "@babel/core": "^7.18.6",
47
+ "@babel/runtime": "^7.18.6",
48
+ "@babel/runtime-corejs3": "^7.18.6",
49
+ "@commercetools-frontend/application-config": "21.9.0",
50
+ "@commercetools-frontend/assets": "21.9.0",
51
+ "@commercetools-frontend/babel-preset-mc-app": "21.9.0",
52
+ "@commercetools-frontend/constants": "21.9.0",
53
+ "@commercetools-frontend/mc-dev-authentication": "21.9.0",
54
+ "@commercetools-frontend/mc-html-template": "21.9.0",
55
+ "@commercetools/http-user-agent": "2.1.2",
38
56
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
39
57
  "@rollup/plugin-graphql": "1.1.0",
40
- "@svgr/webpack": "6.2.1",
41
- "@vitejs/plugin-react": "1.3.2",
42
- "autoprefixer": "^10.4.4",
58
+ "@rollup/pluginutils": "4.2.1",
59
+ "@svgr/babel-preset": "^6.2.0",
60
+ "@svgr/core": "^6.2.1",
61
+ "@svgr/webpack": "^6.2.1",
62
+ "@types/prompts": "^2.0.14",
63
+ "@types/svgo": "^2.6.3",
64
+ "@vitejs/plugin-react": "2.0.0",
65
+ "autoprefixer": "^10.4.7",
43
66
  "babel-loader": "8.2.5",
44
67
  "browserslist": "^4.20.2",
68
+ "cac": "6.7.12",
45
69
  "chalk": "4.1.2",
46
- "core-js": "^3.21.1",
70
+ "core-js": "^3.23.4",
47
71
  "css-loader": "6.7.1",
48
72
  "css-minimizer-webpack-plugin": "3.4.1",
49
73
  "dotenv": "16.0.0",
50
74
  "dotenv-expand": "8.0.3",
51
75
  "fs-extra": "10.1.0",
52
- "graphql-request": "^4.2.0",
76
+ "graphql-request": "^4.3.0",
53
77
  "graphql-tag": "^2.12.6",
54
78
  "html-webpack-plugin": "5.5.0",
55
79
  "json-loader": "0.5.7",
80
+ "lodash": "4.17.21",
56
81
  "mini-css-extract-plugin": "2.6.0",
57
82
  "moment-locales-webpack-plugin": "1.2.0",
58
- "mri": "1.2.0",
59
- "postcss": "8.4.13",
83
+ "node-fetch": "2.6.7",
84
+ "postcss": "8.4.14",
60
85
  "postcss-custom-media": "8.0.0",
61
86
  "postcss-custom-properties": "12.1.4",
62
87
  "postcss-import": "14.1.0",
@@ -75,43 +100,24 @@
75
100
  "terser-webpack-plugin": "5.3.1",
76
101
  "thread-loader": "3.0.4",
77
102
  "url": "^0.11.0",
78
- "vite": "2.9.8",
103
+ "vite": "3.0.0",
79
104
  "webpack": "5.72.0",
80
105
  "webpack-bundle-analyzer": "4.5.0",
81
106
  "webpack-dev-server": "4.9.0",
82
107
  "webpackbar": "5.0.2"
83
108
  },
84
109
  "devDependencies": {
85
- "@babel/plugin-transform-runtime": "^7.17.0",
86
- "@babel/preset-env": "^7.16.11",
110
+ "@tsconfig/node16": "^1.0.3",
111
+ "@types/lodash": "^4.14.182",
112
+ "@types/mock-fs": "^4.13.1",
113
+ "@types/moment-locales-webpack-plugin": "^1.2.3",
114
+ "@types/node-fetch": "2.6.2",
115
+ "@types/serve-handler": "^6.1.1",
87
116
  "mock-fs": "^5.1.2",
88
- "msw": "0.39.2",
117
+ "msw": "0.44.0",
89
118
  "rimraf": "3.0.2"
90
119
  },
91
120
  "engines": {
92
121
  "node": ">=14"
93
- },
94
- "babel": {
95
- "presets": [
96
- [
97
- "@babel/preset-env",
98
- {
99
- "targets": {
100
- "node": "14"
101
- },
102
- "modules": "commonjs",
103
- "useBuiltIns": "usage",
104
- "corejs": 3
105
- }
106
- ]
107
- ],
108
- "plugins": [
109
- [
110
- "@babel/plugin-transform-runtime",
111
- {
112
- "corejs": 3
113
- }
114
- ]
115
- ]
116
122
  }
117
123
  }
@@ -0,0 +1 @@
1
+ export * from "../../dist/declarations/src/postcss";
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var createPostcssConfig = require('../../dist/create-postcss-config-760e2dc5.cjs.dev.js');
6
+ require('@babel/runtime-corejs3/helpers/toConsumableArray');
7
+ require('@babel/runtime-corejs3/helpers/slicedToArray');
8
+ require('@babel/runtime-corejs3/core-js-stable/instance/concat');
9
+ require('path');
10
+ require('../../dist/package-4c3e3fb7.cjs.dev.js');
11
+
12
+
13
+
14
+ exports.createPostcssConfig = createPostcssConfig.createPostcssConfig;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./commercetools-frontend-mc-scripts-postcss.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./commercetools-frontend-mc-scripts-postcss.cjs.dev.js");
7
+ }
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var createPostcssConfig = require('../../dist/create-postcss-config-ddc3abee.cjs.prod.js');
6
+ require('@babel/runtime-corejs3/helpers/toConsumableArray');
7
+ require('@babel/runtime-corejs3/helpers/slicedToArray');
8
+ require('@babel/runtime-corejs3/core-js-stable/instance/concat');
9
+ require('path');
10
+ require('../../dist/package-4b4fcf02.cjs.prod.js');
11
+
12
+
13
+
14
+ exports.createPostcssConfig = createPostcssConfig.createPostcssConfig;
@@ -0,0 +1,6 @@
1
+ export { c as createPostcssConfig } from '../../dist/create-postcss-config-04243dea.esm.js';
2
+ import '@babel/runtime-corejs3/helpers/toConsumableArray';
3
+ import '@babel/runtime-corejs3/helpers/slicedToArray';
4
+ import '@babel/runtime-corejs3/core-js-stable/instance/concat';
5
+ import 'path';
6
+ import '../../dist/package-8e6305bd.esm.js';
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "dist/commercetools-frontend-mc-scripts-postcss.cjs.js",
3
+ "module": "dist/commercetools-frontend-mc-scripts-postcss.esm.js"
4
+ }
@@ -0,0 +1 @@
1
+ export * from "../../dist/declarations/src/webpack";
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var createWebpackConfigForDevelopment = require('../../dist/create-webpack-config-for-development-dfd1c174.cjs.dev.js');
6
+ var createWebpackConfigForProduction = require('../../dist/create-webpack-config-for-production-bc8c1f37.cjs.dev.js');
7
+ require('@babel/runtime-corejs3/core-js-stable/object/keys');
8
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
9
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
10
+ require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
11
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
12
+ require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
13
+ require('@babel/runtime-corejs3/core-js-stable/object/define-property');
14
+ require('@babel/runtime-corejs3/helpers/defineProperty');
15
+ require('@babel/runtime-corejs3/core-js-stable/instance/map');
16
+ require('@babel/runtime-corejs3/core-js-stable/instance/filter');
17
+ require('@babel/runtime-corejs3/core-js-stable/json/stringify');
18
+ require('@babel/runtime-corejs3/core-js-stable/instance/ends-with');
19
+ require('@babel/runtime-corejs3/core-js-stable/instance/concat');
20
+ require('path');
21
+ require('webpack');
22
+ require('webpackbar');
23
+ require('html-webpack-plugin');
24
+ require('moment-locales-webpack-plugin');
25
+ require('@pmmmwh/react-refresh-webpack-plugin');
26
+ require('@babel/runtime-corejs3/helpers/classCallCheck');
27
+ require('@babel/runtime-corejs3/helpers/createClass');
28
+ require('@babel/runtime-corejs3/core-js-stable/object/assign');
29
+ require('@commercetools-frontend/application-config');
30
+ require('@commercetools-frontend/mc-html-template');
31
+ require('../../dist/paths-16823f56.cjs.dev.js');
32
+ require('@babel/runtime-corejs3/core-js-stable/instance/find');
33
+ require('fs');
34
+ require('../../dist/vendors-to-transpile-b51af5d3.cjs.dev.js');
35
+ require('../../dist/create-postcss-config-760e2dc5.cjs.dev.js');
36
+ require('@babel/runtime-corejs3/helpers/toConsumableArray');
37
+ require('@babel/runtime-corejs3/helpers/slicedToArray');
38
+ require('../../dist/package-4c3e3fb7.cjs.dev.js');
39
+ require('../../dist/has-jsx-runtime-3d4bb633.cjs.dev.js');
40
+ require('@babel/runtime-corejs3/core-js-stable/number/is-integer');
41
+ require('webpack-bundle-analyzer');
42
+ require('css-minimizer-webpack-plugin');
43
+ require('mini-css-extract-plugin');
44
+ require('terser-webpack-plugin');
45
+ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
46
+ require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
47
+
48
+
49
+
50
+ exports.createWebpackConfigForDevelopment = createWebpackConfigForDevelopment.createWebpackConfigForDevelopment;
51
+ exports.createWebpackConfigForProduction = createWebpackConfigForProduction.createWebpackConfigForProduction;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./commercetools-frontend-mc-scripts-webpack.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./commercetools-frontend-mc-scripts-webpack.cjs.dev.js");
7
+ }
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var createWebpackConfigForDevelopment = require('../../dist/create-webpack-config-for-development-76fdab59.cjs.prod.js');
6
+ var createWebpackConfigForProduction = require('../../dist/create-webpack-config-for-production-d652ad1a.cjs.prod.js');
7
+ require('@babel/runtime-corejs3/core-js-stable/object/keys');
8
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
9
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
10
+ require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
11
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
12
+ require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
13
+ require('@babel/runtime-corejs3/core-js-stable/object/define-property');
14
+ require('@babel/runtime-corejs3/helpers/defineProperty');
15
+ require('@babel/runtime-corejs3/core-js-stable/instance/map');
16
+ require('@babel/runtime-corejs3/core-js-stable/instance/filter');
17
+ require('@babel/runtime-corejs3/core-js-stable/json/stringify');
18
+ require('@babel/runtime-corejs3/core-js-stable/instance/ends-with');
19
+ require('@babel/runtime-corejs3/core-js-stable/instance/concat');
20
+ require('path');
21
+ require('webpack');
22
+ require('webpackbar');
23
+ require('html-webpack-plugin');
24
+ require('moment-locales-webpack-plugin');
25
+ require('@pmmmwh/react-refresh-webpack-plugin');
26
+ require('@babel/runtime-corejs3/helpers/classCallCheck');
27
+ require('@babel/runtime-corejs3/helpers/createClass');
28
+ require('@babel/runtime-corejs3/core-js-stable/object/assign');
29
+ require('@commercetools-frontend/application-config');
30
+ require('@commercetools-frontend/mc-html-template');
31
+ require('../../dist/paths-76b66e74.cjs.prod.js');
32
+ require('@babel/runtime-corejs3/core-js-stable/instance/find');
33
+ require('fs');
34
+ require('../../dist/vendors-to-transpile-367e0ba8.cjs.prod.js');
35
+ require('../../dist/create-postcss-config-ddc3abee.cjs.prod.js');
36
+ require('@babel/runtime-corejs3/helpers/toConsumableArray');
37
+ require('@babel/runtime-corejs3/helpers/slicedToArray');
38
+ require('../../dist/package-4b4fcf02.cjs.prod.js');
39
+ require('../../dist/has-jsx-runtime-0b03b72e.cjs.prod.js');
40
+ require('@babel/runtime-corejs3/core-js-stable/number/is-integer');
41
+ require('webpack-bundle-analyzer');
42
+ require('css-minimizer-webpack-plugin');
43
+ require('mini-css-extract-plugin');
44
+ require('terser-webpack-plugin');
45
+ require('@babel/runtime-corejs3/core-js-stable/instance/bind');
46
+ require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
47
+
48
+
49
+
50
+ exports.createWebpackConfigForDevelopment = createWebpackConfigForDevelopment.createWebpackConfigForDevelopment;
51
+ exports.createWebpackConfigForProduction = createWebpackConfigForProduction.createWebpackConfigForProduction;
@@ -0,0 +1,42 @@
1
+ export { c as createWebpackConfigForDevelopment } from '../../dist/create-webpack-config-for-development-d93ae4b2.esm.js';
2
+ export { c as createWebpackConfigForProduction } from '../../dist/create-webpack-config-for-production-9290479a.esm.js';
3
+ import '@babel/runtime-corejs3/core-js-stable/object/keys';
4
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
5
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
6
+ import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
7
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
8
+ import '@babel/runtime-corejs3/core-js-stable/object/define-properties';
9
+ import '@babel/runtime-corejs3/core-js-stable/object/define-property';
10
+ import '@babel/runtime-corejs3/helpers/defineProperty';
11
+ import '@babel/runtime-corejs3/core-js-stable/instance/map';
12
+ import '@babel/runtime-corejs3/core-js-stable/instance/filter';
13
+ import '@babel/runtime-corejs3/core-js-stable/json/stringify';
14
+ import '@babel/runtime-corejs3/core-js-stable/instance/ends-with';
15
+ import '@babel/runtime-corejs3/core-js-stable/instance/concat';
16
+ import 'path';
17
+ import 'webpack';
18
+ import 'webpackbar';
19
+ import 'html-webpack-plugin';
20
+ import 'moment-locales-webpack-plugin';
21
+ import '@pmmmwh/react-refresh-webpack-plugin';
22
+ import '@babel/runtime-corejs3/helpers/classCallCheck';
23
+ import '@babel/runtime-corejs3/helpers/createClass';
24
+ import '@babel/runtime-corejs3/core-js-stable/object/assign';
25
+ import '@commercetools-frontend/application-config';
26
+ import '@commercetools-frontend/mc-html-template';
27
+ import '../../dist/paths-ed23d5a1.esm.js';
28
+ import '@babel/runtime-corejs3/core-js-stable/instance/find';
29
+ import 'fs';
30
+ import '../../dist/vendors-to-transpile-68e03526.esm.js';
31
+ import '../../dist/create-postcss-config-04243dea.esm.js';
32
+ import '@babel/runtime-corejs3/helpers/toConsumableArray';
33
+ import '@babel/runtime-corejs3/helpers/slicedToArray';
34
+ import '../../dist/package-8e6305bd.esm.js';
35
+ import '../../dist/has-jsx-runtime-8314226e.esm.js';
36
+ import '@babel/runtime-corejs3/core-js-stable/number/is-integer';
37
+ import 'webpack-bundle-analyzer';
38
+ import 'css-minimizer-webpack-plugin';
39
+ import 'mini-css-extract-plugin';
40
+ import 'terser-webpack-plugin';
41
+ import '@babel/runtime-corejs3/core-js-stable/instance/bind';
42
+ import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "dist/commercetools-frontend-mc-scripts-webpack.cjs.js",
3
+ "module": "dist/commercetools-frontend-mc-scripts-webpack.esm.js"
4
+ }
package/build/bin/cli.js DELETED
@@ -1,264 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
-
5
- var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
6
-
7
- // Makes the script crash on unhandled rejections instead of silently
8
- // ignoring them. In the future, promise rejections that are not handled will
9
- // terminate the Node.js process with a non-zero exit code.
10
- process.on('unhandledRejection', err => {
11
- throw err;
12
- });
13
-
14
- const fs = require('fs');
15
-
16
- const path = require('path');
17
-
18
- const mri = require('mri');
19
-
20
- const dotenv = require('dotenv');
21
-
22
- const dotenvExpand = require('dotenv-expand');
23
-
24
- const spawn = require('react-dev-utils/crossSpawn');
25
-
26
- const pkg = require('../../package.json');
27
-
28
- const flags = mri(process.argv.slice(2), {
29
- alias: {
30
- help: ['h']
31
- },
32
- boolean: ['build-only']
33
- });
34
- const commands = flags._;
35
-
36
- if (commands.length === 0 || flags.help && commands.length === 0) {
37
- console.log(`
38
- Usage: mc-scripts [global-options] [command] [options]
39
-
40
- https://docs.commercetools.com/custom-applications/api-reference/cli.
41
-
42
- Global options:
43
-
44
- --env <path> (optional) Parses the file path as a dotenv file and adds the variables to the environment. Multiple flags are allowed.
45
-
46
- Commands:
47
-
48
- build Bundles the application in production mode. Outputs a "public" folder.
49
- --build-only (optional) If defined, the command only creates the production bundles without compiling the "index.html".
50
-
51
- 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".
52
- --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).
53
- --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).
54
-
55
- start Starts the application in development mode using Webpack Dev Server.
56
-
57
- serve Serves previously built and compiled application from the "public" folder.
58
-
59
- login Log in to your Merchant Center account through the CLI, using the cloud environment information from the Custom Application config file. An API token is generated and stored in a configuration file for the related cloud environment, and valid for 36 hours.
60
-
61
- config:sync Synchronizes the local Custom Application config with the Merchant Center. A new Custom Application will be created if none existed, otherwise it will be updated.
62
- --dry-run (optional) Executes the command but does not send any mutation request.
63
- `);
64
- process.exit(0);
65
- }
66
-
67
- const command = commands[0];
68
- console.log('');
69
- console.log(`mc-scripts: v${pkg.version}`);
70
- console.log(''); // Get the current directory where the CLI is executed from. Usually this is the application folder.
71
-
72
- const applicationDirectory = fs.realpathSync(process.cwd());
73
-
74
- (async () => {
75
- try {
76
- // Load dotenv files into the process environment.
77
- // This is essentially what `dotenv-cli` does, but it's now built into this CLI.
78
- loadDotEnvFiles(flags);
79
-
80
- switch (command) {
81
- case 'build':
82
- {
83
- // Do this as the first thing so that any code reading it knows the right env.
84
- process.env.BABEL_ENV = 'production';
85
- process.env.NODE_ENV = 'production';
86
- const shouldAlsoCompile = !flags['build-only'];
87
- const shouldUseExperimentalBundler = process.env.ENABLE_EXPERIMENTAL_VITE_BUNDLER === 'true';
88
-
89
- if (shouldUseExperimentalBundler) {
90
- console.log('Experimental Vite bundler enabled! 🚀');
91
- console.warn('NOTE that the "cdnURL" value is not supported at the moment when using Vite.');
92
- console.log('');
93
- }
94
-
95
- proxyCommand(command, {
96
- noExit: shouldAlsoCompile,
97
- fileName: shouldUseExperimentalBundler ? 'build-vite' : 'build'
98
- });
99
-
100
- if (shouldAlsoCompile) {
101
- console.log('');
102
- proxyCommand('compile-html');
103
- }
104
-
105
- break;
106
- }
107
-
108
- case 'serve':
109
- {
110
- // Do this as the first thing so that any code reading it knows the right env.
111
- process.env.NODE_ENV = 'production';
112
- proxyCommand(command);
113
- break;
114
- }
115
-
116
- case 'compile-html':
117
- {
118
- // Do this as the first thing so that any code reading it knows the right env.
119
- process.env.NODE_ENV = 'production'; // Get specific flag for this command.
120
-
121
- const commandArgs = getArgsForCommand(['transformer', 'print-security-headers']);
122
- proxyCommand(command, {
123
- commandArgs
124
- });
125
- break;
126
- }
127
-
128
- case 'start':
129
- {
130
- // Do this as the first thing so that any code reading it knows the right env.
131
- process.env.BABEL_ENV = 'development';
132
- process.env.NODE_ENV = 'development';
133
- const shouldUseExperimentalBundler = process.env.ENABLE_EXPERIMENTAL_VITE_BUNDLER === 'true';
134
-
135
- if (shouldUseExperimentalBundler) {
136
- console.log('Experimental Vite bundler enabled');
137
- console.log('');
138
- }
139
-
140
- proxyCommand(command, {
141
- fileName: shouldUseExperimentalBundler ? 'start-vite' : 'start'
142
- });
143
- break;
144
- }
145
-
146
- case 'login':
147
- {
148
- // Do this as the first thing so that any code reading it knows the right env.
149
- process.env.NODE_ENV = 'production';
150
- proxyCommand(command);
151
- break;
152
- }
153
-
154
- case 'config:sync':
155
- {
156
- // Do this as the first thing so that any code reading it knows the right env.
157
- process.env.NODE_ENV = 'production'; // Get specific flag for this command.
158
-
159
- const commandArgs = getArgsForCommand(['dry-run']);
160
- proxyCommand(command, {
161
- commandArgs,
162
- // File names with `:` cause issues in Windows, therefore the file name is
163
- // different from the command name.
164
- fileName: 'config-sync'
165
- });
166
- break;
167
- }
168
-
169
- default:
170
- console.log(`Unknown script "${command}".`);
171
- console.log('Perhaps you need to update mc-scripts?');
172
- console.log('See: https://www.npmjs.com/package/@commercetools-frontend/mc-scripts');
173
- break;
174
- }
175
- } catch (error) {
176
- console.error(error);
177
- process.exit(1);
178
- }
179
- })();
180
-
181
- function getArgsForCommand(allowedFlags = []) {
182
- return Object.keys(flags).reduce((allArgs, flagKey) => {
183
- if ((0, _includes.default)(allowedFlags).call(allowedFlags, flagKey)) {
184
- return allArgs.concat([`--${flagKey}`, flags[flagKey]]);
185
- }
186
-
187
- return allArgs;
188
- }, []);
189
- }
190
-
191
- function proxyCommand(commandName, {
192
- commandArgs,
193
- fileName,
194
- noExit
195
- } = {}) {
196
- // Spawn the actual command.
197
- const result = spawn.sync('node', [require.resolve(`../commands/${fileName || commandName}`)].concat(commandArgs), {
198
- stdio: 'inherit'
199
- }); // Handle exit signals.
200
-
201
- if (result.signal) {
202
- switch (result.signal) {
203
- case 'SIGKILL':
204
- {
205
- console.log(`The command ${commandName} failed because the process exited too early. This probably means the system ran out of memory or someone called "kill -9" on the process.`);
206
- break;
207
- }
208
-
209
- case 'SIGTERM':
210
- {
211
- console.log(`The command ${commandName} failed because the process exited too early. Someone might have called "kill" or "killall", or the system could be shutting down.`);
212
- break;
213
- }
214
-
215
- default:
216
- break;
217
- }
218
-
219
- process.exit(1);
220
- }
221
-
222
- if (result.status > 0) {
223
- process.exit(result.status);
224
- } else {
225
- if (!noExit) {
226
- process.exit(result.status);
227
- }
228
- }
229
- } // Load dotenv files into the process environment.
230
- // This is essentially what `dotenv-cli` does, but it's now built into this CLI.
231
- // Inspired also by https://create-react-app.dev/docs/adding-custom-environment-variables/#what-other-env-files-can-be-used
232
-
233
-
234
- function loadDotEnvFiles(flags) {
235
- const environment = process.env.MC_APP_ENV || process.env.NODE_ENV;
236
- const dotenvFiles = []; // Custom dotenv files specified by the `--env` option takes precedence.
237
-
238
- if (typeof flags.env === 'string') {
239
- dotenvFiles.push(flags.env);
240
- } else if (Array.isArray(flags.env)) {
241
- // Multiple `--env` options are allowed.
242
- dotenvFiles.push(...flags.env);
243
- } // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
244
-
245
-
246
- dotenvFiles.push(...[`.env.${environment}.local`, // Don't include `.env.local` for `test` environment
247
- // since normally you expect tests to produce the same
248
- // results for everyone
249
- process.NODE_ENV !== 'test' && `.env.local`, `.env.${environment}`, '.env'].filter(Boolean)); // Load environment variables from .env* files. Suppress warnings using silent
250
- // if this file is missing. dotenv will never modify any environment variables
251
- // that have already been set. Variable expansion is supported in .env files.
252
- // https://github.com/motdotla/dotenv
253
- // https://github.com/motdotla/dotenv-expand
254
-
255
- dotenvFiles.forEach(dotenvFile => {
256
- const dotenvFilePath = path.resolve(path.join(applicationDirectory, dotenvFile));
257
-
258
- if (fs.existsSync(dotenvFilePath)) {
259
- dotenvExpand.expand(dotenv.config({
260
- path: dotenvFilePath
261
- }));
262
- }
263
- });
264
- }