@commercetools-frontend/mc-scripts 0.0.0-FEC-157-preview-releases-20241126230331

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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.d.ts +2 -0
  4. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.d.ts.map +1 -0
  5. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +7 -0
  6. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.js +7 -0
  7. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js +7 -0
  8. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +5 -0
  9. package/application-runtime/package.json +4 -0
  10. package/bin/cli.js +8 -0
  11. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.d.ts +2 -0
  12. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.d.ts.map +1 -0
  13. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +211 -0
  14. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.js +7 -0
  15. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +211 -0
  16. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +196 -0
  17. package/cli/package.json +4 -0
  18. package/config/create-webpack-config-for-development.js +8 -0
  19. package/config/create-webpack-config-for-production.js +8 -0
  20. package/config/vendors-to-transpile.js +6 -0
  21. package/dist/build-99744dae.cjs.prod.js +166 -0
  22. package/dist/build-a93715aa.esm.js +152 -0
  23. package/dist/build-f56ce7ec.cjs.dev.js +166 -0
  24. package/dist/build-vite-000f0a2d.cjs.prod.js +193 -0
  25. package/dist/build-vite-722f0dcf.esm.js +182 -0
  26. package/dist/build-vite-838c8e01.cjs.dev.js +193 -0
  27. package/dist/commercetools-frontend-mc-scripts.cjs.d.ts +2 -0
  28. package/dist/commercetools-frontend-mc-scripts.cjs.d.ts.map +1 -0
  29. package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +29 -0
  30. package/dist/commercetools-frontend-mc-scripts.cjs.js +7 -0
  31. package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +29 -0
  32. package/dist/commercetools-frontend-mc-scripts.esm.js +21 -0
  33. package/dist/compile-html-025cd493.esm.js +34 -0
  34. package/dist/compile-html-50fd05ec.cjs.prod.js +42 -0
  35. package/dist/compile-html-f4ac88cc.cjs.dev.js +42 -0
  36. package/dist/config-sync-2ff62f08.cjs.dev.js +845 -0
  37. package/dist/config-sync-b57f79e2.cjs.prod.js +839 -0
  38. package/dist/config-sync-cda7662e.esm.js +823 -0
  39. package/dist/create-postcss-config-2f709335.esm.js +75 -0
  40. package/dist/create-postcss-config-3b540c7c.cjs.prod.js +81 -0
  41. package/dist/create-postcss-config-5962fa01.cjs.dev.js +81 -0
  42. package/dist/create-webpack-config-for-development-7d9e4dc4.cjs.prod.js +463 -0
  43. package/dist/create-webpack-config-for-development-86baace3.esm.js +438 -0
  44. package/dist/create-webpack-config-for-development-b379913b.cjs.dev.js +463 -0
  45. package/dist/create-webpack-config-for-production-3a40f56b.cjs.dev.js +518 -0
  46. package/dist/create-webpack-config-for-production-5ec9d0e2.cjs.prod.js +518 -0
  47. package/dist/create-webpack-config-for-production-b6ee3116.esm.js +488 -0
  48. package/dist/credentials-storage-3cea94ea.cjs.dev.js +95 -0
  49. package/dist/credentials-storage-b13e1406.esm.js +83 -0
  50. package/dist/credentials-storage-dc849808.cjs.prod.js +95 -0
  51. package/dist/declarations/src/application-runtime.d.ts +1 -0
  52. package/dist/declarations/src/cli.d.ts +4 -0
  53. package/dist/declarations/src/commands/build-vite.d.ts +2 -0
  54. package/dist/declarations/src/commands/build.d.ts +2 -0
  55. package/dist/declarations/src/commands/compile-html.d.ts +3 -0
  56. package/dist/declarations/src/commands/config-sync.d.ts +3 -0
  57. package/dist/declarations/src/commands/deployment-previews-set.d.ts +3 -0
  58. package/dist/declarations/src/commands/login.d.ts +2 -0
  59. package/dist/declarations/src/commands/serve.d.ts +2 -0
  60. package/dist/declarations/src/commands/start-vite.d.ts +2 -0
  61. package/dist/declarations/src/commands/start.d.ts +2 -0
  62. package/dist/declarations/src/config/create-postcss-config.d.ts +4 -0
  63. package/dist/declarations/src/config/create-webpack-config-for-development.d.ts +10 -0
  64. package/dist/declarations/src/config/create-webpack-config-for-production.d.ts +10 -0
  65. package/dist/declarations/src/config/has-jsx-runtime.d.ts +2 -0
  66. package/dist/declarations/src/config/moment-locales.d.ts +2 -0
  67. package/dist/declarations/src/config/optimizations.d.ts +2 -0
  68. package/dist/declarations/src/config/paths.d.ts +12 -0
  69. package/dist/declarations/src/config/vendors-to-transpile.d.ts +2 -0
  70. package/dist/declarations/src/config/webpack-dev-server.config.d.ts +6 -0
  71. package/dist/declarations/src/deprecated-entry-points.d.ts +7 -0
  72. package/dist/declarations/src/generated/core.d.ts +739 -0
  73. package/dist/declarations/src/generated/settings.d.ts +2116 -0
  74. package/dist/declarations/src/index.d.ts +3 -0
  75. package/dist/declarations/src/postcss.d.ts +1 -0
  76. package/dist/declarations/src/types.d.ts +87 -0
  77. package/dist/declarations/src/utils/auth.d.ts +6 -0
  78. package/dist/declarations/src/utils/credentials-storage.d.ts +11 -0
  79. package/dist/declarations/src/utils/does-file-exist.d.ts +2 -0
  80. package/dist/declarations/src/utils/get-config-diff.d.ts +3 -0
  81. package/dist/declarations/src/utils/graphql-requests.d.ts +172 -0
  82. package/dist/declarations/src/utils/i18n-message-complilation.d.ts +4 -0
  83. package/dist/declarations/src/utils/user-agent.d.ts +2 -0
  84. package/dist/declarations/src/version.d.ts +2 -0
  85. package/dist/declarations/src/vite-plugins/vite-plugin-dynamic-base-assets-globals.d.ts +3 -0
  86. package/dist/declarations/src/vite-plugins/vite-plugin-i18n-message-compilation.d.ts +3 -0
  87. package/dist/declarations/src/vite-plugins/vite-plugin-merchant-center-customization.d.ts +4 -0
  88. package/dist/declarations/src/vite-plugins/vite-plugin-svgr.d.ts +3 -0
  89. package/dist/declarations/src/webpack-loaders/i18n-message-compilation-loader.d.ts +3 -0
  90. package/dist/declarations/src/webpack-plugins/final-stats-writer-plugin.d.ts +12 -0
  91. package/dist/declarations/src/webpack-plugins/local-html-webpack-plugin.d.ts +5 -0
  92. package/dist/declarations/src/webpack.d.ts +2 -0
  93. package/dist/deployment-previews-set-173d8491.cjs.dev.js +203 -0
  94. package/dist/deployment-previews-set-923f79de.esm.js +192 -0
  95. package/dist/deployment-previews-set-f451242a.cjs.prod.js +203 -0
  96. package/dist/does-file-exist-32618334.esm.js +12 -0
  97. package/dist/does-file-exist-be53305d.cjs.prod.js +18 -0
  98. package/dist/does-file-exist-eb86baca.cjs.dev.js +18 -0
  99. package/dist/graphql-requests-0e427050.esm.js +243 -0
  100. package/dist/graphql-requests-733aac06.cjs.dev.js +266 -0
  101. package/dist/graphql-requests-db54706e.cjs.prod.js +266 -0
  102. package/dist/has-jsx-runtime-aa5d21ee.cjs.dev.js +15 -0
  103. package/dist/has-jsx-runtime-c3202df5.cjs.prod.js +15 -0
  104. package/dist/has-jsx-runtime-e3ecb09b.esm.js +13 -0
  105. package/dist/i18n-message-complilation-21d3b0aa.esm.js +15 -0
  106. package/dist/i18n-message-complilation-7311cb29.cjs.dev.js +23 -0
  107. package/dist/i18n-message-complilation-7762da61.cjs.prod.js +23 -0
  108. package/dist/login-35f578e3.esm.js +86 -0
  109. package/dist/login-65c78b83.cjs.dev.js +103 -0
  110. package/dist/login-c616d769.cjs.prod.js +103 -0
  111. package/dist/optimizations-7789145e.cjs.dev.js +85 -0
  112. package/dist/optimizations-bf991634.esm.js +67 -0
  113. package/dist/optimizations-fb93514f.cjs.prod.js +85 -0
  114. package/dist/package-436331e6.cjs.dev.js +151 -0
  115. package/dist/package-a7096308.cjs.prod.js +151 -0
  116. package/dist/package-b2f2b4e5.esm.js +149 -0
  117. package/dist/paths-39f22b8b.esm.js +36 -0
  118. package/dist/paths-7768b440.cjs.prod.js +44 -0
  119. package/dist/paths-b76fc753.cjs.dev.js +44 -0
  120. package/dist/serve-5666b16a.cjs.prod.js +48 -0
  121. package/dist/serve-6a951584.esm.js +41 -0
  122. package/dist/serve-f898c45e.cjs.dev.js +48 -0
  123. package/dist/start-4e79e08f.esm.js +164 -0
  124. package/dist/start-569eb0f9.cjs.dev.js +177 -0
  125. package/dist/start-b0765c9a.cjs.prod.js +177 -0
  126. package/dist/start-vite-45bfc42f.esm.js +110 -0
  127. package/dist/start-vite-a68e1b9f.cjs.prod.js +122 -0
  128. package/dist/start-vite-a787f80d.cjs.dev.js +122 -0
  129. package/dist/vendors-to-transpile-04a49d40.cjs.prod.js +5 -0
  130. package/dist/vendors-to-transpile-6ab4ea06.cjs.dev.js +5 -0
  131. package/dist/vendors-to-transpile-7dc84a72.esm.js +3 -0
  132. package/dist/vite-plugin-svgr-069f402d.esm.js +83 -0
  133. package/dist/vite-plugin-svgr-7fb42bbf.cjs.dev.js +108 -0
  134. package/dist/vite-plugin-svgr-b080c510.cjs.prod.js +108 -0
  135. package/package.json +147 -0
  136. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.d.ts +2 -0
  137. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.d.ts.map +1 -0
  138. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +12 -0
  139. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.js +7 -0
  140. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +12 -0
  141. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +4 -0
  142. package/postcss/package.json +4 -0
  143. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.d.ts +2 -0
  144. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.d.ts.map +1 -0
  145. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +57 -0
  146. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.js +7 -0
  147. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +57 -0
  148. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +48 -0
  149. package/webpack/package.json +4 -0
  150. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.d.ts +3 -0
  151. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.d.ts.map +1 -0
  152. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +30 -0
  153. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.js +7 -0
  154. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +30 -0
  155. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +26 -0
  156. package/webpack-loaders/i18n-message-compilation-loader/package.json +4 -0
