@sanity/cli 3.92.1-next.3.8d6ac7cf26 → 3.92.1-next.31.52ea1d6df9
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 +29 -29
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +6 -6
- package/src/actions/init-project/initProject.ts +23 -11
- package/src/cli.ts +3 -0
- package/src/packageManager/installPackages.ts +33 -21
- package/templates/blog/README.md +1 -1
- package/templates/clean/README.md +1 -1
- package/templates/ecommerce/README.md +1 -1
- package/templates/get-started/README.md +1 -1
- package/templates/moviedb/README.md +1 -1
- package/templates/quickstart/README.md +1 -1
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -23522,23 +23522,23 @@ async function installDeclaredPackages(cwd, packageManager, context) {
|
|
|
23522
23522
|
encoding: "utf8",
|
|
23523
23523
|
env: getPartialEnvWithNpmPath(cwd),
|
|
23524
23524
|
cwd,
|
|
23525
|
-
stdio: "
|
|
23526
|
-
}
|
|
23525
|
+
stdio: "pipe"
|
|
23526
|
+
};
|
|
23527
23527
|
let result;
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
|
|
23531
|
-
|
|
23532
|
-
|
|
23533
|
-
}
|
|
23534
|
-
|
|
23535
|
-
output.
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23528
|
+
const installerArgs = {
|
|
23529
|
+
npm: ["install", "--legacy-peer-deps"],
|
|
23530
|
+
yarn: ["install"],
|
|
23531
|
+
pnpm: ["install"],
|
|
23532
|
+
bun: ["install"]
|
|
23533
|
+
};
|
|
23534
|
+
async function handleInstall(cmd, args) {
|
|
23535
|
+
const progress = output.spinner(`Running ${cmd} ${args.join(" ")}
|
|
23536
|
+
`).start();
|
|
23537
|
+
if (result = await execa(cmd, args, execOptions), result?.exitCode || result?.failed)
|
|
23538
|
+
throw progress.fail(), output.print(result.stdout), new Error("Dependency installation failed");
|
|
23539
|
+
progress.succeed();
|
|
23540
|
+
}
|
|
23541
|
+
packageManager === "manual" ? output.print(`Manual installation selected \u2014 run 'npm ${installerArgs.npm} or equivalent'`) : await handleInstall(packageManager, installerArgs[packageManager]);
|
|
23542
23542
|
}
|
|
23543
23543
|
async function installNewPackages(options2, context) {
|
|
23544
23544
|
const { packageManager, packages } = options2, { output, workDir } = context, execOptions = {
|
|
@@ -53696,18 +53696,15 @@ ${chalk2.green("Success!")} Your Sanity configuration files has been added to th
|
|
|
53696
53696
|
pnpm: "pnpm dev",
|
|
53697
53697
|
bun: "bun dev",
|
|
53698
53698
|
manual: "npm run dev"
|
|
53699
|
-
}[pkgManager]
|
|
53700
|
-
|
|
53701
|
-
|
|
53702
|
-
|
|
53703
|
-
|
|
53704
|
-
`
|
|
53705
|
-
|
|
53706
|
-
|
|
53707
|
-
`), print(
|
|
53708
|
-
`Then: ${chalk2.cyan(devCommand)} -to run ${isAppTemplate ? "your Sanity application" : "Sanity Studio"}
|
|
53709
|
-
`
|
|
53710
|
-
)), print("Other helpful commands"), print("npx sanity docs - to open the documentation in a browser"), print("npx sanity manage - to open the project settings in a browser"), print("npx sanity help - to explore the CLI manual"), isFirstProject && (trace.log({ step: "sendCommunityInvite", selectedOption: "yes" }), print(`
|
|
53699
|
+
}[pkgManager], isCurrentDir = outputPath === process.cwd(), goToProjectDir = `(${chalk2.cyan(`cd ${outputPath}`)} to navigate to your new project directory)`;
|
|
53700
|
+
isAppTemplate ? (print(`\u2705 ${chalk2.green.bold("Success!")} Your custom app has been scaffolded.`), isCurrentDir || print(goToProjectDir), print(
|
|
53701
|
+
`
|
|
53702
|
+
${chalk2.bold("Next")}, configure the project(s) and dataset(s) your app should work with.`
|
|
53703
|
+
), print("\nGet started in `src/App.tsx`, or refer to our documentation for a walkthrough:"), print(chalk2.blue.underline("https://www.sanity.io/docs/app-sdk/sdk-configuration")), print(`
|
|
53704
|
+
`), print("Other helpful commands:"), print("npx sanity docs to open the documentation in a browser"), print("npx sanity dev to start the development server for your app"), print("npx sanity deploy to deploy your app")) : (print(`\u2705 ${chalk2.green.bold("Success!")} Your Studio has been created.`), isCurrentDir || print(goToProjectDir), print(
|
|
53705
|
+
`Get started by running ${chalk2.cyan(devCommand)} to launch your Studio\u2019s development server`
|
|
53706
|
+
), print(`
|
|
53707
|
+
`), print("Other helpful commands:"), print("npx sanity docs to open the documentation in a browser"), print("npx sanity manage to open the project settings in a browser"), print("npx sanity help to explore the CLI manual")), isFirstProject && (trace.log({ step: "sendCommunityInvite", selectedOption: "yes" }), print(`
|
|
53711
53708
|
Join our wonderful developer community as well: ${chalk2.cyan("https://snty.link/community")}`), print(`We look forward to seeing you there!
|
|
53712
53709
|
`)), trace.complete();
|
|
53713
53710
|
async function getOrCreateUser() {
|
|
@@ -79649,7 +79646,10 @@ async function runCli(cliRoot, { cliVersion }) {
|
|
|
79649
79646
|
await flushTelemetry();
|
|
79650
79647
|
const error2 = typeof err.details == "string" ? err.details : err;
|
|
79651
79648
|
console.error(`
|
|
79652
|
-
${error2.stack ? neatStack(err) : error2}`),
|
|
79649
|
+
${error2.stack ? neatStack(err) : error2}`), err.cause && console.error(`
|
|
79650
|
+
Caused by:
|
|
79651
|
+
|
|
79652
|
+
${err.cause.stack ? neatStack(err.cause) : err.cause}`), cliCommandTrace.error(error2), process.exit(1);
|
|
79653
79653
|
});
|
|
79654
79654
|
}
|
|
79655
79655
|
async function getCoreModulePath(workDir, cliConfig) {
|