@modern-js/utils 2.12.0 → 2.12.1-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. package/dist/{alias.js → cjs/alias.js} +4 -15
  2. package/dist/{analyzeProject.js → cjs/analyzeProject.js} +5 -25
  3. package/dist/{babel.js → cjs/babel.js} +9 -16
  4. package/dist/{compatRequire.js → cjs/compatRequire.js} +4 -17
  5. package/dist/{compiled.js → cjs/compiled.js} +3 -3
  6. package/dist/cjs/emptyDir.js +32 -0
  7. package/dist/{getEntryOptions.js → cjs/getEntryOptions.js} +1 -15
  8. package/dist/{getPackageManager.js → cjs/getPackageManager.js} +19 -41
  9. package/dist/{getPort.js → cjs/getPort.js} +4 -24
  10. package/dist/{getServerConfig.js → cjs/getServerConfig.js} +2 -22
  11. package/dist/{import.js → cjs/import.js} +1 -1
  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/{react.js → cjs/react.js} +4 -15
  18. package/dist/{runtimeExports.js → cjs/runtimeExports.js} +1 -1
  19. package/dist/{universal → cjs/universal}/nestedRoutes.js +2 -19
  20. package/dist/cjs/version.js +59 -0
  21. package/dist/{watch.js → cjs/watch.js} +9 -29
  22. package/dist/esm/FileSizeReporter.js +180 -0
  23. package/dist/esm/alias.js +83 -0
  24. package/dist/esm/analyzeProject.js +168 -0
  25. package/dist/esm/applyOptionsChain.js +26 -0
  26. package/dist/esm/babel.js +169 -0
  27. package/dist/esm/chainId.js +92 -0
  28. package/dist/esm/clearConsole.js +6 -0
  29. package/dist/esm/commands.js +17 -0
  30. package/dist/esm/compatRequire.js +68 -0
  31. package/dist/esm/compiled.js +34 -0
  32. package/dist/esm/constants.js +317 -0
  33. package/dist/esm/debug.js +5 -0
  34. package/dist/esm/emptyDir.js +158 -0
  35. package/dist/esm/ensureAbsolutePath.js +5 -0
  36. package/dist/esm/ensureArray.js +9 -0
  37. package/dist/esm/findExists.js +27 -0
  38. package/dist/esm/generateMetaTags.js +40 -0
  39. package/dist/esm/getBrowserslist.js +12 -0
  40. package/dist/esm/getCoreJsVersion.js +57 -0
  41. package/dist/esm/getEntryOptions.js +45 -0
  42. package/dist/esm/getPackageManager.js +187 -0
  43. package/dist/esm/getPort.js +215 -0
  44. package/dist/esm/getServerConfig.js +145 -0
  45. package/dist/esm/getTargetDir.js +6 -0
  46. package/dist/esm/import.js +8 -0
  47. package/dist/esm/index.js +44 -0
  48. package/dist/esm/is/index.js +85 -0
  49. package/dist/esm/is/nodeEnv.js +16 -0
  50. package/dist/esm/is/platform.js +7 -0
  51. package/dist/esm/is/type.js +25 -0
  52. package/dist/esm/logger.js +207 -0
  53. package/dist/esm/monorepo.js +109 -0
  54. package/dist/esm/nodeEnv.js +258 -0
  55. package/dist/esm/path.js +85 -0
  56. package/dist/esm/pathSerializer.js +85 -0
  57. package/dist/esm/plugin.js +45 -0
  58. package/dist/esm/prettyInstructions.js +96 -0
  59. package/dist/esm/printBuildError.js +24 -0
  60. package/dist/esm/react.js +43 -0
  61. package/dist/esm/readTsConfig.js +10 -0
  62. package/dist/esm/removeSlash.js +10 -0
  63. package/dist/esm/resolve.js +42 -0
  64. package/dist/esm/routes.js +19 -0
  65. package/dist/esm/runtimeExports.js +65 -0
  66. package/dist/esm/ssr.js +3 -0
  67. package/dist/esm/storage.js +36 -0
  68. package/dist/esm/testUtils.js +13 -0
  69. package/dist/esm/types.js +1 -0
  70. package/dist/esm/universal/constants.js +3 -0
  71. package/dist/esm/universal/formatWebpack.js +108 -0
  72. package/dist/esm/universal/nestedRoutes.js +174 -0
  73. package/dist/esm/universal/remixRouter.js +1 -0
  74. package/dist/esm/universal/serialize.js +7 -0
  75. package/dist/esm/version.js +193 -0
  76. package/dist/esm/wait.js +7 -0
  77. package/dist/esm/watch.js +230 -0
  78. package/dist/esm-node/FileSizeReporter.js +133 -0
  79. package/dist/esm-node/alias.js +61 -0
  80. package/dist/esm-node/analyzeProject.js +17 -0
  81. package/dist/esm-node/applyOptionsChain.js +35 -0
  82. package/dist/esm-node/babel.js +105 -0
  83. package/dist/esm-node/chainId.js +173 -0
  84. package/dist/esm-node/clearConsole.js +8 -0
  85. package/dist/esm-node/commands.js +22 -0
  86. package/dist/esm-node/compatRequire.js +42 -0
  87. package/dist/esm-node/compiled.js +77 -0
  88. package/dist/esm-node/constants.js +264 -0
  89. package/dist/esm-node/debug.js +5 -0
  90. package/dist/esm-node/emptyDir.js +9 -0
  91. package/dist/esm-node/ensureAbsolutePath.js +5 -0
  92. package/dist/esm-node/ensureArray.js +9 -0
  93. package/dist/esm-node/findExists.js +12 -0
  94. package/dist/esm-node/generateMetaTags.js +38 -0
  95. package/dist/esm-node/getBrowserslist.js +7 -0
  96. package/dist/esm-node/getCoreJsVersion.js +13 -0
  97. package/dist/esm-node/getEntryOptions.js +17 -0
  98. package/dist/esm-node/getPackageManager.js +32 -0
  99. package/dist/esm-node/getPort.js +59 -0
  100. package/dist/esm-node/getServerConfig.js +14 -0
  101. package/dist/esm-node/getTargetDir.js +8 -0
  102. package/dist/esm-node/import.js +9 -0
  103. package/dist/esm-node/index.js +44 -0
  104. package/dist/esm-node/is/index.js +71 -0
  105. package/dist/esm-node/is/nodeEnv.js +12 -0
  106. package/dist/esm-node/is/platform.js +6 -0
  107. package/dist/esm-node/is/type.js +34 -0
  108. package/dist/esm-node/logger.js +100 -0
  109. package/dist/esm-node/monorepo.js +87 -0
  110. package/dist/esm-node/nodeEnv.js +30 -0
  111. package/dist/esm-node/path.js +50 -0
  112. package/dist/esm-node/pathSerializer.js +46 -0
  113. package/dist/esm-node/plugin.js +23 -0
  114. package/dist/esm-node/prettyInstructions.js +77 -0
  115. package/dist/esm-node/printBuildError.js +34 -0
  116. package/dist/esm-node/react.js +20 -0
  117. package/dist/esm-node/readTsConfig.js +13 -0
  118. package/dist/esm-node/removeSlash.js +8 -0
  119. package/dist/esm-node/resolve.js +38 -0
  120. package/dist/esm-node/routes.js +24 -0
  121. package/dist/esm-node/runtimeExports.js +40 -0
  122. package/dist/esm-node/ssr.js +6 -0
  123. package/dist/esm-node/storage.js +42 -0
  124. package/dist/esm-node/testUtils.js +15 -0
  125. package/dist/esm-node/types.js +0 -0
  126. package/dist/esm-node/universal/constants.js +6 -0
  127. package/dist/esm-node/universal/formatWebpack.js +77 -0
  128. package/dist/esm-node/universal/nestedRoutes.js +93 -0
  129. package/dist/esm-node/universal/remixRouter.js +1 -0
  130. package/dist/esm-node/universal/serialize.js +7 -0
  131. package/dist/esm-node/version.js +25 -0
  132. package/dist/esm-node/wait.js +6 -0
  133. package/dist/esm-node/watch.js +36 -0
  134. package/dist/types/compiled.d.ts +43 -0
  135. package/dist/{debug.d.ts → types/debug.d.ts} +1 -1
  136. package/dist/{logger.d.ts → types/logger.d.ts} +1 -1
  137. package/package.json +53 -21
  138. package/dist/compiled.d.ts +0 -43
  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/{commands.js → cjs/commands.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/{index.js → cjs/index.js} +0 -0
  157. /package/dist/{is → cjs/is}/index.js +0 -0
  158. /package/dist/{is → cjs/is}/nodeEnv.js +0 -0
  159. /package/dist/{is → cjs/is}/platform.js +0 -0
  160. /package/dist/{is → cjs/is}/type.js +0 -0
  161. /package/dist/{plugin.js → cjs/plugin.js} +0 -0
  162. /package/dist/{prettyInstructions.js → cjs/prettyInstructions.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/{commands.d.ts → types/commands.d.ts} +0 -0
  185. /package/dist/{compatRequire.d.ts → types/compatRequire.d.ts} +0 -0
  186. /package/dist/{constants.d.ts → types/constants.d.ts} +0 -0
  187. /package/dist/{emptyDir.d.ts → types/emptyDir.d.ts} +0 -0
  188. /package/dist/{ensureAbsolutePath.d.ts → types/ensureAbsolutePath.d.ts} +0 -0
  189. /package/dist/{ensureArray.d.ts → types/ensureArray.d.ts} +0 -0
  190. /package/dist/{findExists.d.ts → types/findExists.d.ts} +0 -0
  191. /package/dist/{generateMetaTags.d.ts → types/generateMetaTags.d.ts} +0 -0
  192. /package/dist/{getBrowserslist.d.ts → types/getBrowserslist.d.ts} +0 -0
  193. /package/dist/{getCoreJsVersion.d.ts → types/getCoreJsVersion.d.ts} +0 -0
  194. /package/dist/{getEntryOptions.d.ts → types/getEntryOptions.d.ts} +0 -0
  195. /package/dist/{getPackageManager.d.ts → types/getPackageManager.d.ts} +0 -0
  196. /package/dist/{getPort.d.ts → types/getPort.d.ts} +0 -0
  197. /package/dist/{getServerConfig.d.ts → types/getServerConfig.d.ts} +0 -0
  198. /package/dist/{getTargetDir.d.ts → types/getTargetDir.d.ts} +0 -0
  199. /package/dist/{import.d.ts → types/import.d.ts} +0 -0
  200. /package/dist/{index.d.ts → types/index.d.ts} +0 -0
  201. /package/dist/{is → types/is}/index.d.ts +0 -0
  202. /package/dist/{is → types/is}/nodeEnv.d.ts +0 -0
  203. /package/dist/{is → types/is}/platform.d.ts +0 -0
  204. /package/dist/{is → types/is}/type.d.ts +0 -0
  205. /package/dist/{monorepo.d.ts → types/monorepo.d.ts} +0 -0
  206. /package/dist/{nodeEnv.d.ts → types/nodeEnv.d.ts} +0 -0
  207. /package/dist/{path.d.ts → types/path.d.ts} +0 -0
  208. /package/dist/{pathSerializer.d.ts → types/pathSerializer.d.ts} +0 -0
  209. /package/dist/{plugin.d.ts → types/plugin.d.ts} +0 -0
  210. /package/dist/{prettyInstructions.d.ts → types/prettyInstructions.d.ts} +0 -0
  211. /package/dist/{printBuildError.d.ts → types/printBuildError.d.ts} +0 -0
  212. /package/dist/{react.d.ts → types/react.d.ts} +0 -0
  213. /package/dist/{readTsConfig.d.ts → types/readTsConfig.d.ts} +0 -0
  214. /package/dist/{removeSlash.d.ts → types/removeSlash.d.ts} +0 -0
  215. /package/dist/{resolve.d.ts → types/resolve.d.ts} +0 -0
  216. /package/dist/{routes.d.ts → types/routes.d.ts} +0 -0
  217. /package/dist/{runtimeExports.d.ts → types/runtimeExports.d.ts} +0 -0
  218. /package/dist/{ssr.d.ts → types/ssr.d.ts} +0 -0
  219. /package/dist/{storage.d.ts → types/storage.d.ts} +0 -0
  220. /package/dist/{testUtils.d.ts → types/testUtils.d.ts} +0 -0
  221. /package/dist/{types.d.ts → types/types.d.ts} +0 -0
  222. /package/dist/{universal → types/universal}/constants.d.ts +0 -0
  223. /package/dist/{universal → types/universal}/formatWebpack.d.ts +0 -0
  224. /package/dist/{universal → types/universal}/nestedRoutes.d.ts +0 -0
  225. /package/dist/{universal → types/universal}/remixRouter.d.ts +0 -0
  226. /package/dist/{universal → types/universal}/serialize.d.ts +0 -0
  227. /package/dist/{version.d.ts → types/version.d.ts} +0 -0
  228. /package/dist/{wait.d.ts → types/wait.d.ts} +0 -0
  229. /package/dist/{watch.d.ts → types/watch.d.ts} +0 -0
package/package.json CHANGED
@@ -11,19 +11,33 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.12.0",
14
+ "version": "2.12.1-alpha.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/index.d.ts",
17
17
  "main": "./dist/index.js",
18
18
  "module": "./dist/index.js",
19
19
  "_comment": "Provide ESM and CJS exports, ESM is used by runtime package, for treeshaking",
20
20
  "exports": {
21
- ".": "./dist/index.js",
22
- "./ssr": "./dist/ssr.js",
23
- "./babel": "./dist/babel.js",
24
- "./logger": "./dist/logger.js",
25
- "./chain-id": "./dist/chainId.js",
26
- "./constants": "./dist/constants.js",
21
+ ".": {
22
+ "import": "./dist/esm/index.js",
23
+ "default": "./dist/cjs/index.js"
24
+ },
25
+ "./ssr": {
26
+ "import": "./dist/esm/ssr.js",
27
+ "default": "./dist/cjs/ssr.js"
28
+ },
29
+ "./logger": {
30
+ "import": "./dist/esm/logger.js",
31
+ "default": "./dist/cjs/logger.js"
32
+ },
33
+ "./constants": {
34
+ "import": "./dist/esm/constants.js",
35
+ "default": "./dist/cjs/constants.js"
36
+ },
37
+ "./babel": {
38
+ "import": "./dist/esm/babel.js",
39
+ "default": "./dist/cjs/babel.js"
40
+ },
27
41
  "./ajv": "./compiled/ajv/index.js",
28
42
  "./glob": "./compiled/glob/index.js",
29
43
  "./chalk": "./compiled/chalk/index.js",
@@ -42,11 +56,29 @@
42
56
  "./tsconfig-paths": "./compiled/tsconfig-paths/index.js",
43
57
  "./better-ajv-errors": "./compiled/better-ajv-errors/index.js",
44
58
  "./webpack-dev-middleware": "./compiled/webpack-dev-middleware/index.js",
45
- "./universal/constants": "./dist/universal/constants.js",
46
- "./universal/serialize": "./dist/universal/serialize.js",
47
- "./universal/remix-router": "./dist/universal/remixRouter.js",
48
- "./universal/format-webpack": "./dist/universal/formatWebpack.js",
49
- "./universal/nestedRoutes": "./dist/universal/nestedRoutes.js"
59
+ "./chain-id": {
60
+ "default": "./dist/cjs/chainId.js"
61
+ },
62
+ "./universal/constants": {
63
+ "import": "./dist/esm/universal/constants.js",
64
+ "default": "./dist/cjs/universal/constants.js"
65
+ },
66
+ "./universal/serialize": {
67
+ "import": "./dist/esm/universal/serialize.js",
68
+ "default": "./dist/cjs/universal/serialize.js"
69
+ },
70
+ "./universal/remix-router": {
71
+ "import": "./dist/esm/universal/remixRouter.js",
72
+ "default": "./dist/cjs/universal/remixRouter.js"
73
+ },
74
+ "./universal/format-webpack": {
75
+ "import": "./dist/esm/universal/formatWebpack.js",
76
+ "default": "./dist/cjs/universal/formatWebpack.js"
77
+ },
78
+ "./universal/nestedRoutes": {
79
+ "import": "./dist/esm/universal/nestedRoutes.js",
80
+ "default": "./dist/cjs/universal/nestedRoutes.js"
81
+ }
50
82
  },
51
83
  "publishConfig": {
52
84
  "registry": "https://registry.npmjs.org/",
@@ -144,10 +176,10 @@
144
176
  }
145
177
  },
146
178
  "dependencies": {
179
+ "@remix-run/router": "^1.3.2",
147
180
  "caniuse-lite": "^1.0.30001451",
148
181
  "lodash": "^4.17.21",
149
- "serialize-javascript": "^6.0.0",
150
- "@remix-run/router": "^1.3.2"
182
+ "serialize-javascript": "^6.0.0"
151
183
  },
152
184
  "peerDependencies": {
153
185
  "react": ">=17.0.0",
@@ -166,24 +198,24 @@
166
198
  }
167
199
  },
