@sanity/cli 3.58.0 → 3.59.0
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 +52 -30
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/cli.js +0 -1
- package/lib/cli.js.map +1 -1
- package/lib/index.d.mts +0 -1
- package/lib/index.d.ts +0 -1
- package/package.json +8 -8
- package/src/actions/init-project/initProject.ts +25 -20
- package/src/cli.ts +0 -2
- package/src/commands/projects/listProjectsCommand.ts +3 -3
- package/src/types.ts +0 -1
package/lib/cli.js
CHANGED
package/lib/cli.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cli.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"cli.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
package/lib/index.d.mts
CHANGED
package/lib/index.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sanity/cli",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.59.0",
|
4
4
|
"description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
|
5
5
|
"keywords": [
|
6
6
|
"sanity",
|
@@ -57,10 +57,10 @@
|
|
57
57
|
},
|
58
58
|
"dependencies": {
|
59
59
|
"@babel/traverse": "^7.23.5",
|
60
|
-
"@sanity/client": "^6.
|
61
|
-
"@sanity/codegen": "3.
|
60
|
+
"@sanity/client": "^6.22.0",
|
61
|
+
"@sanity/codegen": "3.59.0",
|
62
62
|
"@sanity/telemetry": "^0.7.7",
|
63
|
-
"@sanity/util": "3.
|
63
|
+
"@sanity/util": "3.59.0",
|
64
64
|
"chalk": "^4.1.2",
|
65
65
|
"debug": "^4.3.4",
|
66
66
|
"decompress": "^4.2.0",
|
@@ -68,7 +68,6 @@
|
|
68
68
|
"esbuild-register": "^3.5.0",
|
69
69
|
"get-it": "^8.6.5",
|
70
70
|
"groq-js": "^1.13.0",
|
71
|
-
"node-machine-id": "^1.1.12",
|
72
71
|
"pkg-dir": "^5.0.0",
|
73
72
|
"prettier": "^3.3.0",
|
74
73
|
"semver": "^7.3.5",
|
@@ -77,12 +76,13 @@
|
|
77
76
|
},
|
78
77
|
"devDependencies": {
|
79
78
|
"@jest/globals": "^29.7.0",
|
80
|
-
"@repo/package.config": "3.
|
79
|
+
"@repo/package.config": "3.59.0",
|
80
|
+
"@repo/test-config": "3.59.0",
|
81
81
|
"@rexxars/gitconfiglocal": "^3.0.1",
|
82
82
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
83
83
|
"@sanity/eslint-config-studio": "^4.0.0",
|
84
84
|
"@sanity/generate-help-url": "^3.0.0",
|
85
|
-
"@sanity/types": "3.
|
85
|
+
"@sanity/types": "3.59.0",
|
86
86
|
"@types/babel__traverse": "^7.20.5",
|
87
87
|
"@types/configstore": "^5.0.1",
|
88
88
|
"@types/cpx": "^1.5.2",
|
@@ -135,5 +135,5 @@
|
|
135
135
|
"engines": {
|
136
136
|
"node": ">=18"
|
137
137
|
},
|
138
|
-
"gitHead": "
|
138
|
+
"gitHead": "30c046b2eb514875bfe900f56ea564b385eaca1d"
|
139
139
|
}
|
@@ -594,26 +594,31 @@ export default async function initSanity(
|
|
594
594
|
|
595
595
|
trace.log({step: 'importTemplateDataset', selectedOption: shouldImport ? 'yes' : 'no'})
|
596
596
|
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
}
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
597
|
+
const [_, bootstrapPromise] = await Promise.allSettled([
|
598
|
+
// record template files attempted to be created locally
|
599
|
+
apiClient({api: {projectId: projectId}})
|
600
|
+
.request<SanityProject>({uri: `/projects/${projectId}`})
|
601
|
+
.then((project: SanityProject) => {
|
602
|
+
if (!project?.metadata?.cliInitializedAt) {
|
603
|
+
return apiClient({api: {projectId}}).request({
|
604
|
+
method: 'PATCH',
|
605
|
+
uri: `/projects/${projectId}`,
|
606
|
+
body: {metadata: {cliInitializedAt: new Date().toISOString()}},
|
607
|
+
})
|
608
|
+
}
|
609
|
+
return Promise.resolve()
|
610
|
+
})
|
611
|
+
.catch(() => {
|
612
|
+
// Non-critical update
|
613
|
+
debug('Failed to update cliInitializedAt metadata')
|
614
|
+
}),
|
615
|
+
// Bootstrap Sanity, creating required project files, manifests etc
|
616
|
+
bootstrapTemplate(templateOptions, context),
|
617
|
+
])
|
618
|
+
|
619
|
+
if (bootstrapPromise.status === 'rejected' && bootstrapPromise.reason instanceof Error) {
|
620
|
+
throw bootstrapPromise.reason
|
621
|
+
}
|
617
622
|
|
618
623
|
let pkgManager: PackageManager
|
619
624
|
|
package/src/cli.ts
CHANGED
@@ -5,7 +5,6 @@ import path from 'node:path'
|
|
5
5
|
|
6
6
|
import chalk from 'chalk'
|
7
7
|
import dotenv from 'dotenv'
|
8
|
-
import {machineId} from 'node-machine-id'
|
9
8
|
import resolveFrom from 'resolve-from'
|
10
9
|
|
11
10
|
import {CliCommand} from './__telemetry__/cli.telemetry'
|
@@ -85,7 +84,6 @@ export async function runCli(cliRoot: string, {cliVersion}: {cliVersion: string}
|
|
85
84
|
)
|
86
85
|
|
87
86
|
telemetry.updateUserProperties({
|
88
|
-
deviceId: await machineId(),
|
89
87
|
runtimeVersion: process.version,
|
90
88
|
runtime: detectRuntime(),
|
91
89
|
cliVersion: pkg.version,
|
@@ -37,9 +37,9 @@ const listProjectsCommand: CliCommandDefinition = {
|
|
37
37
|
|
38
38
|
const projects = await client.projects.list()
|
39
39
|
const ordered = sortBy(
|
40
|
-
projects.map(({displayName, id, members = [],
|
41
|
-
const
|
42
|
-
return [id, members.length, displayName,
|
40
|
+
projects.map(({displayName, id, members = [], createdAt}) => {
|
41
|
+
const manage = `https://www.sanity.io/manage/project/${id}`
|
42
|
+
return [id, members.length, displayName, manage, createdAt].map(String)
|
43
43
|
}),
|
44
44
|
[headings.indexOf(flags.sort)],
|
45
45
|
)
|