-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12799 from keymanapp/feat/developer/12798-vscode-…
…ext-scaffolding-epic-ldml-editor feat(developer): scaffolding for Keyman Developer for VSCode🗼
- Loading branch information
Showing
17 changed files
with
1,224 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
out | ||
dist | ||
node_modules | ||
.vscode-test/ | ||
*.vsix | ||
!.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { defineConfig } from '@vscode/test-cli'; | ||
|
||
export default defineConfig({ | ||
files: 'out/test/**/*.test.js', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"ms-vscode.extension-test-runner" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}", | ||
"--disable-extensions", | ||
// Note: you can add an argument here with a workspace folder to launch on open | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"out": false // set this to true to hide the "out" folder with the compiled JS files | ||
}, | ||
"search.exclude": { | ||
"out": true // set this to false to include "out" folder in search results | ||
}, | ||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts | ||
"typescript.tsc.autoDetect": "off" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
src/** | ||
.gitignore | ||
.yarnrc | ||
vsc-extension-quickstart.md | ||
**/tsconfig.json | ||
**/eslint.config.mjs | ||
**/*.map | ||
**/*.ts | ||
**/.vscode-test.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Keyman Developer for VSCode | ||
|
||
This package is a standalone [VSCode](https://code.visualstudio.com) plugin. | ||
|
||
Its features include: | ||
|
||
- (no features yet) | ||
|
||
## Building | ||
|
||
From the command line, | ||
|
||
- `npm i` | ||
- `npm run compile` | ||
|
||
You can use `npm run watch` to keep compilation running, but see below. | ||
|
||
There is also a `build.sh` which works the usual way. | ||
|
||
## Running/Testing locally | ||
|
||
- Open this directory (`vscode-plugin`) in VSCode | ||
- From the Run and Debug toolbar, click Run Extension | ||
- A terminal will automatically open with `npm run watch` recompiling the project. | ||
- Choose a directory containing a .kpj file, and choose the **Terminal > Run Task…** menu item, or the **Tasks: Run Task** command. Select "kpj" and the name, and the compilation should occur in a terminal window. | ||
|
||
- You can use the **Developer: Reload Window** command to reload the `[extension development]` window with a new version of the plugin. | ||
|
||
## License | ||
|
||
Copyright (c) SIL Global. | ||
|
||
Keyman is an open source project distributed under the [MIT license](https://github.com/keymanapp/keyman/blob/master/LICENSE.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Compiles the Keyman Developer for VSCode plugin. | ||
# | ||
## START STANDARD BUILD SCRIPT INCLUDE | ||
# adjust relative paths as necessary | ||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" | ||
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh" | ||
## END STANDARD BUILD SCRIPT INCLUDE | ||
|
||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" | ||
|
||
builder_describe "Keyman Developer for VSCode module" \ | ||
"clean" \ | ||
"configure" \ | ||
"build" \ | ||
"test" \ | ||
"api" \ | ||
"publish" | ||
|
||
builder_describe_outputs \ | ||
configure /node_modules \ | ||
build /developer/src/vscode-plugin/out/extension.js | ||
|
||
builder_parse "$@" | ||
|
||
builder_run_action clean rm -rf ./out/ ./tsconfig.tsbuildinfo .vscode-test | ||
builder_run_action configure verify_npm_setup | ||
builder_run_action build npm run compile | ||
builder_run_action test npm test | ||
|
||
#------------------------------------------------------------------------------------------------------------------- | ||
|
||
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
|
||
export default [{ | ||
files: ["**/*.ts"], | ||
}, { | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
}, | ||
|
||
languageOptions: { | ||
parser: tsParser, | ||
ecmaVersion: 2022, | ||
sourceType: "module", | ||
}, | ||
|
||
rules: { | ||
"@typescript-eslint/naming-convention": ["warn", { | ||
selector: "import", | ||
format: ["camelCase", "PascalCase"], | ||
}], | ||
|
||
curly: "warn", | ||
eqeqeq: "warn", | ||
"no-throw-literal": "warn", | ||
semi: "warn", | ||
}, | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "@keymanapp/keyman-developer-vscode", | ||
"displayName": "Keyman Developer for VSCode", | ||
"description": "Plugin for compiling Keyman projects in VSCode", | ||
"engines": { | ||
"vscode": "^1.93.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/keymanapp/keyman.git" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"activationEvents": [], | ||
"main": "./out/extension.js", | ||
"contributes": { | ||
}, | ||
"scripts": { | ||
"vscode:prepublish": "npm run compile", | ||
"compile": "tsc -b ./", | ||
"watch": "tsc -watch -b ./", | ||
"pretest": "npm run compile && npm run lint", | ||
"lint": "eslint src", | ||
"test": "echo use 'ui-test' to run the test - TODO-LDML-EDITOR", | ||
"ui-test": "vscode-test" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "20.4.1", | ||
"@types/vscode": "^1.93.0", | ||
"@vscode/test-cli": "^0.0.10", | ||
"@vscode/test-electron": "^2.4.1" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"@keymanapp/common-types": "*", | ||
"@keymanapp/developer-utils": "*", | ||
"@keymanapp/kmc-kmn": "*", | ||
"@keymanapp/kmc-ldml": "*", | ||
"@keymanapp/kmc-package": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Keyman is copyright (C) SIL Global. MIT License. | ||
*/ | ||
|
||
import * as vscode from 'vscode'; | ||
|
||
/** called when extension is activated */ | ||
export function activate(context: vscode.ExtensionContext) { | ||
} | ||
|
||
/** called when extension is deactivated */ | ||
export function deactivate() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Keyman is copyright (C) SIL Global. MIT License. | ||
*/ | ||
|
||
import * as assert from 'assert'; | ||
|
||
// You can import and use all API from the 'vscode' module | ||
// as well as import your extension to test it | ||
import * as vscode from 'vscode'; | ||
// import * as myExtension from '../../extension'; | ||
|
||
suite('Extension Test Suite', () => { | ||
vscode.window.showInformationMessage('Start all tests.'); | ||
|
||
test('Sample test', () => { | ||
assert.strictEqual(-1, [1, 2, 3].indexOf(5)); | ||
assert.strictEqual(-1, [1, 2, 3].indexOf(0)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"module": "Node16", | ||
"target": "ES2022", | ||
"outDir": "out", | ||
"lib": [ | ||
"ES2022", | ||
"dom" | ||
], | ||
"sourceMap": true, | ||
"rootDir": "src", | ||
"strict": true, /* enable all strict type-checking options */ | ||
/* Additional Checks */ | ||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ | ||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ | ||
// "noUnusedParameters": true, /* Report errors on unused parameters. */ | ||
|
||
"paths": { | ||
"@keymanapp/common-types": [ "../../../common/web/types/src/main"], | ||
"@keymanapp/developer-utils": [ "../common/web/utils/src/index"], | ||
"@keymanapp/kmc-ldml": ["../kmc-ldml/src/main"], | ||
"@keymanapp/kmc-kmn": [ "../kmc-kmn/src/main"], | ||
"@keymanapp/kmc-package": ["../kmc-package/src/main"], | ||
}, | ||
}, | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.mts" | ||
], | ||
"references": [ | ||
{ "path": "../../../common/web/types" }, | ||
{ "path": "../common/web/utils" }, | ||
{ "path": "../kmc-ldml" }, | ||
{ "path": "../kmc-kmn" }, | ||
{ "path": "../kmc-package" }, | ||
] | ||
} |
Oops, something went wrong.