Skip to content

Commit

Permalink
feat: use vscode-ext-gen to provide better type safety (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu authored Jul 11, 2024
1 parent 21b16bf commit f757327
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 68 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"**/*.d.ts",
"**/*.json",
"pkg",
"bin"
"bin",
"src/generated-meta.ts"
],
"rules": {
"no-console": ["warn", { "allow": ["warn", "error"] }]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
*.vsix
pkg
bin
src/generated-meta.ts
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"emeraldwalk.RunOnSave"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"emeraldwalk.runonsave": {
"commands": [
{
"match": "package.json",
"isAsync": true,
"cmd": "npm run update"
}
]
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"i18n-ally.localesPaths": [
Expand Down
33 changes: 29 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"test": "node ./out/test/runTest.js",
"publish": "vsce publish --no-dependencies ",
"package": "vsce package --no-dependencies "
"publish": "vsce publish --no-dependencies",
"package": "vsce package --no-dependencies",
"update": "npx vscode-ext-gen",
"prepare": "pnpm run update"
},
"devDependencies": {
"@antfu/eslint-config": "^0.39.8",
Expand All @@ -55,48 +57,71 @@
"typescript": "^5.4.5",
"varname": "^6.2.0",
"vsce": "^2.15.0",
"vscode-ext-gen": "^0.3.1",
"vscode-oniguruma": "^1.7.0",
"vscode-textmate": "^9.0.0"
},
"contributes": {
"commands": [
{
"command": "interline-translate.translateSelectedText",
"category": "Interline Translate",
"title": "Translate Selected Text"
},
{
"command": "interline-translate.toggleTranslatingDocuments",
"category": "Interline Translate",
"title": "Toggle translating documents"
},
{
"command": "interline-translate.startTranslatingDocuments",
"category": "Interline Translate",
"title": "Start translating documents"
},
{
"command": "interline-translate.stopTranslatingDocuments",
"category": "Interline Translate",
"title": "Stop translating documents"
},
{
"command": "interline-translate.displayOriginalText",
"category": "Interline Translate",
"title": "Display original text"
},
{
"command": "interline-translate.translateTheDocumentOnce",
"title": "translate the document once"
"category": "Interline Translate",
"title": "Translate the document once"
},
{
"command": "interline-translate.showTranslatePopmenu",
"title": "Interline Translate"
"category": "Interline Translate",
"title": "Show menu"
},
{
"command": "interline-translate.clearTranslationCache",
"category": "Interline Translate",
"title": "Clear translation cache"
},
{
"command": "interline-translate.showDebugReport",
"category": "Interline Translate",
"title": "Show debug report"
},
{
"command": "interline-translate.markKnownWords",
"category": "Interline Translate",
"title": "Mark known words"
}
],
"menus": {
"commandPalette": [
{
"command": "interline-translate.markKnownWords",
"when": "false"
}
]
},
"configuration": {
"type": "object",
"title": "Interline Translate",
Expand Down
Loading

0 comments on commit f757327

Please sign in to comment.