Skip to content

Commit 5b19916

Browse files
Merge pull request #114 from scala/improve-contributing
Improve contributing guide and workflow
2 parents 0c98018 + d751b0e commit 5b19916

File tree

6 files changed

+344
-34
lines changed

6 files changed

+344
-34
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ for Visual Studio Code.
99
Make sure you have the following binaries installed:
1010

1111
- [`yarn`](https://yarnpkg.com/en/): to build the project
12-
- [`vsce`](https://code.visualstudio.com/api/working-with-extensions/publishing-extension):
13-
to package the extension for VS Code.
1412
- [`code`](https://code.visualstudio.com/docs/setup/mac): to launch VS Code from
1513
the terminal.
1614

@@ -32,9 +30,15 @@ command:
3230
yarn build
3331
```
3432

35-
The output tmLanguage file `syntaxes/Scala.tmLanguage.json` is marked as ignored
36-
in git and shouldn't be commited into the repository. The output file is
37-
validated against the json schema before being written.
33+
The output tmLanguage file `syntaxes/Scala.tmLanguage.json` is tracked by git,
34+
and is committed on every release (see [#23](https://github.com/scala/vscode-scala-syntax/pull/23)).
35+
The output file is validated against the json schema before being written.
36+
37+
To run the tests, run the following command:
38+
39+
```bash
40+
yarn test
41+
```
3842

3943
## Installing the extension locally
4044

@@ -44,7 +48,7 @@ changes.
4448
```bash
4549
yarn install
4650
yarn build
47-
vsce package
51+
4852
# replace `*` below with the version of the generated vsix file
4953
code --install-extension scala-*.vsix
5054
```

bin/ci-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ NEW_VERSION=${TRAVIS_TAG#"v"}
66

77
# Build the extension
88
yarn install
9-
yarn build
9+
yarn build:syntax
1010
yarn test
1111

1212
# Update package.json and CHANGELOG.md

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,20 @@
4444
"devDependencies": {
4545
"@types/node": "^14.0.14",
4646
"ajv": "^6.12.2",
47+
"npm-run-all": "^4.1.5",
4748
"ts-node": "^8.10.2",
48-
"tsc": "^1.20150623.0",
4949
"typescript": "^3.9.5",
5050
"vsce": "^1.77.0",
5151
"vscode-tmgrammar-test": "0.0.10"
5252
},
5353
"scripts": {
5454
"vscode:prepublish": "test -f ./syntaxes/Scala.tmLanguage.json",
5555
"vscode:publish": "vsce publish --yarn",
56-
"build": "ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json",
57-
"test": "node scripts/unit.js && node scripts/snap.js"
56+
"build": "npm-run-all build:syntax build:extension",
57+
"build:syntax": "ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json",
58+
"build:extension": "vsce package",
59+
"test": "npm-run-all test:*",
60+
"test:unit": "vscode-tmgrammar-test -s source.scala -g syntaxes/Scala.tmLanguage.json -t 'tests/unit/**/*.test.scala'",
61+
"test:snap": "vscode-tmgrammar-snap -s source.scala -g syntaxes/Scala.tmLanguage.json -t 'tests/snap/**/*.test.scala'"
5862
}
5963
}

scripts/snap.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

scripts/unit.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)