@sanity/cli 3.81.1-sdk-295.36 → 3.82.1-media-library.26

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/index.d.mts CHANGED
@@ -10,6 +10,15 @@ import {SanityClient} from '@sanity/client'
10
10
  import {Separator} from 'inquirer'
11
11
  import {TelemetryLogger} from '@sanity/telemetry'
12
12
 
13
+ declare interface AppConfig {
14
+ organizationId: string
15
+ /**
16
+ * Defaults to './src/App'
17
+ */
18
+ entry?: string
19
+ id?: string
20
+ }
21
+
13
22
  export declare type CliApiClient = (options?: ClientRequirements) => SanityClient
14
23
 
15
24
  export declare interface CliApiConfig {
@@ -117,13 +126,8 @@ export declare interface CliConfig {
117
126
  /**
118
127
  * Parameter used to configure other kinds of applications.
119
128
  * Signals to `sanity` commands that this is not a studio.
120
- * @internal
121
129
  */
122
- __experimental_appConfiguration?: {
123
- organizationId: string
124
- appLocation?: string
125
- appId?: string
126
- }
130
+ app?: AppConfig
127
131
  }
128
132
 
129
133
  declare type CliConfigResult =
package/lib/index.d.ts CHANGED
@@ -10,6 +10,15 @@ import {SanityClient} from '@sanity/client'
10
10
  import {Separator} from 'inquirer'
11
11
  import {TelemetryLogger} from '@sanity/telemetry'
12
12
 
13
+ declare interface AppConfig {
14
+ organizationId: string
15
+ /**
16
+ * Defaults to './src/App'
17
+ */
18
+ entry?: string
19
+ id?: string
20
+ }
21
+
13
22
  export declare type CliApiClient = (options?: ClientRequirements) => SanityClient
14
23
 
15
24
  export declare interface CliApiConfig {
@@ -117,13 +126,8 @@ export declare interface CliConfig {
117
126
  /**
118
127
  * Parameter used to configure other kinds of applications.
119
128
  * Signals to `sanity` commands that this is not a studio.
120
- * @internal
121
129
  */
122
- __experimental_appConfiguration?: {
123
- organizationId: string
124
- appLocation?: string
125
- appId?: string
126
- }
130
+ app?: AppConfig
127
131
  }
128
132
 
129
133
  declare type CliConfigResult =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli",
3
- "version": "3.81.1-sdk-295.36+8bc6ac382d",
3
+ "version": "3.82.1-media-library.26+9e959a52b0",
4
4
  "description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
5
5
  "keywords": [
6
6
  "sanity",
@@ -23,6 +23,7 @@
23
23
  "license": "MIT",
24
24
  "author": "Sanity.io <hello@sanity.io>",
25
25
  "sideEffects": false,
26
+ "type": "commonjs",
26
27
  "exports": {
27
28
  ".": {
28
29
  "source": "./src/index.ts",
@@ -33,7 +34,7 @@
33
34
  "./package.json": "./package.json"
34
35
  },
35
36
  "main": "./lib/index.js",
36
- "module": "./lib/index.esm.js",
37
+ "module": "./lib/index.mjs",
37
38
  "types": "./lib/index.d.ts",
38
39
  "bin": {
39
40
  "sanity": "./bin/sanity"
@@ -58,11 +59,11 @@
58
59
  "dependencies": {
59
60
  "@babel/traverse": "^7.23.5",
60
61
  "@sanity/client": "^6.28.4",
61
- "@sanity/codegen": "3.81.1-sdk-295.36+8bc6ac382d",
62
+ "@sanity/codegen": "3.82.1-media-library.26+9e959a52b0",
62
63
  "@sanity/runtime-cli": "^1.1.1",
63
64
  "@sanity/telemetry": "^0.8.0",
64
65
  "@sanity/template-validator": "^2.4.3",
65
- "@sanity/util": "3.81.1-sdk-295.36+8bc6ac382d",
66
+ "@sanity/util": "3.82.1-media-library.26+9e959a52b0",
66
67
  "chalk": "^4.1.2",
67
68
  "debug": "^4.3.4",
68
69
  "decompress": "^4.2.0",
@@ -76,13 +77,13 @@
76
77
  "validate-npm-package-name": "^3.0.0"
77
78
  },
78
79
  "devDependencies": {
79
- "@repo/package.config": "3.81.0",
80
- "@repo/test-config": "3.81.0",
80
+ "@repo/package.config": "3.82.0",
81
+ "@repo/test-config": "3.82.0",
81
82
  "@rexxars/gitconfiglocal": "^3.0.1",
82
83
  "@rollup/plugin-node-resolve": "^15.2.3",
83
84
  "@sanity/eslint-config-studio": "^4.0.0",
84
85
  "@sanity/generate-help-url": "^3.0.0",
85
- "@sanity/types": "3.81.1-sdk-295.36+8bc6ac382d",
86
+ "@sanity/types": "3.82.1-media-library.26+9e959a52b0",
86
87
  "@types/babel__traverse": "^7.20.5",
87
88
  "@types/configstore": "^5.0.1",
88
89
  "@types/cpx": "^1.5.2",
@@ -126,7 +127,7 @@
126
127
  "semver": "^7.3.5",
127
128
  "semver-compare": "^1.0.0",
128
129
  "tar": "^6.1.11",
129
- "vite": "^6.2.3",
130
+ "vite": "^6.2.4",
130
131
  "vitest": "^3.1.1",
131
132
  "which": "^2.0.2",
132
133
  "xdg-basedir": "^4.0.0"
@@ -134,5 +135,5 @@
134
135
  "engines": {
135
136
  "node": ">=18"
136
137
  },
137
- "gitHead": "8bc6ac382d950780ee8627e2b9d1b9064294009a"
138
+ "gitHead": "9e959a52b09e020a93532bed78b5b20f0eb654c8"
138
139
  }
@@ -143,7 +143,7 @@ export async function bootstrapLocalTemplate(
143
143
  // ...and a CLI config (`sanity.cli.[ts|js]`)
144
144
  const cliConfig = isAppTemplate
145
145
  ? createAppCliConfig({
146
- appLocation: template.appLocation!,
146
+ entry: template.entry!,
147
147
  organizationId: variables.organizationId,
148
148
  })
149
149
  : createCliConfig({
@@ -4,16 +4,16 @@ const defaultAppTemplate = `
4
4
  import {defineCliConfig} from 'sanity/cli'
5
5
 
6
6
  export default defineCliConfig({
7
- __experimental_appConfiguration: {
7
+ app: {
8
8
  organizationId: '%organizationId%',
9
- appLocation: '%appLocation%',
9
+ entry: '%entry%',
10
10
  },
11
11
  })
12
12
  `
13
13
 
14
14
  export interface GenerateCliConfigOptions {
15
15
  organizationId?: string
16
- appLocation: string
16
+ entry: string
17
17
  }
18
18
 
19
19
  export function createAppCliConfig(options: GenerateCliConfigOptions): string {
@@ -98,7 +98,7 @@ export interface ProjectTemplate {
98
98
  importPrompt?: string
99
99
  configTemplate?: string | ((variables: GenerateConfigOptions['variables']) => string)
100
100
  typescriptOnly?: boolean
101
- appLocation?: string
101
+ entry?: string
102
102
  scripts?: Record<string, string>
103
103
  }
104
104
 
@@ -19,7 +19,7 @@ const appTemplate: ProjectTemplate = {
19
19
  'sanity': '^3',
20
20
  'typescript': '^5.1.6',
21
21
  },
22
- appLocation: './src/App.tsx',
22
+ entry: './src/App.tsx',
23
23
  scripts: {
24
24
  dev: 'sanity dev',
25
25
  build: 'sanity build',
package/src/types.ts CHANGED
@@ -311,6 +311,15 @@ export interface ReactCompilerConfig {
311
311
  compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all'
312
312
  }
313
313
 
314
+ interface AppConfig {
315
+ organizationId: string
316
+ /**
317
+ * Defaults to './src/App'
318
+ */
319
+ entry?: string
320
+ id?: string
321
+ }
322
+
314
323
  export interface CliConfig {
315
324
  api?: CliApiConfig
316
325
 
@@ -349,13 +358,8 @@ export interface CliConfig {
349
358
  /**
350
359
  * Parameter used to configure other kinds of applications.
351
360
  * Signals to `sanity` commands that this is not a studio.
352
- * @internal
353
361
  */
354
- __experimental_appConfiguration?: {
355
- organizationId: string
356
- appLocation?: string
357
- appId?: string
358
- }
362
+ app?: AppConfig
359
363
  }
360
364
 
361
365
  export type UserViteConfig =
@@ -5,13 +5,70 @@
5
5
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
6
6
  }
7
7
 
8
+ .example-avatar-container {
9
+ position: relative;
10
+ margin-block-end: 1rem;
11
+ }
12
+
13
+ @keyframes wave {
14
+ 0% {
15
+ rotate: 0deg;
16
+ }
17
+ 2% {
18
+ rotate: 20deg;
19
+ filter: blur(1px);
20
+ }
21
+ 4% {
22
+ rotate: 0deg;
23
+ }
24
+ 6% {
25
+ rotate: -20deg;
26
+ }
27
+ 8% {
28
+ rotate: 0deg;
29
+ }
30
+ 10% {
31
+ rotate: 20deg;
32
+ }
33
+ 12% {
34
+ rotate: 0deg;
35
+ }
36
+ 14% {
37
+ rotate: -20deg;
38
+ }
39
+ 16% {
40
+ rotate: 0deg;
41
+ filter: blur(0);
42
+ }
43
+ }
44
+
45
+ .example-avatar-container:after {
46
+ content: '👋';
47
+ position: absolute;
48
+ font-size: 1.5rem;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-container: center;
52
+ inset-inline-start: 0;
53
+ inset-block-start: 0;
54
+ translate: -25% -25%;
55
+ transform-origin: 100% 100%;
56
+ animation: wave 4s infinite linear;
57
+ }
58
+
59
+ .example-avatar {
60
+ inline-size: 4rem;
61
+ aspect-ratio: 1;
62
+ border-radius: 50%;
63
+ }
64
+
8
65
  .example-heading {
9
66
  color: #333;
10
67
  margin-top: 0;
11
- font-size: 1.8rem;
68
+ font-size: 2rem;
12
69
  }
13
70
 
14
- .example-text {
71
+ p {
15
72
  color: #666;
16
73
  line-height: 1.6;
17
74
  }
@@ -23,4 +80,5 @@
23
80
  font-family: monospace;
24
81
  margin-top: 1.5rem;
25
82
  border-left: 3px solid #e0e0e0;
83
+ line-height: 1.5;
26
84
  }
@@ -1,18 +1,33 @@
1
+ import {useCurrentUser, type CurrentUser} from '@sanity/sdk-react'
1
2
  import './ExampleComponent.css'
2
3
 
3
4
  export function ExampleComponent() {
5
+ const user: CurrentUser | null = useCurrentUser()
6
+
4
7
  return (
5
8
  <div className="example-container">
6
- <h1 className="example-heading">Welcome to your Sanity App!</h1>
9
+ {user?.profileImage ? (
10
+ <div className="example-avatar-container">
11
+ <img src={user.profileImage} alt="" className="example-avatar" />
12
+ </div>
13
+ ) : (
14
+ ''
15
+ )}
16
+ <h1 className="example-heading">
17
+ Welcome to your Sanity App{user?.name ? `, ${user.name}` : ''}!
18
+ </h1>
7
19
  <p className="example-text">
8
- This is an example component. You can replace this with your own content
9
- by creating a new component and importing it in App.tsx.
20
+ This is an example component. You can replace this with your own content by creating a new
21
+ component and importing it in App.tsx.
10
22
  </p>
11
23
  <div className="code-hint">
12
- <p>Quick tip: Create new components in separate files and import them like this in App.tsx / App.jsx:</p>
24
+ <p>
25
+ Quick tip: Create new components in separate files and import them like this in App.tsx /
26
+ App.jsx:
27
+ </p>
13
28
  <pre>{`import {YourComponent} from './YourComponent'
14
29
 
15
- // Then use it in your JSX
30
+ // Then use it in your JSX
16
31
  <SanityApp sanityConfigs={sanityConfigs}>
17
32
  <YourComponent />
18
33
  </SanityApp>`}</pre>