-
-
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.
feat(developer): VSCode plugin for building
- initial checkin of previous code - add README.md - add build.sh Fixes: #12756
- Loading branch information
Showing
15 changed files
with
4,260 additions
and
0 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,5 @@ | ||
out | ||
dist | ||
node_modules | ||
.vscode-test/ | ||
*.vsix |
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,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 - keyman-vscode-plugin | ||
|
||
This package is a standalone [VSCode](https://code.visualstudio.com) plugin which offers: | ||
|
||
- a Build Task for building .kpj files into a package | ||
- when building the .kpj file, all .kmn and .xml (LDML keyboard) files will be compiled as well | ||
- The Build Task assumes that the .kpj will have the same name as the directory. So, `.../some_keyboard/some_keyboard.kpj` | ||
|
||
## 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 (`keyman-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](../../../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,48 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Compiles the keyman-vscode-plugin 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 keyman-vscode-plugin module" \ | ||
"configure" \ | ||
"build" \ | ||
"clean" \ | ||
"test" | ||
|
||
builder_describe_outputs \ | ||
configure /node_modules \ | ||
build /out/extension.js | ||
|
||
builder_parse "$@" | ||
|
||
function do_clean() { | ||
rm -rf ./out/ ./tsconfig.tsbuildinfo .vscode-test | ||
} | ||
|
||
function do_configure() { | ||
verify_npm_setup | ||
} | ||
|
||
function do_build() { | ||
npm run compile | ||
} | ||
|
||
function do_test() { | ||
npm test | ||
} | ||
|
||
builder_run_action clean do_clean | ||
builder_run_action configure do_configure | ||
builder_run_action build do_build | ||
builder_run_action test do_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", | ||
}, | ||
}]; |
Oops, something went wrong.