Skip to content

Commit 447a963

Browse files
Update .env examples and gitignors to reflect. Standardize sanity.cli.ts (#48)
1 parent 0f406cf commit 447a963

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ yarn-debug.log*
1616
yarn-error.log*
1717

1818
# env files
19-
.env*
20-
!.env.template
21-
!.env.*.template
19+
.env
20+
.env.*
21+
!.env.example
2222

2323
# vercel
2424
.vercel
File renamed without changes.

studio/sanity.cli.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1+
/**
2+
* Sanity CLI Configuration
3+
* This file configures the Sanity CLI tool with project-specific settings
4+
* and customizes the Vite bundler configuration.
5+
* Learn more: https://www.sanity.io/docs/cli
6+
*/
7+
18
import {defineCliConfig} from 'sanity/cli'
2-
import {projectId, dataset} from './sanity.config'
9+
10+
const projectId = process.env.SANITY_STUDIO_PROJECT_ID || '<your project ID>'
11+
const dataset = process.env.SANITY_STUDIO_DATASET || 'production'
312

413
export default defineCliConfig({
514
api: {
615
projectId,
716
dataset,
817
},
9-
studioHost: process.env.SANITY_STUDIO_STUDIO_HOST,
18+
studioHost: process.env.SANITY_STUDIO_STUDIO_HOST || '', // Visit https://www.sanity.io/docs/environment-variables to leanr more about using environment variables for local & production.
19+
autoUpdates: true,
1020
})

studio/sanity.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {presentationTool} from 'sanity/presentation'
55

66
import {schemaTypes} from './schemas'
77

8-
export const projectId = process.env.SANITY_STUDIO_PROJECT_ID!
9-
export const dataset = process.env.SANITY_STUDIO_DATASET!
8+
const projectId = process.env.SANITY_STUDIO_PROJECT_ID!
9+
const dataset = process.env.SANITY_STUDIO_DATASET!
1010

1111
export default defineConfig({
1212
name: 'sanity-template-sveltekit-clean',
File renamed without changes.

sveltekit-app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ node_modules
66
.env
77
.env.*
88
!.env.example
9-
!.env.template
109
vite.config.js.timestamp-*
1110
vite.config.ts.timestamp-*

0 commit comments

Comments
 (0)