-
Notifications
You must be signed in to change notification settings - Fork 1
/
sanity.config.ts
73 lines (69 loc) · 2.09 KB
/
sanity.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {visionTool} from '@sanity/vision'
import {schemaTypes} from './schemaTypes'
import {myStructure} from './deskStructure'
import {codeInput} from '@sanity/code-input'
import {StreamLanguage} from '@codemirror/language'
export default defineConfig({
name: 'default',
title: process.env.SANITY_STUDIO_PROJECT_TITLE,
projectId: process.env.SANITY_STUDIO_PROJECT_ID!,
dataset: 'production',
plugins: [
structureTool({
// Adding my own deskStructure configuration
structure: myStructure,
}),
visionTool(),
codeInput({
codeModes: [
{
name: 'dart',
loader: () =>
import('@codemirror/lang-javascript').then(({javascript}) =>
javascript({jsx: false, typescript: true}),
),
},
{
name: 'typescript',
loader: () =>
import('@codemirror/lang-javascript').then(({javascript}) =>
javascript({jsx: false, typescript: true}),
),
},
{
name: 'jsx',
loader: () =>
import('@codemirror/lang-javascript').then(({javascript}) => javascript({jsx: true})),
},
{
name: 'tsx',
loader: () =>
import('@codemirror/lang-javascript').then(({javascript}) =>
javascript({jsx: true, typescript: true}),
),
},
{
name: 'groq',
loader: () =>
import('@codemirror/lang-javascript').then(
({javascriptLanguage}) => javascriptLanguage,
),
},
{name: 'kotlin', loader: () => import('@codemirror/lang-java').then(({java}) => java())},
{name: 'java', loader: () => import('@codemirror/lang-java').then(({java}) => java())},
{
name: 'yaml',
loader: () =>
import('@codemirror/legacy-modes/mode/yaml').then(({yaml}) =>
StreamLanguage.define(yaml),
),
},
],
}),
],
schema: {
types: schemaTypes,
},
})