@sanity/cli 4.10.4-next.2 → 4.10.4-next.3
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/lib/_chunks-cjs/cli.js +20 -15
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +6 -6
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -23770,10 +23770,9 @@ async function installDeclaredPackages(cwd, packageManager, context) {
|
|
|
23770
23770
|
encoding: "utf8",
|
|
23771
23771
|
env: getPartialEnvWithNpmPath(cwd),
|
|
23772
23772
|
cwd,
|
|
23773
|
-
|
|
23774
|
-
|
|
23775
|
-
|
|
23776
|
-
const installerArgs = {
|
|
23773
|
+
// inherit stdin & stdout, pipe stderr
|
|
23774
|
+
stdio: ["inherit", "inherit", "pipe"]
|
|
23775
|
+
}, installerArgs = {
|
|
23777
23776
|
npm: ["install", "--legacy-peer-deps"],
|
|
23778
23777
|
yarn: ["install"],
|
|
23779
23778
|
pnpm: ["install"],
|
|
@@ -23782,9 +23781,11 @@ async function installDeclaredPackages(cwd, packageManager, context) {
|
|
|
23782
23781
|
async function handleInstall(cmd, args) {
|
|
23783
23782
|
const progress = output.spinner(`Running ${cmd} ${args.join(" ")}
|
|
23784
23783
|
`).start();
|
|
23785
|
-
|
|
23786
|
-
|
|
23787
|
-
|
|
23784
|
+
try {
|
|
23785
|
+
await execa(cmd, args, execOptions), progress.succeed();
|
|
23786
|
+
} catch (err) {
|
|
23787
|
+
throw progress.fail(), new Error("Dependency installation failed", { cause: err });
|
|
23788
|
+
}
|
|
23788
23789
|
}
|
|
23789
23790
|
packageManager === "manual" ? output.print(`Manual installation selected \u2014 run 'npm ${installerArgs.npm} or equivalent'`) : await handleInstall(packageManager, installerArgs[packageManager]);
|
|
23790
23791
|
}
|
|
@@ -23793,23 +23794,27 @@ async function installNewPackages(options2, context) {
|
|
|
23793
23794
|
encoding: "utf8",
|
|
23794
23795
|
env: getPartialEnvWithNpmPath(workDir),
|
|
23795
23796
|
cwd: workDir,
|
|
23796
|
-
|
|
23797
|
+
// inherit stdin & stdout, pipe stderr
|
|
23798
|
+
stdio: ["inherit", "inherit", "pipe"]
|
|
23797
23799
|
}, npmArgs = ["install", "--legacy-peer-deps", "--save", ...packages];
|
|
23798
|
-
let
|
|
23800
|
+
let install;
|
|
23799
23801
|
if (packageManager === "npm")
|
|
23800
|
-
output.print(`Running 'npm ${npmArgs.join(" ")}'`),
|
|
23802
|
+
output.print(`Running 'npm ${npmArgs.join(" ")}'`), install = execa("npm", npmArgs, execOptions);
|
|
23801
23803
|
else if (packageManager === "yarn") {
|
|
23802
23804
|
const yarnArgs = ["add", ...packages];
|
|
23803
|
-
output.print(`Running 'yarn ${yarnArgs.join(" ")}'`),
|
|
23805
|
+
output.print(`Running 'yarn ${yarnArgs.join(" ")}'`), install = execa("yarn", yarnArgs, execOptions);
|
|
23804
23806
|
} else if (packageManager === "pnpm") {
|
|
23805
23807
|
const pnpmArgs = ["add", "--save-prod", ...packages];
|
|
23806
|
-
output.print(`Running 'pnpm ${pnpmArgs.join(" ")}'`),
|
|
23808
|
+
output.print(`Running 'pnpm ${pnpmArgs.join(" ")}'`), install = execa("pnpm", pnpmArgs, execOptions);
|
|
23807
23809
|
} else if (packageManager === "bun") {
|
|
23808
23810
|
const bunArgs = ["add", ...packages];
|
|
23809
|
-
output.print(`Running 'bun ${bunArgs.join(" ")}'`),
|
|
23811
|
+
output.print(`Running 'bun ${bunArgs.join(" ")}'`), install = execa("bun", bunArgs, execOptions);
|
|
23810
23812
|
} else packageManager === "manual" && output.print(`Manual installation selected - run 'npm ${npmArgs.join(" ")}' or equivalent`);
|
|
23811
|
-
|
|
23812
|
-
|
|
23813
|
+
try {
|
|
23814
|
+
await install;
|
|
23815
|
+
} catch (error2) {
|
|
23816
|
+
throw new Error("Package installation failed", { cause: error2 });
|
|
23817
|
+
}
|
|
23813
23818
|
}
|
|
23814
23819
|
const cliPackageManager = {
|
|
23815
23820
|
getInstallCommand,
|