|
1 | 1 | <!-- markdownlint-disable MD013 MD033 MD034 -->
|
2 | 2 | # Contributing
|
3 | 3 |
|
4 |
| -Contributions are very welcome ! |
| 4 | +Contributions are very welcome! |
5 | 5 |
|
6 |
| -Instructions : |
| 6 | +## Setup |
7 | 7 |
|
8 |
| -- Fork the repository and clone it on your computer |
9 |
| -- Install dependencies: `npm install` |
10 |
| -- Link npm package bundle: `npm link` |
11 |
| -- Update source code and add mocha tests for any code you create |
12 |
| -- Run `npm run lint:fix` then `npm run test` to check your updates didn't break anything |
13 |
| -- Once your code is ready, documented and tested, please make a [pull request](https://github.com/nvuillam/npm-groovy-lint/pulls) :) |
| 8 | +If you're a new contributor, first you need |
| 9 | +[Fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) |
| 10 | +and [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) |
| 11 | +it on your computer. |
| 12 | + |
| 13 | +Next you need to install the npm dependencies and link the bundle: |
| 14 | + |
| 15 | +```shell |
| 16 | +npm install |
| 17 | +npm link |
| 18 | +``` |
| 19 | + |
| 20 | +Now you have an local development install of npm-groovy-lint, you can make changes. |
| 21 | + |
| 22 | +## Testing |
| 23 | + |
| 24 | +If you have added new features or fixed an issue please make sure that you add |
| 25 | +tests to validate your changes. |
| 26 | + |
| 27 | +To test your code run: |
| 28 | + |
| 29 | +```shell |
| 30 | +npm run test |
| 31 | +``` |
| 32 | + |
| 33 | +Once your code is ready, documented and tested, run following to ensure your |
| 34 | +the code is linted and fully built and then submit a |
| 35 | +[pull request](https://github.com/nvuillam/npm-groovy-lint/pulls). |
| 36 | + |
| 37 | +```shell |
| 38 | +npm run dev:pre-commit |
| 39 | +``` |
| 40 | + |
| 41 | +## VsCode Groovy Lint Testing |
14 | 42 |
|
15 | 43 | If you need to test your updates in VsCode Groovy Lint before making your PR
|
16 | 44 |
|
17 | 45 | - Fork [VsCode Groovy Lint repo](https://github.com/nvuillam/vscode-groovy-lint) and clone it on your computer (with same root as your clone of npm-groovy-lint fork)
|
18 | 46 | - Run `npm run dev:lint-install-local-copy-vscode` to deploy your local updates to VsCode Groovy Lint extension development files
|
19 | 47 | - Launch VsCode Groovy Lint debug configuration `Groovy Lint Debug`
|
| 48 | + |
| 49 | +## Updating Libraries |
| 50 | + |
| 51 | +To update libraries download the new jar files into the correct place: |
| 52 | + |
| 53 | +- [Java libraries](lib/java/) |
| 54 | +- [Groovy libraries](lib/java/groovy/lib/) |
| 55 | + |
| 56 | +Once you have the new jars run the following to regenerate the new server jar: |
| 57 | + |
| 58 | +```shell |
| 59 | +npm run dev:pre-commit |
| 60 | +``` |
| 61 | + |
| 62 | +## Troubleshooting |
| 63 | + |
| 64 | +If [GitHub Action - Update check](https://github.com/nvuillam/npm-groovy-lint/actions/workflows/lint.yml) |
| 65 | +reports changes for [lib/java/CodeNarcServer.jar](lib/java/CodeNarcServer.jar) |
| 66 | +make sure you have run: |
| 67 | + |
| 68 | +```shell |
| 69 | +npm run dev:pre-commit |
| 70 | +``` |
| 71 | + |
| 72 | +If this has been run ensure you're running **exactly** the same version of node |
| 73 | +as the GitHub Action, as different node versions can impact how [zlib](https://www.zlib.net/) |
| 74 | +compresses the data in the jar file. |
| 75 | + |
| 76 | +To do determine the node version look at the output from the |
| 77 | +`Check for changes -> Install node`. For example in the following output node |
| 78 | +`18.18.2` is in use. |
| 79 | + |
| 80 | +```text |
| 81 | +Run actions/setup-node@v3 |
| 82 | +Found in cache @ /opt/hostedtoolcache/node/18.18.2/x64 |
| 83 | +Environment details |
| 84 | +``` |
| 85 | + |
| 86 | +You can use [nvm](https://github.com/nvm-sh/nvm) to switch easily between |
| 87 | +different node versions. |
0 commit comments