@modern-js/utils 2.11.0 → 2.12.1-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{alias.js → cjs/alias.js} +4 -15
  3. package/dist/{analyzeProject.js → cjs/analyzeProject.js} +5 -25
  4. package/dist/{babel.js → cjs/babel.js} +9 -16
  5. package/dist/{commands.js → cjs/commands.js} +7 -2
  6. package/dist/{compatRequire.js → cjs/compatRequire.js} +4 -17
  7. package/dist/cjs/emptyDir.js +32 -0
  8. package/dist/{getEntryOptions.js → cjs/getEntryOptions.js} +1 -15
  9. package/dist/{getPackageManager.js → cjs/getPackageManager.js} +19 -41
  10. package/dist/{getPort.js → cjs/getPort.js} +4 -24
  11. package/dist/{getServerConfig.js → cjs/getServerConfig.js} +2 -22
  12. package/dist/{logger.js → cjs/logger.js} +5 -16
  13. package/dist/{monorepo.js → cjs/monorepo.js} +4 -15
  14. package/dist/cjs/nodeEnv.js +55 -0
  15. package/dist/{path.js → cjs/path.js} +1 -1
  16. package/dist/{pathSerializer.js → cjs/pathSerializer.js} +1 -1
  17. package/dist/{prettyInstructions.js → cjs/prettyInstructions.js} +13 -16
  18. package/dist/{react.js → cjs/react.js} +4 -15
  19. package/dist/{runtimeExports.js → cjs/runtimeExports.js} +1 -1
  20. package/dist/{universal → cjs/universal}/nestedRoutes.js +2 -19
  21. package/dist/cjs/version.js +59 -0
  22. package/dist/{watch.js → cjs/watch.js} +9 -29
  23. package/dist/esm/FileSizeReporter.js +180 -0
  24. package/dist/esm/alias.js +83 -0
  25. package/dist/esm/analyzeProject.js +168 -0
  26. package/dist/esm/applyOptionsChain.js +26 -0
  27. package/dist/esm/babel.js +169 -0
  28. package/dist/esm/chainId.js +92 -0
  29. package/dist/esm/clearConsole.js +6 -0
  30. package/dist/esm/commands.js +17 -0
  31. package/dist/esm/compatRequire.js +68 -0
  32. package/dist/esm/compiled.js +34 -0
  33. package/dist/esm/constants.js +317 -0
  34. package/dist/esm/debug.js +5 -0
  35. package/dist/esm/emptyDir.js +158 -0
  36. package/dist/esm/ensureAbsolutePath.js +5 -0
  37. package/dist/esm/ensureArray.js +9 -0
  38. package/dist/esm/findExists.js +27 -0
  39. package/dist/esm/generateMetaTags.js +40 -0
  40. package/dist/esm/getBrowserslist.js +12 -0
  41. package/dist/esm/getCoreJsVersion.js +57 -0
  42. package/dist/esm/getEntryOptions.js +45 -0
  43. package/dist/esm/getPackageManager.js +187 -0
  44. package/dist/esm/getPort.js +215 -0
  45. package/dist/esm/getServerConfig.js +145 -0
  46. package/dist/esm/getTargetDir.js +6 -0
  47. package/dist/esm/import.js +8 -0
  48. package/dist/esm/index.js +44 -0
  49. package/dist/esm/is/index.js +85 -0
  50. package/dist/esm/is/nodeEnv.js +16 -0
  51. package/dist/esm/is/platform.js +7 -0
  52. package/dist/esm/is/type.js +25 -0
  53. package/dist/esm/logger.js +207 -0
  54. package/dist/esm/monorepo.js +109 -0
  55. package/dist/esm/nodeEnv.js +258 -0
  56. package/dist/esm/path.js +85 -0
  57. package/dist/esm/pathSerializer.js +85 -0
  58. package/dist/esm/plugin.js +45 -0
  59. package/dist/esm/prettyInstructions.js +96 -0
  60. package/dist/esm/printBuildError.js +24 -0
  61. package/dist/esm/react.js +43 -0
  62. package/dist/esm/readTsConfig.js +10 -0
  63. package/dist/esm/removeSlash.js +10 -0
  64. package/dist/esm/resolve.js +42 -0
  65. package/dist/esm/routes.js +19 -0
  66. package/dist/esm/runtimeExports.js +65 -0
  67. package/dist/esm/ssr.js +3 -0
  68. package/dist/esm/storage.js +36 -0
  69. package/dist/esm/testUtils.js +13 -0
  70. package/dist/esm/types.js +1 -0
  71. package/dist/esm/universal/constants.js +3 -0
  72. package/dist/esm/universal/formatWebpack.js +108 -0
  73. package/dist/esm/universal/nestedRoutes.js +174 -0
  74. package/dist/esm/universal/remixRouter.js +1 -0
  75. package/dist/esm/universal/serialize.js +7 -0
  76. package/dist/esm/version.js +193 -0
  77. package/dist/esm/wait.js +7 -0
  78. package/dist/esm/watch.js +230 -0
  79. package/dist/esm-node/FileSizeReporter.js +133 -0
  80. package/dist/esm-node/alias.js +61 -0
  81. package/dist/esm-node/analyzeProject.js +17 -0
  82. package/dist/esm-node/applyOptionsChain.js +35 -0
  83. package/dist/esm-node/babel.js +105 -0
  84. package/dist/esm-node/chainId.js +173 -0
  85. package/dist/esm-node/clearConsole.js +8 -0
  86. package/dist/esm-node/commands.js +22 -0
  87. package/dist/esm-node/compatRequire.js +42 -0
  88. package/dist/esm-node/compiled.js +77 -0
  89. package/dist/esm-node/constants.js +264 -0
  90. package/dist/esm-node/debug.js +5 -0
  91. package/dist/esm-node/emptyDir.js +9 -0
  92. package/dist/esm-node/ensureAbsolutePath.js +5 -0
  93. package/dist/esm-node/ensureArray.js +9 -0
  94. package/dist/esm-node/findExists.js +12 -0
  95. package/dist/esm-node/generateMetaTags.js +38 -0
  96. package/dist/esm-node/getBrowserslist.js +7 -0
  97. package/dist/esm-node/getCoreJsVersion.js +13 -0
  98. package/dist/esm-node/getEntryOptions.js +17 -0
  99. package/dist/esm-node/getPackageManager.js +32 -0
  100. package/dist/esm-node/getPort.js +59 -0
  101. package/dist/esm-node/getServerConfig.js +14 -0
  102. package/dist/esm-node/getTargetDir.js +8 -0
  103. package/dist/esm-node/import.js +9 -0
  104. package/dist/esm-node/index.js +44 -0
  105. package/dist/esm-node/is/index.js +71 -0
  106. package/dist/esm-node/is/nodeEnv.js +12 -0
  107. package/dist/esm-node/is/platform.js +6 -0
  108. package/dist/esm-node/is/type.js +34 -0
  109. package/dist/esm-node/logger.js +100 -0
  110. package/dist/esm-node/monorepo.js +87 -0
  111. package/dist/esm-node/nodeEnv.js +30 -0
  112. package/dist/esm-node/path.js +50 -0
  113. package/dist/esm-node/pathSerializer.js +46 -0
  114. package/dist/esm-node/plugin.js +23 -0
  115. package/dist/esm-node/prettyInstructions.js +77 -0
  116. package/dist/esm-node/printBuildError.js +34 -0
  117. package/dist/esm-node/react.js +20 -0
  118. package/dist/esm-node/readTsConfig.js +13 -0
  119. package/dist/esm-node/removeSlash.js +8 -0
  120. package/dist/esm-node/resolve.js +38 -0
  121. package/dist/esm-node/routes.js +24 -0
  122. package/dist/esm-node/runtimeExports.js +40 -0
  123. package/dist/esm-node/ssr.js +6 -0
  124. package/dist/esm-node/storage.js +42 -0
  125. package/dist/esm-node/testUtils.js +15 -0
  126. package/dist/esm-node/types.js +0 -0
  127. package/dist/esm-node/universal/constants.js +6 -0
  128. package/dist/esm-node/universal/formatWebpack.js +77 -0
  129. package/dist/esm-node/universal/nestedRoutes.js +93 -0
  130. package/dist/esm-node/universal/remixRouter.js +1 -0
  131. package/dist/esm-node/universal/serialize.js +7 -0
  132. package/dist/esm-node/version.js +25 -0
  133. package/dist/esm-node/wait.js +6 -0
  134. package/dist/esm-node/watch.js +36 -0
  135. package/dist/types/commands.d.ts +4 -0
  136. package/dist/{prettyInstructions.d.ts → types/prettyInstructions.d.ts} +4 -3
  137. package/package.json +4 -4
  138. package/dist/commands.d.ts +0 -3
  139. package/dist/emptyDir.js +0 -52
  140. package/dist/nodeEnv.js +0 -81
  141. package/dist/version.js +0 -92
  142. /package/dist/{FileSizeReporter.js → cjs/FileSizeReporter.js} +0 -0
  143. /package/dist/{applyOptionsChain.js → cjs/applyOptionsChain.js} +0 -0
  144. /package/dist/{chainId.js → cjs/chainId.js} +0 -0
  145. /package/dist/{clearConsole.js → cjs/clearConsole.js} +0 -0
  146. /package/dist/{compiled.js → cjs/compiled.js} +0 -0
  147. /package/dist/{constants.js → cjs/constants.js} +0 -0
  148. /package/dist/{debug.js → cjs/debug.js} +0 -0
  149. /package/dist/{ensureAbsolutePath.js → cjs/ensureAbsolutePath.js} +0 -0
  150. /package/dist/{ensureArray.js → cjs/ensureArray.js} +0 -0
  151. /package/dist/{findExists.js → cjs/findExists.js} +0 -0
  152. /package/dist/{generateMetaTags.js → cjs/generateMetaTags.js} +0 -0
  153. /package/dist/{getBrowserslist.js → cjs/getBrowserslist.js} +0 -0
  154. /package/dist/{getCoreJsVersion.js → cjs/getCoreJsVersion.js} +0 -0
  155. /package/dist/{getTargetDir.js → cjs/getTargetDir.js} +0 -0
  156. /package/dist/{import.js → cjs/import.js} +0 -0
  157. /package/dist/{index.js → cjs/index.js} +0 -0
  158. /package/dist/{is → cjs/is}/index.js +0 -0
  159. /package/dist/{is → cjs/is}/nodeEnv.js +0 -0
  160. /package/dist/{is → cjs/is}/platform.js +0 -0
  161. /package/dist/{is → cjs/is}/type.js +0 -0
  162. /package/dist/{plugin.js → cjs/plugin.js} +0 -0
  163. /package/dist/{printBuildError.js → cjs/printBuildError.js} +0 -0
  164. /package/dist/{readTsConfig.js → cjs/readTsConfig.js} +0 -0
  165. /package/dist/{removeSlash.js → cjs/removeSlash.js} +0 -0
  166. /package/dist/{resolve.js → cjs/resolve.js} +0 -0
  167. /package/dist/{routes.js → cjs/routes.js} +0 -0
  168. /package/dist/{ssr.js → cjs/ssr.js} +0 -0
  169. /package/dist/{storage.js → cjs/storage.js} +0 -0
  170. /package/dist/{testUtils.js → cjs/testUtils.js} +0 -0
  171. /package/dist/{types.js → cjs/types.js} +0 -0
  172. /package/dist/{universal → cjs/universal}/constants.js +0 -0
  173. /package/dist/{universal → cjs/universal}/formatWebpack.js +0 -0
  174. /package/dist/{universal → cjs/universal}/remixRouter.js +0 -0
  175. /package/dist/{universal → cjs/universal}/serialize.js +0 -0
  176. /package/dist/{wait.js → cjs/wait.js} +0 -0
  177. /package/dist/{FileSizeReporter.d.ts → types/FileSizeReporter.d.ts} +0 -0
  178. /package/dist/{alias.d.ts → types/alias.d.ts} +0 -0
  179. /package/dist/{analyzeProject.d.ts → types/analyzeProject.d.ts} +0 -0
  180. /package/dist/{applyOptionsChain.d.ts → types/applyOptionsChain.d.ts} +0 -0
  181. /package/dist/{babel.d.ts → types/babel.d.ts} +0 -0
  182. /package/dist/{chainId.d.ts → types/chainId.d.ts} +0 -0
  183. /package/dist/{clearConsole.d.ts → types/clearConsole.d.ts} +0 -0
  184. /package/dist/{compatRequire.d.ts → types/compatRequire.d.ts} +0 -0
  185. /package/dist/{compiled.d.ts → types/compiled.d.ts} +0 -0
  186. /package/dist/{constants.d.ts → types/constants.d.ts} +0 -0
  187. /package/dist/{debug.d.ts → types/debug.d.ts} +0 -0
  188. /package/dist/{emptyDir.d.ts → types/emptyDir.d.ts} +0 -0
  189. /package/dist/{ensureAbsolutePath.d.ts → types/ensureAbsolutePath.d.ts} +0 -0
  190. /package/dist/{ensureArray.d.ts → types/ensureArray.d.ts} +0 -0
  191. /package/dist/{findExists.d.ts → types/findExists.d.ts} +0 -0
  192. /package/dist/{generateMetaTags.d.ts → types/generateMetaTags.d.ts} +0 -0
  193. /package/dist/{getBrowserslist.d.ts → types/getBrowserslist.d.ts} +0 -0
  194. /package/dist/{getCoreJsVersion.d.ts → types/getCoreJsVersion.d.ts} +0 -0
  195. /package/dist/{getEntryOptions.d.ts → types/getEntryOptions.d.ts} +0 -0
  196. /package/dist/{getPackageManager.d.ts → types/getPackageManager.d.ts} +0 -0
  197. /package/dist/{getPort.d.ts → types/getPort.d.ts} +0 -0
  198. /package/dist/{getServerConfig.d.ts → types/getServerConfig.d.ts} +0 -0
  199. /package/dist/{getTargetDir.d.ts → types/getTargetDir.d.ts} +0 -0
  200. /package/dist/{import.d.ts → types/import.d.ts} +0 -0
  201. /package/dist/{index.d.ts → types/index.d.ts} +0 -0
  202. /package/dist/{is → types/is}/index.d.ts +0 -0
  203. /package/dist/{is → types/is}/nodeEnv.d.ts +0 -0
  204. /package/dist/{is → types/is}/platform.d.ts +0 -0
  205. /package/dist/{is → types/is}/type.d.ts +0 -0
  206. /package/dist/{logger.d.ts → types/logger.d.ts} +0 -0
  207. /package/dist/{monorepo.d.ts → types/monorepo.d.ts} +0 -0
  208. /package/dist/{nodeEnv.d.ts → types/nodeEnv.d.ts} +0 -0
  209. /package/dist/{path.d.ts → types/path.d.ts} +0 -0
  210. /package/dist/{pathSerializer.d.ts → types/pathSerializer.d.ts} +0 -0
  211. /package/dist/{plugin.d.ts → types/plugin.d.ts} +0 -0
  212. /package/dist/{printBuildError.d.ts → types/printBuildError.d.ts} +0 -0
  213. /package/dist/{react.d.ts → types/react.d.ts} +0 -0
  214. /package/dist/{readTsConfig.d.ts → types/readTsConfig.d.ts} +0 -0
  215. /package/dist/{removeSlash.d.ts → types/removeSlash.d.ts} +0 -0
  216. /package/dist/{resolve.d.ts → types/resolve.d.ts} +0 -0
  217. /package/dist/{routes.d.ts → types/routes.d.ts} +0 -0
  218. /package/dist/{runtimeExports.d.ts → types/runtimeExports.d.ts} +0 -0
  219. /package/dist/{ssr.d.ts → types/ssr.d.ts} +0 -0
  220. /package/dist/{storage.d.ts → types/storage.d.ts} +0 -0
  221. /package/dist/{testUtils.d.ts → types/testUtils.d.ts} +0 -0
  222. /package/dist/{types.d.ts → types/types.d.ts} +0 -0
  223. /package/dist/{universal → types/universal}/constants.d.ts +0 -0
  224. /package/dist/{universal → types/universal}/formatWebpack.d.ts +0 -0
  225. /package/dist/{universal → types/universal}/nestedRoutes.d.ts +0 -0
  226. /package/dist/{universal → types/universal}/remixRouter.d.ts +0 -0
  227. /package/dist/{universal → types/universal}/serialize.d.ts +0 -0
  228. /package/dist/{version.d.ts → types/version.d.ts} +0 -0
  229. /package/dist/{wait.d.ts → types/wait.d.ts} +0 -0
  230. /package/dist/{watch.d.ts → types/watch.d.ts} +0 -0
