-
Notifications
You must be signed in to change notification settings - Fork 2
/
package.json
283 lines (283 loc) · 9.3 KB
/
package.json
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
{
"name": "anki-editor",
"displayName": "Anki Editor",
"description": "Edit Anki card templates in Visual Studio Code with syntax highlighting and intellisense.",
"version": "1.0.8",
"author": "Pedro Bronsveld",
"publisher": "pedro-bronsveld",
"repository": {
"type": "git",
"url": "https://github.com/Pedro-Bronsveld/anki-editor"
},
"license": "MIT",
"icon": "resources/icons/anki-editor-icon.png",
"engines": {
"vscode": "^1.74.0"
},
"categories": [
"Programming Languages",
"Education"
],
"activationEvents": [
"onCommand:anki-editor.helloWorld",
"anki-editor.workspaceInit",
"onFileSystem:anki-editor"
],
"main": "./out/extension.js",
"browser": "./out/web-extension.js",
"contributes": {
"commands": [
{
"command": "anki-editor.openAsWorkspaceFolder",
"title": "Open as workspace folder",
"category": "Anki Editor",
"icon": "$(root-folder-opened)"
},
{
"command": "anki-editor.addFolderToWorkspace",
"title": "Add to current workspace as folder",
"category": "Anki Editor",
"icon": "$(folder-library)"
},
{
"command": "anki-editor.refreshNoteTypesTree",
"title": "Refresh Note Types",
"category": "Anki Editor",
"icon": "$(refresh)"
},
{
"command": "anki-editor.clearCache",
"title": "Clear Cache",
"category": "Anki Editor",
"icon": "$(clear-all)"
}
],
"viewsContainers": {
"activitybar": [
{
"id": "anki-editor",
"title": "Anki Editor",
"icon": "resources/icons/activity-bar-icon.svg"
}
]
},
"views": {
"anki-editor": [
{
"id": "note-types-tree",
"name": "Note Types"
}
]
},
"menus": {
"view/title": [
{
"command": "anki-editor.refreshNoteTypesTree",
"when": "view == note-types-tree",
"group": "navigation"
},
{
"command": "anki-editor.openAsWorkspaceFolder",
"when": "view == note-types-tree",
"group": "navigation"
},
{
"command": "anki-editor.addFolderToWorkspace",
"when": "view == note-types-tree",
"group": "navigation"
}
]
},
"languages": [
{
"id": "anki-template",
"aliases": [
"Anki Template",
"anki-template"
],
"extensions": [
".template.anki"
],
"configuration": "./languages/language-configuration.json",
"icon": {
"dark": "resources/icons/anki-template-file-icon.svg",
"light": "resources/icons/anki-template-file-icon.svg"
}
}
],
"grammars": [
{
"language": "anki-template",
"scopeName": "text.html.anki",
"path": "./languages/syntaxes/anki.tmLanguage.json",
"embeddedLanguages": {
"text.html": "html",
"source.anki": "anki-template",
"source.js": "javascript",
"source.css": "css"
}
},
{
"path": "./languages/syntaxes/anki-template.injection.json",
"scopeName": "source.anki",
"injectTo": [
"text.html.anki"
]
}
],
"configuration": {
"title": "Anki Editor",
"properties": {
"anki-editor.origin": {
"title": "Anki-Connect Origin",
"type": "string",
"default": "http://127.0.0.1:8765",
"pattern": "^https?://",
"patternErrorMessage": "Must start with http:// or https://",
"examples": [
"http://localhost:8765"
],
"description": "Url that Anki-Connect can be reached at."
},
"anki-editor.apiKey": {
"title": "Anki-Connect API key",
"default": null,
"type": "string",
"markdownDescription": "Anki-Connect API key.\n\nThis must match the value set for `\"apiKey\"` in the Anki-Connect config if it's set to anything other than `null`."
},
"anki-editor.invalidFieldDiagnostics": {
"title": "Invalid Field Diagnostics",
"type": "boolean",
"default": true,
"description": "Show errors for field names that are not part of the note type."
},
"anki-editor.invalidFilterDiagnostics": {
"title": "Invalid Filter Diagnostics",
"type": "boolean",
"default": true,
"description": "Show errors for filter names that are not built into Anki."
},
"anki-editor.missingFieldDiagnostics": {
"title": "Missing Field Diagnostics",
"type": "boolean",
"default": true,
"description": "Show an error when a replacement does not contain a field name."
},
"anki-editor.customFieldNames": {
"title": "Custom Fields",
"type": "array",
"items": {
"type": "string",
"pattern": "^[^#^/\\s:{}\"]+([^:{}\\s\"]|\\s(?!\\s*(}}|$)))*$",
"patternErrorMessage": "Restrictions for custom field:\n• Can't start with # ^ /\n• Can't contain : \" { }\n• Can't start or end with spaces"
},
"default": [],
"markdownDescription": "Extra field names to show in completion suggestions, and to ignore when checking errors."
},
"anki-editor.customFilterNames": {
"title": "Custom Filters",
"type": "array",
"items": {
"type": [
"string",
"object"
],
"anyOf": [
{
"type": "string",
"pattern": "^[^#^/\\s:{}\"]+$",
"patternErrorMessage": "Custom filter names can't contain spaces or # ^ / : \" { }",
"examples": [
"custom-filter"
]
},
{
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^[^#^/\\s:{}\"]+$",
"patternErrorMessage": "Custom filter names can't contain spaces or # ^ / : \" { }",
"description": "Name of the custom filter.",
"examples": [
"custom-filter"
]
},
"fieldRequired": {
"type": "boolean",
"default": true,
"description": "Specifies if a field name is required when this filter is used.\nDefaults to true."
}
},
"required": [
"name"
],
"examples": [
{
"name": "custom-filter",
"fieldRequired": true
}
]
}
]
},
"markdownDescription": "Extra filters to show in completion suggestions, and to ignore when checking for errors.\nA custom filter can be defined as a string such as `\"custom-filter\"` or an object such as `{ \"name\": \"custom-filter\", \"fieldRequired\": true }`."
},
"anki-editor.checkJsLevel": {
"title": "Javascript type checking level",
"type": [
"string"
],
"enum": [
"strict",
"default",
"off"
],
"enumDescriptions": [
"Strict Typescript-like type checking in embedded javascript in Anki card templates.",
"Type checking similar VSCode's default type checking in HTML and Javascript files.",
"No type checking of embedded Javascript in Anki card templates."
],
"default": "default",
"description": "Set the level of type checking used for embedded Javascript in Anki card templates."
}
}
}
},
"scripts": {
"esbuild-common": "esbuild ./src/extension.ts --bundle --external:vscode --format=cjs",
"esbuild-native": "npm run esbuild-common -- --outfile=out/extension.js --main-fields=module,main --platform=node",
"esbuild-web": "npm run esbuild-common -- --outfile=out/web-extension.js --main-fields=browser,module,main --platform=browser",
"build-prod": "npm run esbuild-native -- --minify & npm run esbuild-web -- --minify",
"build": "npm run esbuild-native -- --sourcemap",
"watch": "npm run build -- --watch",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js",
"test-compile": "tsc -p ./",
"vscode:prepublish": "npm run build-prod",
"package": "vsce package",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/glob": "^8.0.0",
"@types/mocha": "^10.0.1",
"@types/node": "^22.5.4",
"@types/vscode": "^1.74.0",
"@typescript-eslint/eslint-plugin": "^8.5.0",
"@typescript-eslint/parser": "^8.5.0",
"@vscode/test-electron": "^2.2.0",
"@vscode/vsce": "^3.1.0",
"esbuild": "^0.23.1",
"eslint": "^9.10.0",
"glob": "^11.0.0",
"mocha": "^10.1.0",
"typescript": "^5.6.2"
},
"dependencies": {
"@ts-morph/bootstrap": "^0.24.0",
"axios": "^1.7.7",
"vscode-css-languageservice": "^6.2.3",
"vscode-html-languageservice": "^5.0.4"
}
}