|
| 1 | +<!-- markdownlint-disable MD041 --> |
| 2 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 3 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 4 | +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* |
| 5 | + |
| 6 | +- [Contributing guidelines](#contributing-guidelines) |
| 7 | + - [Contributions](#contributions) |
| 8 | + - [Certificate of Origin](#certificate-of-origin) |
| 9 | + - [Contributing A Patch](#contributing-a-patch) |
| 10 | + - [Issue and Pull Request Management](#issue-and-pull-request-management) |
| 11 | + - [Development](#development) |
| 12 | + - [Early Access](#early-access) |
| 13 | + - [Useful Links](#useful-links) |
| 14 | + - [Environment Preparations](#environment-preparations) |
| 15 | + - [Project Layout](#project-layout) |
| 16 | + - [NPM Scripts](#npm-scripts) |
| 17 | + - [Launch Configurations](#launch-configurations) |
| 18 | + |
| 19 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 20 | + |
| 21 | +# Contributing guidelines |
| 22 | + |
| 23 | +## Contributions |
| 24 | + |
| 25 | +All contributions to the repository must be submitted under the terms of the [Apache Public License 2.0](https://www.apache.org/licenses/LICENSE-2.0). |
| 26 | + |
| 27 | +## Certificate of Origin |
| 28 | + |
| 29 | +By contributing to this project you agree to the Developer Certificate of |
| 30 | +Origin (DCO). This document was created by the Linux Kernel community and is a |
| 31 | +simple statement that you, as a contributor, have the legal right to make the |
| 32 | +contribution. See the [DCO](DCO) file for details. |
| 33 | + |
| 34 | +## Contributing A Patch |
| 35 | + |
| 36 | +1. Submit an issue describing your proposed change to the repo in question. |
| 37 | +2. The [repo owners](OWNERS) will respond to your issue promptly. |
| 38 | +3. Fork the desired repo, develop and test your code changes. |
| 39 | +4. Submit a pull request. |
| 40 | + |
| 41 | +## Issue and Pull Request Management |
| 42 | + |
| 43 | +Anyone may comment on issues and submit reviews for pull requests. However, in |
| 44 | +order to be assigned an issue or pull request, you must be a member of the |
| 45 | +[open-cluster-management](https://github.com/open-cluster-management-io) GitHub organization. |
| 46 | + |
| 47 | +Repo maintainers can assign you an issue or pull request by leaving a |
| 48 | +`/assign <your Github ID>` comment on the issue or pull request. |
| 49 | + |
| 50 | +## Development |
| 51 | + |
| 52 | +### Early Access |
| 53 | + |
| 54 | +Early-access pre-release is available [here][early-access] and will always reflect the current development snapshot from the *main* branch. |
| 55 | + |
| 56 | +### Useful Links |
| 57 | + |
| 58 | +- [VSCode API Documentation][vscode-ext-api] |
| 59 | +- [VSCode API References][vscode-api-ref] |
| 60 | + |
| 61 | +### Environment Preparations |
| 62 | + |
| 63 | +All you need is [VSCode][vscode] and [NodeJS][nodejs]. |
| 64 | + |
| 65 | +### Project Layout |
| 66 | + |
| 67 | +- [src][repo-src] contains the source code for the extension. |
| 68 | +- [test][repo-test] contains the sources for the unit tests. |
| 69 | +- [snippets][repo-snippets] contains the snippets offered by the extension. |
| 70 | +- [templates][repo-templates] contains template files for orchestrating new projects. |
| 71 | +- [images][repo-images] contains various images used throughout the project. |
| 72 | +- [webview-ui][repo-webview-ui] contains the sources for *react* module providing the *web view*. |
| 73 | + |
| 74 | +### NPM Scripts |
| 75 | + |
| 76 | +Install module dependencies: |
| 77 | + |
| 78 | +```bash |
| 79 | +npm i |
| 80 | +``` |
| 81 | + |
| 82 | +Lint the project with *eslint*: |
| 83 | + |
| 84 | +```bash |
| 85 | +npm run lint |
| 86 | +``` |
| 87 | + |
| 88 | +Test the project (sandbox tests): |
| 89 | + |
| 90 | +```bash |
| 91 | +npm test |
| 92 | +``` |
| 93 | + |
| 94 | +Test the project skipping "slow" tests (sandbox tests): |
| 95 | +> New "slow" tests should include `@slow` in their description. |
| 96 | +
|
| 97 | +```bash |
| 98 | +npm run test:quick |
| 99 | +``` |
| 100 | + |
| 101 | +Print and verify coverage ratio (requires tests to be executed first): |
| 102 | + |
| 103 | +```bash |
| 104 | +npm run cov |
| 105 | +``` |
| 106 | + |
| 107 | +Create an *html* coverage report (requires tests to be executed first): |
| 108 | + |
| 109 | +```bash |
| 110 | +npm run cov:rep |
| 111 | +``` |
| 112 | + |
| 113 | +Build the project (including the *web project*): |
| 114 | + |
| 115 | +```bash |
| 116 | +npm run build |
| 117 | + |
| 118 | +``` |
| 119 | + |
| 120 | +List all available scripts: |
| 121 | + |
| 122 | +```bash |
| 123 | +npm run |
| 124 | +``` |
| 125 | + |
| 126 | +### Launch Configurations |
| 127 | + |
| 128 | +- *Run Extension* will run the extension in a separate *vscode instance*. |
| 129 | +- *Extension Tests* will execute the tests in debug mode. |
| 130 | + |
| 131 | +<!-- LINKS --> |
| 132 | +[early-access]: https://github.com/open-cluster-management-io/ocm-vscode-extension/releases/tag/early-access |
| 133 | +[nodejs]: https://nodejs.org |
| 134 | +[vscode-api-ref]: https://code.visualstudio.com/api/references/vscode-api |
| 135 | +[vscode-ext-api]: https://code.visualstudio.com/api |
| 136 | +[vscode]: https://code.visualstudio.com/ |
| 137 | +<!-- CODE LINKS --> |
| 138 | +[repo-images]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/images |
| 139 | +[repo-snippets]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/snippets |
| 140 | +[repo-src]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/src |
| 141 | +[repo-templates]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/templates |
| 142 | +[repo-test]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/test |
| 143 | +[repo-webview-ui]: https://github.com/open-cluster-management-io/ocm-vscode-extension/tree/main/webview-ui |
0 commit comments