168
200
  "devDependencies": {
169
- "react": ">=17.0.0",
170
- "react-dom": ">=17.0.0",
171
- "react-router-dom": "^6.8.1",
201
+ "@modern-js/module-tools": "^2.12.0",
172
202
  "@types/jest": "^29",
173
203
  "@types/node": "^14",
204
+ "@types/serialize-javascript": "^5.0.1",
174
205
  "jest": "^29",
206
+ "react": ">=17.0.0",
207
+ "react-dom": ">=17.0.0",
208
+ "react-router-dom": "^6.8.1",
175
209
  "typescript": "^4",
176
210
  "webpack": "^5.76.2",
177
- "@types/serialize-javascript": "^5.0.1",
178
211
  "@modern-js/types": "2.12.0",
179
- "@scripts/build": "2.12.0",
180
212
  "@scripts/jest-config": "2.12.0"
181
213
  },
182
214
  "sideEffects": false,
183
215
  "scripts": {
184
216
  "new": "modern-lib new",
185
- "dev": "modern-lib build --watch",
186
- "build": "modern-lib build",
217
+ "dev": "modern build --watch",
218
+ "build": "modern build",
187
219
  "test": "jest --passWithNoTests"
188
220
  }
189
221
  }
@@ -1,43 +0,0 @@
1
- export { default as fs } from '../compiled/fs-extra';
2
- export { default as ora } from '../compiled/ora';
3
- export { default as glob } from '../compiled/glob';
4
- export { default as yaml } from '../compiled/js-yaml';
5
- export { default as chalk } from '../compiled/chalk';
6
- export { default as debug } from '../compiled/debug';
7
- export { default as slash } from '../compiled/slash';
8
- export { default as execa } from '../compiled/execa';
9
- export { default as json5 } from '../compiled/json5';
10
- export { default as upath } from '../compiled/upath';
11
- export { default as pkgUp } from '../compiled/pkg-up';
12
- export { nanoid } from '../compiled/nanoid';
13
- export { default as semver } from '../compiled/semver';
14
- export { default as dotenv } from '../compiled/dotenv';
15
- export { default as lodash } from '../compiled/lodash';
16
- export { default as globby } from '../compiled/globby';
17
- export { default as address } from '../compiled/address';
18
- export { default as signale } from '../compiled/signale';
19
- export { default as urlJoin } from '../compiled/url-join';
20
- export { default as minimist } from '../compiled/minimist';
21
- export { default as fastGlob } from '../compiled/fast-glob';
22
- export { default as filesize } from '../compiled/filesize';
23
- export { default as gzipSize } from '../compiled/gzip-size';
24
- export { default as stripAnsi } from '../compiled/strip-ansi';
25
- export { default as dotenvExpand } from '../compiled/dotenv-expand';
26
- export { default as browserslist } from '../compiled/browserslist';
27
- export { default as recursiveReaddir } from '../compiled/recursive-readdir';
28
- export { program, Command } from '../compiled/commander';
29
- export { Signale } from '../compiled/signale';
30
- export type { SignaleOptions } from '../compiled/signale';
31
- export type { IOptions as GlobOptions } from '../compiled/glob';
32
- export type { GlobbyOptions } from '../compiled/globby';
33
- export type { FSWatcher, WatchOptions } from '../compiled/chokidar';
34
- export type { ExecaError } from '../compiled/execa';
35
- export type { default as WebpackChain } from '../compiled/webpack-chain';
36
- /**
37
- * Lazy import some expensive modules that will slow down startup speed.
38
- * Notice that `csmith-tools build` can not bundle lazy imported modules.
39
- */
40
-
41
- export declare const mime: typeof import('../compiled/mime-types');
42
- export declare const chokidar: typeof import('../compiled/chokidar');
43
- export declare const inquirer: typeof import('../compiled/inquirer');
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