@sanity/cli 3.92.1-next.30.cedda92b03 → 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli",
|
|
3
|
-
"version": "3.92.1-next.
|
|
3
|
+
"version": "3.92.1-next.31.52ea1d6df9",
|
|
4
4
|
"description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@babel/traverse": "^7.23.5",
|
|
61
61
|
"@sanity/client": "^7.6.0",
|
|
62
|
-
"@sanity/codegen": "3.92.1-next.
|
|
62
|
+
"@sanity/codegen": "3.92.1-next.31.52ea1d6df9",
|
|
63
63
|
"@sanity/runtime-cli": "^8.0.0",
|
|
64
64
|
"@sanity/telemetry": "^0.8.0",
|
|
65
65
|
"@sanity/template-validator": "^2.4.3",
|
|
66
|
-
"@sanity/util": "3.92.1-next.
|
|
66
|
+
"@sanity/util": "3.92.1-next.31.52ea1d6df9",
|
|
67
67
|
"chalk": "^4.1.2",
|
|
68
68
|
"debug": "^4.3.4",
|
|
69
69
|
"decompress": "^4.2.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
84
84
|
"@sanity/eslint-config-studio": "^4.0.0",
|
|
85
85
|
"@sanity/generate-help-url": "^3.0.0",
|
|
86
|
-
"@sanity/types": "3.92.1-next.
|
|
86
|
+
"@sanity/types": "3.92.1-next.31.52ea1d6df9",
|
|
87
87
|
"@types/babel__traverse": "^7.20.5",
|
|
88
88
|
"@types/configstore": "^5.0.1",
|
|
89
89
|
"@types/cpx": "^1.5.2",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"engines": {
|
|
136
136
|
"node": ">=18"
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "52ea1d6df9f4ada9eb472d1cea718ac5aedbc929"
|
|
139
139
|
}
|
|
@@ -679,24 +679,36 @@ export default async function initSanity(
|
|
|
679
679
|
const devCommand = devCommandMap[pkgManager]
|
|
680
680
|
|
|
681
681
|
const isCurrentDir = outputPath === process.cwd()
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
const goToProjectDir = `(${chalk.cyan(`cd ${outputPath}`)} to navigate to your new project directory)`
|
|
683
|
+
|
|
684
|
+
if (isAppTemplate) {
|
|
685
|
+
//output for custom apps here
|
|
686
|
+
print(`✅ ${chalk.green.bold('Success!')} Your custom app has been scaffolded.`)
|
|
687
|
+
if (!isCurrentDir) print(goToProjectDir)
|
|
684
688
|
print(
|
|
685
|
-
|
|
689
|
+
`\n${chalk.bold('Next')}, configure the project(s) and dataset(s) your app should work with.`,
|
|
686
690
|
)
|
|
691
|
+
print('\nGet started in `src/App.tsx`, or refer to our documentation for a walkthrough:')
|
|
692
|
+
print(chalk.blue.underline('https://www.sanity.io/docs/app-sdk/sdk-configuration'))
|
|
693
|
+
print('\n')
|
|
694
|
+
print(`Other helpful commands:`)
|
|
695
|
+
print(`npx sanity docs to open the documentation in a browser`)
|
|
696
|
+
print(`npx sanity dev to start the development server for your app`)
|
|
697
|
+
print(`npx sanity deploy to deploy your app`)
|
|
687
698
|
} else {
|
|
688
|
-
|
|
689
|
-
print(
|
|
699
|
+
//output for Studios here
|
|
700
|
+
print(`✅ ${chalk.green.bold('Success!')} Your Studio has been created.`)
|
|
701
|
+
if (!isCurrentDir) print(goToProjectDir)
|
|
690
702
|
print(
|
|
691
|
-
`
|
|
703
|
+
`Get started by running ${chalk.cyan(devCommand)} to launch your Studio’s development server`,
|
|
692
704
|
)
|
|
705
|
+
print('\n')
|
|
706
|
+
print(`Other helpful commands:`)
|
|
707
|
+
print(`npx sanity docs to open the documentation in a browser`)
|
|
708
|
+
print(`npx sanity manage to open the project settings in a browser`)
|
|
709
|
+
print(`npx sanity help to explore the CLI manual`)
|
|
693
710
|
}
|
|
694
711
|
|
|
695
|
-
print(`Other helpful commands`)
|
|
696
|
-
print(`npx sanity docs - to open the documentation in a browser`)
|
|
697
|
-
print(`npx sanity manage - to open the project settings in a browser`)
|
|
698
|
-
print(`npx sanity help - to explore the CLI manual`)
|
|
699
|
-
|
|
700
712
|
if (isFirstProject) {
|
|
701
713
|
trace.log({step: 'sendCommunityInvite', selectedOption: 'yes'})
|
|
702
714
|
|
|
@@ -18,32 +18,44 @@ export async function installDeclaredPackages(
|
|
|
18
18
|
encoding: 'utf8',
|
|
19
19
|
env: getPartialEnvWithNpmPath(cwd),
|
|
20
20
|
cwd,
|
|
21
|
-
stdio: '
|
|
21
|
+
stdio: 'pipe',
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// results of running execa with the selected package manager
|
|
25
25
|
let result: ExecaReturnValue<string> | undefined
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
output.print(`Running 'pnpm ${pnpmArgs.join(' ')}'`)
|
|
36
|
-
result = await execa('pnpm', pnpmArgs, execOptions)
|
|
37
|
-
} else if (packageManager === 'bun') {
|
|
38
|
-
const bunArgs = ['install']
|
|
39
|
-
output.print(`Running 'bun ${bunArgs.join(' ')}'`)
|
|
40
|
-
result = await execa('bun', bunArgs, execOptions)
|
|
41
|
-
} else if (packageManager === 'manual') {
|
|
42
|
-
output.print(`Manual installation selected - run 'npm ${npmArgs.join(' ')}' or similar`)
|
|
26
|
+
|
|
27
|
+
type PackageManagerLibs = Exclude<PackageManager, 'manual'>
|
|
28
|
+
type InstallerArgs = {[key in PackageManagerLibs]: string[]}
|
|
29
|
+
|
|
30
|
+
const installerArgs: InstallerArgs = {
|
|
31
|
+
npm: ['install', '--legacy-peer-deps'],
|
|
32
|
+
yarn: ['install'],
|
|
33
|
+
pnpm: ['install'],
|
|
34
|
+
bun: ['install'],
|
|
43
35
|
}
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
async function handleInstall(cmd: PackageManager, args: InstallerArgs[PackageManagerLibs]) {
|
|
38
|
+
// Start a spinner for the install process
|
|
39
|
+
const progress = output.spinner(`Running ${cmd} ${args.join(' ')}\n`).start()
|
|
40
|
+
|
|
41
|
+
// Perform the install command with execa
|
|
42
|
+
result = await execa(cmd, args, execOptions)
|
|
43
|
+
|
|
44
|
+
// If the install fails, log execa's stdout and throw…
|
|
45
|
+
if (result?.exitCode || result?.failed) {
|
|
46
|
+
progress.fail()
|
|
47
|
+
output.print(result.stdout)
|
|
48
|
+
throw new Error('Dependency installation failed')
|
|
49
|
+
} else {
|
|
50
|
+
// …otherwise, just mark the install as successful
|
|
51
|
+
progress.succeed()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (packageManager === 'manual') {
|
|
56
|
+
output.print(`Manual installation selected — run 'npm ${installerArgs.npm} or equivalent'`)
|
|
57
|
+
} else {
|
|
58
|
+
await handleInstall(packageManager, installerArgs[packageManager])
|
|
47
59
|
}
|
|
48
60
|
}
|
|
49
61
|
|