@sanity/cli 3.44.1-mmm-canary.137 → 3.45.1-add-input-error-boundary.14

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.44.1-mmm-canary.137+e9284ea5e0",
3
+ "version": "3.45.1-add-input-error-boundary.14+03b9cb0240",
4
4
  "description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
5
5
  "keywords": [
6
6
  "sanity",
@@ -58,9 +58,9 @@
58
58
  "dependencies": {
59
59
  "@babel/traverse": "^7.23.5",
60
60
  "@sanity/client": "^6.19.1",
61
- "@sanity/codegen": "3.44.1-mmm-canary.137+e9284ea5e0",
61
+ "@sanity/codegen": "3.45.1-add-input-error-boundary.14+03b9cb0240",
62
62
  "@sanity/telemetry": "^0.7.7",
63
- "@sanity/util": "3.44.1-mmm-canary.137+e9284ea5e0",
63
+ "@sanity/util": "3.45.1-add-input-error-boundary.14+03b9cb0240",
64
64
  "chalk": "^4.1.2",
65
65
  "debug": "^4.3.4",
66
66
  "decompress": "^4.2.0",
@@ -77,12 +77,12 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@jest/globals": "^29.7.0",
80
- "@repo/package.config": "3.44.0",
80
+ "@repo/package.config": "3.45.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.44.1-mmm-canary.137+e9284ea5e0",
85
+ "@sanity/types": "3.45.1-add-input-error-boundary.14+03b9cb0240",
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": "e9284ea5e036a76810acdf7957f006caa8232e9c"
138
+ "gitHead": "03b9cb02409c97749119b2fd9808b1d041ee1280"
139
139
  }
@@ -543,6 +543,24 @@ export default async function initSanity(
543
543
  // Bootstrap Sanity, creating required project files, manifests etc
544
544
  await bootstrapTemplate(templateOptions, context)
545
545
 
546
+ // update that files were initialized locally; do not halt flow for request
547
+ apiClient({api: {projectId: projectId}})
548
+ .request<SanityProject>({uri: `/projects/${projectId}`})
549
+ .then((project: SanityProject) => {
550
+ if (!project?.metadata?.cliInitializedAt) {
551
+ return apiClient({api: {projectId}}).request({
552
+ method: 'PATCH',
553
+ uri: `/projects/${projectId}`,
554
+ body: {metadata: {cliInitializedAt: new Date().toISOString()}},
555
+ })
556
+ }
557
+ return Promise.resolve()
558
+ })
559
+ .catch(() => {
560
+ // Non-critical update
561
+ debug('Failed to update cliInitializedAt metadata')
562
+ })
563
+
546
564
  let pkgManager: PackageManager
547
565
 
548
566
  // If the user has specified a package manager, and it's allowed use that
@@ -625,21 +643,6 @@ export default async function initSanity(
625
643
  print(`sanity help - to explore the CLI manual`)
626
644
  }
627
645
 
628
- try {
629
- const client = apiClient({api: {projectId: projectId}})
630
- const project = await client.request<SanityProject>({uri: `/projects/${projectId}`})
631
- if (!project?.metadata?.cliInitializedAt) {
632
- await apiClient({api: {projectId}}).request({
633
- method: 'PATCH',
634
- uri: `/projects/${projectId}`,
635
- body: {metadata: {cliInitializedAt: new Date().toISOString()}},
636
- })
637
- }
638
- } catch (err: unknown) {
639
- // Non-critical update
640
- debug('Failed to update cliInitializedAt metadata')
641
- }
642
-
643
646
  const sendInvite =
644
647
  isFirstProject &&
645
648
  (await prompt.single({
@@ -812,7 +815,7 @@ export default async function initSanity(
812
815
  displayName: projectName,
813
816
  organizationId: await getOrganizationId(organizations),
814
817
  subscription: selectedPlan ? {planId: selectedPlan} : undefined,
815
- metadata: {coupon: intendedCoupon},
818
+ metadata: {coupon: intendedCoupon, integration: 'cli'},
816
819
  }).then((response) => ({
817
820
  ...response,
818
821
  isFirstProject: isUsersFirstProject,
@@ -4,7 +4,10 @@ export interface CreateProjectOptions {
4
4
  displayName: string
5
5
  organizationId?: string
6
6
  subscription?: {planId: string}
7
- metadata?: {coupon?: string}
7
+ metadata?: {
8
+ coupon?: string
9
+ integration?: string
10
+ }
8
11
  }
9
12
 
10
13
  export function createProject(