@@ -0,0 +1,149 @@
1
+ var pkgJson = {
2
+ name: "@commercetools-frontend/mc-scripts",
3
+ version: "22.35.1",
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/merchant-center-customizations",
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
+ "./webpack-loaders/i18n-message-compilation-loader.ts"
32
+ ]
33
+ },
34
+ files: [
35
+ "bin",
36
+ "cli",
37
+ "dist",
38
+ "config",
39
+ "application-runtime",
40
+ "postcss",
41
+ "webpack",
42
+ "webpack-loaders",
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.22.17",
61
+ "@babel/runtime": "^7.22.15",
62
+ "@babel/runtime-corejs3": "^7.22.15",
63
+ "@commercetools-frontend/application-components": "22.35.1",
64
+ "@commercetools-frontend/application-config": "22.35.1",
65
+ "@commercetools-frontend/assets": "22.35.1",
66
+ "@commercetools-frontend/babel-preset-mc-app": "22.35.1",
67
+ "@commercetools-frontend/constants": "22.35.1",
68
+ "@commercetools-frontend/mc-dev-authentication": "22.35.1",
69
+ "@commercetools-frontend/mc-html-template": "22.35.1",
70
+ "@commercetools/http-user-agent": "3.0.0",
71
+ "@formatjs/cli-lib": "^6.3.8",
72
+ "@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
73
+ "@rollup/plugin-graphql": "2.0.4",
74
+ "@rollup/pluginutils": "5.1.0",
75
+ "@svgr/babel-preset": "^6.5.1",
76
+ "@svgr/core": "^6.5.1",
77
+ "@svgr/webpack": "^6.5.1",
78
+ "@types/prompts": "^2.4.4",
79
+ "@types/svgo": "^2.6.4",
80
+ "@types/webpack-bundle-analyzer": "^4.6.0",
81
+ "@vitejs/plugin-react": "4.3.1",
82
+ "@vitejs/plugin-react-swc": "3.7.0",
83
+ autoprefixer: "^10.4.15",
84
+ "babel-loader": "8.3.0",
85
+ browserslist: "^4.21.10",
86
+ cac: "6.7.14",
87
+ chalk: "4.1.2",
88
+ "core-js": "^3.32.2",
89
+ "css-loader": "6.11.0",
90
+ "css-minimizer-webpack-plugin": "3.4.1",
91
+ dotenv: "16.4.5",
92
+ "dotenv-expand": "8.0.3",
93
+ "fs-extra": "10.1.0",
94
+ graphql: "16.8.2",
95
+ "graphql-request": "5.2.0",
96
+ "graphql-tag": "^2.12.6",
97
+ "html-webpack-plugin": "5.6.0",
98
+ "json-loader": "0.5.7",
99
+ lodash: "4.17.21",
100
+ "mini-css-extract-plugin": "2.9.0",
101
+ moment: "^2.29.4",
102
+ "moment-locales-webpack-plugin": "1.2.0",
103
+ "node-fetch": "2.7.0",
104
+ postcss: "8.4.38",
105
+ "postcss-custom-media": "8.0.2",
106
+ "postcss-custom-properties": "12.1.4",
107
+ "postcss-import": "14.1.0",
108
+ "postcss-loader": "6.2.1",
109
+ "postcss-reporter": "7.1.0",
110
+ prettier: "2.8.8",
111
+ prompts: "^2.4.2",
112
+ "querystring-es3": "^0.2.1",
113
+ "react-dev-utils": "12.0.1",
114
+ "react-refresh": "0.14.2",
115
+ "rollup-plugin-visualizer": "^5.12.0",
116
+ "serve-handler": "6.1.5",
117
+ shelljs: "0.8.5",
118
+ "style-loader": "3.3.4",
119
+ "svg-url-loader": "7.1.1",
120
+ "terser-webpack-plugin": "5.3.10",
121
+ "thread-loader": "3.0.4",
122
+ url: "^0.11.0",
123
+ vite: "~4.5.3",
124
+ "vite-bundle-analyzer": "0.12.1",
125
+ webpack: "5.94.0",
126
+ "webpack-bundle-analyzer": "4.10.2",
127
+ "webpack-dev-server": "4.15.2",
128
+ webpackbar: "5.0.2"
129
+ },
130
+ devDependencies: {
131
+ "@commercetools-test-data/custom-view": "^8.0.0",
132
+ "@tsconfig/node16": "^16.1.1",
133
+ "@types/fs-extra": "^11.0.1",
134
+ "@types/lodash": "^4.14.198",
135
+ "@types/mock-fs": "^4.13.1",
136
+ "@types/moment-locales-webpack-plugin": "^1.2.3",
137
+ "@types/node-fetch": "2.6.11",
138
+ "@types/serve-handler": "^6.1.1",
139
+ memfs: "^4.8.2",
140
+ "mock-fs": "^5.2.0",
141
+ msw: "0.49.3",
142
+ rimraf: "5.0.7"
143
+ },
144
+ engines: {
145
+ node: "16.x || >=18.0.0"
146
+ }
147
+ };
148
+
149
+ export { pkgJson as p };
@@ -0,0 +1,36 @@
1
+ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import { d as doesFileExist } from './does-file-exist-32618334.esm.js';
5
+
6
+ const moduleFileExtensions = ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx'];
7
+
8
+ // Make sure any symlinks in the project folder are resolved:
9
+ // https://github.com/facebook/create-react-app/issues/637
10
+ const appDirectory = fs.realpathSync(process.cwd());
11
+ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
12
+
13
+ // Resolve file paths in the order given
14
+ const resolveModule = (resolveFn, filePath) => {
15
+ const extension = _findInstanceProperty(moduleFileExtensions).call(moduleFileExtensions, extension => doesFileExist(resolveFn(`${filePath}.${extension}`)));
16
+ if (extension) {
17
+ return resolveFn(`${filePath}.${extension}`);
18
+ }
19
+ return resolveFn(`${filePath}.js`);
20
+ };
21
+
22
+ // Resolve the absolute path of the caller location. This is necessary
23
+ // to point to files within that folder.
24
+ const paths = {
25
+ appPackageJson: resolveApp('package.json'),
26
+ appBuild: resolveApp('public'),
27
+ appIndexHtmlTemplate: resolveApp('public/index.html.template'),
28
+ appIndexHtml: resolveApp('public/index.html'),
29
+ appWebpackConfig: resolveModule(resolveApp, `webpack.config.${process.env.NODE_ENV === 'production' ? 'prod' : 'dev'}`),
30
+ yarnLockFile: resolveApp('yarn.lock'),
31
+ appRoot: resolveApp('.'),
32
+ entryPoint: resolveModule(resolveApp, 'src/index'),
33
+ sourceFolders: [resolveApp('src')]
34
+ };
35
+
36
+ export { paths as p };
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
4
+ var fs = require('fs');
5
+ var path = require('path');
6
+ var doesFileExist = require('./does-file-exist-be53305d.cjs.prod.js');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
9
+
10
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
11
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
12
+ var path__default = /*#__PURE__*/_interopDefault(path);
13
+
14
+ const moduleFileExtensions = ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx'];
15
+
16
+ // Make sure any symlinks in the project folder are resolved:
17
+ // https://github.com/facebook/create-react-app/issues/637
18
+ const appDirectory = fs__default["default"].realpathSync(process.cwd());
19
+ const resolveApp = relativePath => path__default["default"].resolve(appDirectory, relativePath);
20
+
21
+ // Resolve file paths in the order given
22
+ const resolveModule = (resolveFn, filePath) => {
23
+ const extension = _findInstanceProperty__default["default"](moduleFileExtensions).call(moduleFileExtensions, extension => doesFileExist.doesFileExist(resolveFn(`${filePath}.${extension}`)));
24
+ if (extension) {
25
+ return resolveFn(`${filePath}.${extension}`);
26
+ }
27
+ return resolveFn(`${filePath}.js`);
28
+ };
29
+
30
+ // Resolve the absolute path of the caller location. This is necessary
31
+ // to point to files within that folder.
32
+ const paths = {
33
+ appPackageJson: resolveApp('package.json'),
34
+ appBuild: resolveApp('public'),
35
+ appIndexHtmlTemplate: resolveApp('public/index.html.template'),
36
+ appIndexHtml: resolveApp('public/index.html'),
37
+ appWebpackConfig: resolveModule(resolveApp, `webpack.config.${'prod' }`),
38
+ yarnLockFile: resolveApp('yarn.lock'),
39
+ appRoot: resolveApp('.'),
40
+ entryPoint: resolveModule(resolveApp, 'src/index'),
41
+ sourceFolders: [resolveApp('src')]
42
+ };
43
+
44
+ exports.paths = paths;
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
4
+ var fs = require('fs');
5
+ var path = require('path');
6
+ var doesFileExist = require('./does-file-exist-eb86baca.cjs.dev.js');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
9
+
10
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
11
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
12
+ var path__default = /*#__PURE__*/_interopDefault(path);
13
+
14
+ const moduleFileExtensions = ['js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx'];
15
+
16
+ // Make sure any symlinks in the project folder are resolved:
17
+ // https://github.com/facebook/create-react-app/issues/637
18
+ const appDirectory = fs__default["default"].realpathSync(process.cwd());
19
+ const resolveApp = relativePath => path__default["default"].resolve(appDirectory, relativePath);
20
+
21
+ // Resolve file paths in the order given
22
+ const resolveModule = (resolveFn, filePath) => {
23
+ const extension = _findInstanceProperty__default["default"](moduleFileExtensions).call(moduleFileExtensions, extension => doesFileExist.doesFileExist(resolveFn(`${filePath}.${extension}`)));
24
+ if (extension) {
25
+ return resolveFn(`${filePath}.${extension}`);
26
+ }
27
+ return resolveFn(`${filePath}.js`);
28
+ };
29
+
30
+ // Resolve the absolute path of the caller location. This is necessary
31
+ // to point to files within that folder.
32
+ const paths = {
33
+ appPackageJson: resolveApp('package.json'),
34
+ appBuild: resolveApp('public'),
35
+ appIndexHtmlTemplate: resolveApp('public/index.html.template'),
36
+ appIndexHtml: resolveApp('public/index.html'),
37
+ appWebpackConfig: resolveModule(resolveApp, `webpack.config.${process.env.NODE_ENV === 'production' ? 'prod' : 'dev'}`),
38
+ yarnLockFile: resolveApp('yarn.lock'),
39
+ appRoot: resolveApp('.'),
40
+ entryPoint: resolveModule(resolveApp, 'src/index'),
41
+ sourceFolders: [resolveApp('src')]
42
+ };
43
+
44
+ exports.paths = paths;
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ var http = require('http');
4
+ var serveHandler = require('serve-handler');
5
+ var paths = require('./paths-7768b440.cjs.prod.js');
6
+ require('@babel/runtime-corejs3/core-js-stable/instance/find');
7
+ require('fs');
8
+ require('path');
9
+ require('./does-file-exist-be53305d.cjs.prod.js');
10
+ require('node:fs');
11
+
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
13
+
14
+ var http__default = /*#__PURE__*/_interopDefault(http);
15
+ var serveHandler__default = /*#__PURE__*/_interopDefault(serveHandler);
16
+
17
+ const port = 3001;
18
+ async function run() {
19
+ const server = http__default["default"].createServer((request, response) => {
20
+ // You pass two more arguments for config and middleware
21
+ // More details here: https://github.com/vercel/serve-handler#options
22
+ return serveHandler__default["default"](request, response, {
23
+ public: paths.paths.appBuild,
24
+ rewrites: [{
25
+ source: '/favicon*',
26
+ destination: '/favicon.png'
27
+ }, {
28
+ source: '/login*',
29
+ destination: '/login.html'
30
+ }, {
31
+ source: '/logout',
32
+ destination: '/logout.html'
33
+ }, {
34
+ // Match all routes except for the login, logout, and favicon routes.
35
+ // NOTE: this complex glob pattern would not be necessary if the rewrite
36
+ // implementation would stop at the first match.
37
+ // See https://github.com/vercel/serve-handler/issues/71
38
+ source: '{/!(favicon|login|logout)*/**,/!(favicon|login|logout)*}',
39
+ destination: '/index.html'
40
+ }]
41
+ });
42
+ });
43
+ server.listen(port, () => {
44
+ console.log(`Running at http://localhost:${port}`);
45
+ });
46
+ }
47
+
48
+ exports["default"] = run;
@@ -0,0 +1,41 @@
1
+ import http from 'http';
2
+ import serveHandler from 'serve-handler';
3
+ import { p as paths } from './paths-39f22b8b.esm.js';
4
+ import '@babel/runtime-corejs3/core-js-stable/instance/find';
5
+ import 'fs';
6
+ import 'path';
7
+ import './does-file-exist-32618334.esm.js';
8
+ import 'node:fs';
9
+
10
+ const port = 3001;
11
+ async function run() {
12
+ const server = http.createServer((request, response) => {
13
+ // You pass two more arguments for config and middleware
14
+ // More details here: https://github.com/vercel/serve-handler#options
15
+ return serveHandler(request, response, {
16
+ public: paths.appBuild,
17
+ rewrites: [{
18
+ source: '/favicon*',
19
+ destination: '/favicon.png'
20
+ }, {
21
+ source: '/login*',
22
+ destination: '/login.html'
23
+ }, {
24
+ source: '/logout',
25
+ destination: '/logout.html'
26
+ }, {
27
+ // Match all routes except for the login, logout, and favicon routes.
28
+ // NOTE: this complex glob pattern would not be necessary if the rewrite
29
+ // implementation would stop at the first match.
30
+ // See https://github.com/vercel/serve-handler/issues/71
31
+ source: '{/!(favicon|login|logout)*/**,/!(favicon|login|logout)*}',
32
+ destination: '/index.html'
33
+ }]
34
+ });
35
+ });
36
+ server.listen(port, () => {
37
+ console.log(`Running at http://localhost:${port}`);
38
+ });
39
+ }
40
+
41
+ export { run as default };
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ var http = require('http');
4
+ var serveHandler = require('serve-handler');
5
+ var paths = require('./paths-b76fc753.cjs.dev.js');
6
+ require('@babel/runtime-corejs3/core-js-stable/instance/find');
7
+ require('fs');
8
+ require('path');
9
+ require('./does-file-exist-eb86baca.cjs.dev.js');
10
+ require('node:fs');
11
+
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
13
+
14
+ var http__default = /*#__PURE__*/_interopDefault(http);
15
+ var serveHandler__default = /*#__PURE__*/_interopDefault(serveHandler);
16
+
17
+ const port = 3001;
18
+ async function run() {
19
+ const server = http__default["default"].createServer((request, response) => {
20
+ // You pass two more arguments for config and middleware
21
+ // More details here: https://github.com/vercel/serve-handler#options
22
+ return serveHandler__default["default"](request, response, {
23
+ public: paths.paths.appBuild,
24
+ rewrites: [{
25
+ source: '/favicon*',
26
+ destination: '/favicon.png'
27
+ }, {
28
+ source: '/login*',
29
+ destination: '/login.html'
30
+ }, {
31
+ source: '/logout',
32
+ destination: '/logout.html'
33
+ }, {
34
+ // Match all routes except for the login, logout, and favicon routes.
35
+ // NOTE: this complex glob pattern would not be necessary if the rewrite
36
+ // implementation would stop at the first match.
37
+ // See https://github.com/vercel/serve-handler/issues/71
38
+ source: '{/!(favicon|login|logout)*/**,/!(favicon|login|logout)*}',
39
+ destination: '/index.html'
40
+ }]
41
+ });
42
+ });
43
+ server.listen(port, () => {
44
+ console.log(`Running at http://localhost:${port}`);
45
+ });
46
+ }
47
+
48
+ exports["default"] = run;
@@ -0,0 +1,164 @@
1
+ import _parseInt from '@babel/runtime-corejs3/core-js-stable/parse-int';
2
+ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
3
+ import chalk from 'chalk';
4
+ import checkRequiredFiles from 'react-dev-utils/checkRequiredFiles';
5
+ import clearConsole from 'react-dev-utils/clearConsole';
6
+ import openBrowser from 'react-dev-utils/openBrowser';
7
+ import { choosePort, prepareUrls, createCompiler } from 'react-dev-utils/WebpackDevServerUtils';
8
+ import webpack from 'webpack';
9
+ import WebpackDevServer from 'webpack-dev-server';
10
+ import { c as createWebpackConfigForDevelopment } from './create-webpack-config-for-development-86baace3.esm.js';
11
+ import { p as paths } from './paths-39f22b8b.esm.js';
12
+ import { processConfig } from '@commercetools-frontend/application-config';
13
+ import { createMcDevAuthenticationMiddleware } from '@commercetools-frontend/mc-dev-authentication';
14
+ import { processHeaders } from '@commercetools-frontend/mc-html-template';
15
+ import { d as doesFileExist } from './does-file-exist-32618334.esm.js';
16
+ import '@babel/runtime-corejs3/core-js-stable/object/keys';
17
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
18
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
19
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
20
+ import '@babel/runtime-corejs3/core-js-stable/object/define-properties';
21
+ import '@babel/runtime-corejs3/core-js-stable/object/define-property';
22
+ import '@babel/runtime-corejs3/helpers/defineProperty';
23
+ import '@babel/runtime-corejs3/core-js-stable/instance/map';
24
+ import '@babel/runtime-corejs3/core-js-stable/instance/filter';
25
+ import '@babel/runtime-corejs3/core-js-stable/json/stringify';
26
+ import '@babel/runtime-corejs3/core-js-stable/instance/ends-with';
27
+ import '@babel/runtime-corejs3/core-js-stable/instance/concat';
28
+ import 'crypto';
29
+ import 'path';
30
+ import '@pmmmwh/react-refresh-webpack-plugin';
31
+ import 'html-webpack-plugin';
32
+ import 'moment-locales-webpack-plugin';
33
+ import 'webpackbar';
34
+ import '@babel/runtime-corejs3/helpers/classCallCheck';
35
+ import '@babel/runtime-corejs3/helpers/createClass';
36
+ import '@babel/runtime-corejs3/core-js-stable/object/assign';
37
+ import './create-postcss-config-2f709335.esm.js';
38
+ import '@babel/runtime-corejs3/helpers/slicedToArray';
39
+ import './package-b2f2b4e5.esm.js';
40
+ import './has-jsx-runtime-e3ecb09b.esm.js';
41
+ import './optimizations-bf991634.esm.js';
42
+ import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
43
+ import '@babel/runtime-corejs3/core-js-stable/object/entries';
44
+ import '@babel/runtime-corejs3/core-js-stable/instance/includes';
45
+ import './vendors-to-transpile-7dc84a72.esm.js';
46
+ import '@babel/runtime-corejs3/core-js-stable/instance/find';
47
+ import 'fs';
48
+ import 'node:fs';
49
+
50
+ const host = process.env.HOST || '0.0.0.0';
51
+ // We support configuring the sockjs pathname during development.
52
+ // These settings let a developer run multiple simultaneous projects.
53
+ // They are used as the connection `hostname`, `pathname` and `port`
54
+ // in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
55
+ // and `sockPort` options in webpack-dev-server.
56
+ const sockHost = process.env.WDS_SOCKET_HOST;
57
+ const sockPath = process.env.WDS_SOCKET_PATH; // default: '/ws'
58
+ const sockPort = process.env.WDS_SOCKET_PORT;
59
+ const createWebpackDevServerConfig = _ref => {
60
+ let port = _ref.port,
61
+ publicPath = _ref.publicPath;
62
+ const applicationConfig = processConfig();
63
+ const compiledHeaders = processHeaders(applicationConfig);
64
+ return {
65
+ client: {
66
+ overlay: false,
67
+ webSocketURL: {
68
+ hostname: sockHost,
69
+ pathname: sockPath,
70
+ port: sockPort
71
+ }
72
+ },
73
+ // Enable gzip compression of generated files.
74
+ compress: true,
75
+ devMiddleware: {
76
+ // It is important to tell WebpackDevServer to use the same "publicPath" path as
77
+ // we specified in the webpack config. When homepage is '.', default to serving
78
+ // from the root.
79
+ publicPath
80
+ },
81
+ headers: compiledHeaders,
82
+ historyApiFallback: {
83
+ // Paths with dots should still use the history fallback.
84
+ // See https://github.com/facebookincubator/create-react-app/issues/387.
85
+ disableDotRule: true,
86
+ index: publicPath
87
+ },
88
+ host,
89
+ hot: true,
90
+ https: false,
91
+ port,
92
+ setupMiddlewares(middlewares, devServer) {
93
+ if (!devServer) {
94
+ throw new Error('webpack-dev-server is not defined');
95
+ }
96
+ devServer.app?.use(createMcDevAuthenticationMiddleware(applicationConfig));
97
+ return middlewares;
98
+ }
99
+ };
100
+ };
101
+
102
+ async function run() {
103
+ var _context;
104
+ const useYarn = doesFileExist(paths.yarnLockFile);
105
+ const isInteractive = process.stdout.isTTY;
106
+
107
+ // Whether or not `react-refresh` is enabled, `react-refresh` is not 100% stable at this time,
108
+ // which is why it's disabled by default.
109
+
110
+ const hasWebpackConfig = doesFileExist(paths.appWebpackConfig);
111
+
112
+ // Warn and crash if required files are missing
113
+ if (!checkRequiredFiles([])) {
114
+ process.exit(1);
115
+ }
116
+
117
+ // Tools like Cloud9 rely on this.
118
+ const DEFAULT_PORT = _parseInt(String(process.env.HTTP_PORT), 10) || 3001;
119
+ const HOST = process.env.HOST || '0.0.0.0';
120
+
121
+ // We attempt to use the default port but if it is busy, we offer the user to
122
+ // run on a different port. `detect()` Promise resolves to the next free port.
123
+ const port = await choosePort(HOST, DEFAULT_PORT);
124
+ if (port == null) {
125
+ console.warn('Could not find a free port. Aborting.');
126
+ // We have not found a port.
127
+ return;
128
+ }
129
+ const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
130
+ const appName = require(paths.appPackageJson).name;
131
+ const urls = prepareUrls(protocol, HOST, port);
132
+ // Get webpack config
133
+ const config = hasWebpackConfig ? require(paths.appWebpackConfig) : createWebpackConfigForDevelopment();
134
+
135
+ // Create a webpack compiler that is configured with custom messages.
136
+ const compiler = createCompiler({
137
+ appName,
138
+ config,
139
+ useYarn,
140
+ webpack,
141
+ urls
142
+ });
143
+
144
+ // Serve webpack assets generated by the compiler over a web sever.
145
+ const serverConfig = createWebpackDevServerConfig({
146
+ port,
147
+ publicPath: config.output?.publicPath
148
+ });
149
+ const devServer = new WebpackDevServer(serverConfig, compiler);
150
+ await devServer.start();
151
+ if (isInteractive) {
152
+ clearConsole();
153
+ }
154
+ console.log(chalk.cyan('Starting the development server...\n'));
155
+ openBrowser(urls.localUrlForBrowser);
156
+ _forEachInstanceProperty(_context = ['SIGINT', 'SIGTERM']).call(_context, sig => {
157
+ process.on(sig, () => {
158
+ devServer.close();
159
+ process.exit();
160
+ });
161
+ });
162
+ }
163
+
164
+ export { run as default };