Skip to content

Improve contributing guide and workflow #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ for Visual Studio Code.
Make sure you have the following binaries installed:

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

Expand All @@ -32,9 +30,15 @@ command:
yarn build
```

The output tmLanguage file `syntaxes/Scala.tmLanguage.json` is marked as ignored
in git and shouldn't be commited into the repository. The output file is
validated against the json schema before being written.
The output tmLanguage file `syntaxes/Scala.tmLanguage.json` is tracked by git,
and is committed on every release (see [#23](https://github.com/scala/vscode-scala-syntax/pull/23)).
The output file is validated against the json schema before being written.

To run the tests, run the following command:

```bash
yarn test
```

## Installing the extension locally

Expand All @@ -44,7 +48,7 @@ changes.
```bash
yarn install
yarn build
vsce package

# replace `*` below with the version of the generated vsix file
code --install-extension scala-*.vsix
```
2 changes: 1 addition & 1 deletion bin/ci-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NEW_VERSION=${TRAVIS_TAG#"v"}

# Build the extension
yarn install
yarn build
yarn build:syntax
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is yarn build:extension executed? Is that part of yarn vscode:publish?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is. From the vsce docs it seems that yarn vscode:publish (aka vsce publish) does the packaging before publishing, as it is the only command needed to publish.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

yarn test

# Update package.json and CHANGELOG.md
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@
"devDependencies": {
"@types/node": "^14.0.14",
"ajv": "^6.12.2",
"npm-run-all": "^4.1.5",
"ts-node": "^8.10.2",
"tsc": "^1.20150623.0",
"typescript": "^3.9.5",
"vsce": "^1.77.0",
"vscode-tmgrammar-test": "0.0.10"
},
"scripts": {
"vscode:prepublish": "test -f ./syntaxes/Scala.tmLanguage.json",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this prepublish script is actually doing anything useful? I tried messing with the json file but this doesn't result in failures of vscode:prepublish

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaximeKjaer , it just checks if the file ./syntaxes/Scala.tmLanguage.json exists.

"vscode:publish": "vsce publish --yarn",
"build": "ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json",
"test": "node scripts/unit.js && node scripts/snap.js"
"build": "npm-run-all build:syntax build:extension",
"build:syntax": "ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json",
"build:extension": "vsce package",
"test": "npm-run-all test:*",
"test:unit": "vscode-tmgrammar-test -s source.scala -g syntaxes/Scala.tmLanguage.json -t 'tests/unit/**/*.test.scala'",
"test:snap": "vscode-tmgrammar-snap -s source.scala -g syntaxes/Scala.tmLanguage.json -t 'tests/snap/**/*.test.scala'"
}
}
9 changes: 0 additions & 9 deletions scripts/snap.js

This file was deleted.

9 changes: 0 additions & 9 deletions scripts/unit.js

This file was deleted.

Loading