create-umi 4.0.65 → 4.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +25 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -168,8 +168,9 @@ var src_default = async ({
|
|
|
168
168
|
const withHusky = shouldInitGit && !inMonorepo;
|
|
169
169
|
let pnpmExtraNpmrc = "";
|
|
170
170
|
const isPnpm = npmClient === "pnpm" /* pnpm */;
|
|
171
|
+
let pnpmMajorVersion;
|
|
171
172
|
if (isPnpm) {
|
|
172
|
-
|
|
173
|
+
pnpmMajorVersion = await getPnpmMajorVersion();
|
|
173
174
|
if (pnpmMajorVersion === 7) {
|
|
174
175
|
pnpmExtraNpmrc = `strict-peer-dependencies=false`;
|
|
175
176
|
}
|
|
@@ -211,10 +212,29 @@ var src_default = async ({
|
|
|
211
212
|
} else {
|
|
212
213
|
import_utils.logger.info(`Skip Git init`);
|
|
213
214
|
}
|
|
215
|
+
const isPnpm8 = pnpmMajorVersion === 8;
|
|
214
216
|
if (!useDefaultData && args.install !== false) {
|
|
215
|
-
(
|
|
217
|
+
if (isPnpm8) {
|
|
218
|
+
await installWithPnpm8(target);
|
|
219
|
+
} else {
|
|
220
|
+
(0, import_utils.installWithNpmClient)({ npmClient, cwd: target });
|
|
221
|
+
}
|
|
216
222
|
} else {
|
|
217
223
|
import_utils.logger.info(`Skip install deps`);
|
|
224
|
+
if (isPnpm8) {
|
|
225
|
+
import_utils.logger.warn(
|
|
226
|
+
import_utils.chalk.yellow(
|
|
227
|
+
`You current using pnpm v8, it will install minimal version of dependencies`
|
|
228
|
+
)
|
|
229
|
+
);
|
|
230
|
+
import_utils.logger.warn(
|
|
231
|
+
import_utils.chalk.green(
|
|
232
|
+
`Recommended that you run ${import_utils.chalk.bold.cyan(
|
|
233
|
+
"pnpm up -L"
|
|
234
|
+
)} to install latest version of dependencies`
|
|
235
|
+
)
|
|
236
|
+
);
|
|
237
|
+
}
|
|
218
238
|
}
|
|
219
239
|
};
|
|
220
240
|
async function detectMonorepoRoot(opts) {
|
|
@@ -258,6 +278,9 @@ async function removeHusky(opts) {
|
|
|
258
278
|
await import_utils.fsExtra.remove(dir);
|
|
259
279
|
}
|
|
260
280
|
}
|
|
281
|
+
async function installWithPnpm8(cwd) {
|
|
282
|
+
await import_utils.execa.execa("pnpm", ["up", "-L"], { cwd, stdio: "inherit" });
|
|
283
|
+
}
|
|
261
284
|
async function getPnpmMajorVersion() {
|
|
262
285
|
try {
|
|
263
286
|
const { stdout } = await import_utils.execa.execa("pnpm", ["--version"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-umi",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.66",
|
|
4
4
|
"description": "create-umi",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/create-umi#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"templates"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@umijs/utils": "4.0.
|
|
22
|
+
"@umijs/utils": "4.0.66"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|