package/dist/emptyDir.js DELETED
@@ -1,52 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var __async = (__this, __arguments, generator) => {
19
- return new Promise((resolve, reject) => {
20
- var fulfilled = (value) => {
21
- try {
22
- step(generator.next(value));
23
- } catch (e) {
24
- reject(e);
25
- }
26
- };
27
- var rejected = (value) => {
28
- try {
29
- step(generator.throw(value));
30
- } catch (e) {
31
- reject(e);
32
- }
33
- };
34
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35
- step((generator = generator.apply(__this, __arguments)).next());
36
- });
37
- };
38
- var emptyDir_exports = {};
39
- __export(emptyDir_exports, {
40
- emptyDir: () => emptyDir
41
- });
42
- module.exports = __toCommonJS(emptyDir_exports);
43
- var import_compiled = require("./compiled");
44
- const emptyDir = (dir) => __async(void 0, null, function* () {
45
- if (yield import_compiled.fs.pathExists(dir)) {
46
- yield import_compiled.fs.emptyDir(dir);
47
- }
48
- });
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- emptyDir
52
- });
package/dist/nodeEnv.js DELETED
@@ -1,81 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var __async = (__this, __arguments, generator) => {
19
- return new Promise((resolve, reject) => {
20
- var fulfilled = (value) => {
21
- try {
22
- step(generator.next(value));
23
- } catch (e) {
24
- reject(e);
25
- }
26
- };
27
- var rejected = (value) => {
28
- try {
29
- step(generator.throw(value));
30
- } catch (e) {
31
- reject(e);
32
- }
33
- };
34
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35
- step((generator = generator.apply(__this, __arguments)).next());
36
- });
37
- };
38
- var nodeEnv_exports = {};
39
- __export(nodeEnv_exports, {
40
- canUseNpm: () => canUseNpm,
41
- canUsePnpm: () => canUsePnpm,
42
- canUseYarn: () => canUseYarn
43
- });
44
- module.exports = __toCommonJS(nodeEnv_exports);
45
- var import_compiled = require("./compiled");
46
- function canUseNpm() {
47
- return __async(this, null, function* () {
48
- try {
49
- yield (0, import_compiled.execa)("npm", ["--version"], { env: process.env });
50
- return true;
51
- } catch (e) {
52
- return false;
53
- }
54
- });
55
- }
56
- function canUseYarn() {
57
- return __async(this, null, function* () {
58
- try {
59
- yield (0, import_compiled.execa)("yarn", ["--version"], { env: process.env });
60
- return true;
61
- } catch (e) {
62
- return false;
63
- }
64
- });
65
- }
66
- function canUsePnpm() {
67
- return __async(this, null, function* () {
68
- try {
69
- yield (0, import_compiled.execa)("pnpm", ["--version"], { env: process.env });
70
- return true;
71
- } catch (e) {
72
- return false;
73
- }
74
- });
75
- }
76
- // Annotate the CommonJS export names for ESM import in node:
77
- 0 && (module.exports = {
78
- canUseNpm,
79
- canUsePnpm,
80
- canUseYarn
81
- });
package/dist/version.js DELETED
@@ -1,92 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __export = (target, all) => {
22
- for (var name in all)
23
- __defProp(target, name, { get: all[name], enumerable: true });
24
- };
25
- var __copyProps = (to, from, except, desc) => {
26
- if (from && typeof from === "object" || typeof from === "function") {
27
- for (let key of __getOwnPropNames(from))
28
- if (!__hasOwnProp.call(to, key) && key !== except)
29
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
30
- }
31
- return to;
32
- };
33
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
34
- // If the importer is in node compatibility mode or this is not an ESM
35
- // file that has been converted to a CommonJS file using a Babel-
36
- // compatible transform (i.e. "__esModule" has not been set), then set
37
- // "default" to the CommonJS "module.exports" for node compatibility.
38
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
39
- mod
40
- ));
41
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
42
- var __async = (__this, __arguments, generator) => {
43
- return new Promise((resolve, reject) => {
44
- var fulfilled = (value) => {
45
- try {
46
- step(generator.next(value));
47
- } catch (e) {
48
- reject(e);
49
- }
50
- };
51
- var rejected = (value) => {
52
- try {
53
- step(generator.throw(value));
54
- } catch (e) {
55
- reject(e);
56
- }
57
- };
58
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
59
- step((generator = generator.apply(__this, __arguments)).next());
60
- });
61
- };
62
- var version_exports = {};
63
- __export(version_exports, {
64
- getPnpmVersion: () => getPnpmVersion,
65
- isReact18: () => isReact18
66
- });
67
- module.exports = __toCommonJS(version_exports);
68
- var import_path = __toESM(require("path"));
69
- var import_compiled = require("./compiled");
70
- function getPnpmVersion() {
71
- return __async(this, null, function* () {
72
- const { stdout } = yield (0, import_compiled.execa)("pnpm", ["--version"]);
73
- return stdout;
74
- });
75
- }
76
- const isReact18 = (cwd) => {
77
- const pkgPath = import_path.default.join(cwd, "package.json");
78
- if (!import_compiled.fs.existsSync(pkgPath)) {
79
- return false;
80
- }
81
- const pkgInfo = JSON.parse(import_compiled.fs.readFileSync(pkgPath, "utf8"));
82
- const deps = __spreadValues(__spreadValues({}, pkgInfo.devDependencies), pkgInfo.dependencies);
83
- if (typeof deps.react !== "string") {
84
- return false;
85
- }
86
- return import_compiled.semver.satisfies(import_compiled.semver.minVersion(deps.react), ">=18.0.0");
87
- };
88
- // Annotate the CommonJS export names for ESM import in node:
89
- 0 && (module.exports = {
90
- getPnpmVersion,
91
- isReact18
92
- });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes