diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..91115ba --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,147 @@ +# Contributing Guide For plugin-app-dev + +This page lists the operational governance model of this project, as well as the recommendations and requirements for how to best contribute to plugin-app-dev. We strive to obey these as best as possible. As always, thanks for contributing – we hope these guidelines make it easier and shed some light on our approach and processes. + +# Governance Model + +## Salesforce Sponsored + +The intent and goal of open sourcing this project is to increase the contributor and user base. However, only Salesforce employees will be given `admin` rights and will be the final arbiters of what contributions are accepted or not. + +# Getting started + +Please join the community on the [Salesforce Trailblazer Community](https://trailhead.salesforce.com/trailblazer-community/groups). Also please make sure to review the [Salesforce CLI documentation](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm). + +# Issues, requests & ideas + +Use GitHub Issues page to submit issues, enhancement requests and discuss ideas. + +### Bug Reports and Fixes + +- If you find a bug, please search for it in the [Issues](https://github.com/salesforcecli/plugin-app-dev/issues), and if it isn't already tracked, + [create a new issue](https://github.com/salesforcecli/plugin-app-dev/issues/new). Fill out the "Bug Report" section of the issue template. Even if an Issue is closed, feel free to comment and add details, it will still + be reviewed. +- Issues that have already been identified as a bug (note: able to reproduce) will be labelled `bug`. +- If you'd like to submit a fix for a bug, [send a Pull Request](#creating_a_pull_request) and mention the Issue number. +- Include tests that isolate the bug and verifies that it was fixed. + +### New Features + +- If you'd like to add new functionality to this project, describe the problem you want to solve in a [new Issue](https://github.com/salesforcecli/plugin-app-dev/issues/new). +- Issues that have been identified as a feature request will be labelled `enhancement`. +- If you'd like to implement the new feature, please wait for feedback from the project + maintainers before spending too much time writing the code. In some cases, `enhancement`s may + not align well with the project objectives at the time. + +### Tests, Documentation, Miscellaneous + +- If you'd like to improve the tests, you want to make the documentation clearer, you have an + alternative implementation of something that may have advantages over the way its currently + done, or you have any other change, we would be happy to hear about it! +- If its a trivial change, go ahead and [send a Pull Request](#creating_a_pull_request) with the changes you have in mind. +- If not, [open an Issue](https://github.com/salesforcecli/plugin-app-dev/issues/new) to discuss the idea first. + +If you're new to our project and looking for some way to make your first contribution, look for +Issues labelled `good first contribution`. + +# Contribution Checklist + +- [x] Clean, simple, well styled code +- [x] Commits should be atomic and messages must be descriptive. Related issues should be mentioned by Issue number. +- [x] Comments + - Module-level & function-level comments. + - Comments on complex blocks of code or algorithms (include references to sources). +- [x] Tests + - The test suite must be complete and pass + - Increase code coverage, not versa. + - Try to achieve at least 95% code coverage on any new code. +- [x] Dependencies + - Minimize number of dependencies. + - Prefer Apache 2.0, BSD3, MIT, ISC and MPL licenses. +- [x] Reviews + - Changes must be approved via peer code review + +# Creating a Pull Request + +1. **Ensure the bug/feature was not already reported** by searching on GitHub under Issues. If none exists, create a new issue so that other contributors can keep track of what you are trying to add/fix and offer suggestions (or let you know if there is already an effort in progress). +2. **Fork** this repository. +3. **Clone** the forked repo to your machine. +4. **Create** a new branch to contain your work (e.g. `git checkout -b fix-issue-11`) +5. **Make your changes** and commit them with descriptive messages. +6. **Build and test** your changes locally: + ```bash + yarn && yarn build + yarn test + ``` +7. **Push** your work back up to your fork. (e.g. `git push origin fix-issue-11`) +8. **Submit** a Pull Request against the `main` branch and refer to the issue(s) you are fixing. Try not to pollute your pull request with unintended changes. Keep it simple and small. +9. **Sign** the Salesforce CLA (you will be prompted to do so when submitting the Pull Request) + +> **NOTE**: Be sure to [sync your fork](https://help.github.com/articles/syncing-a-fork/) before making a pull request. + +# Building the Plugin + +To build the plugin locally, make sure to have [Node.js](https://nodejs.org/) (>=18.0.0) and [Yarn](https://yarnpkg.com/) installed and run the following commands: + +```bash +# Clone the repository +git clone git@github.com:salesforcecli/plugin-app-dev.git +cd plugin-app-dev + +# Install the dependencies and compile +yarn && yarn build +``` + +To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file. + +```bash +# Run using local run file +./bin/dev webapp dev --help +``` + +There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine. + +```bash +# Link your plugin to the sf cli +sf plugins link . +# To verify +sf plugins +``` + +# Testing + +All code changes should include appropriate tests. The project uses: + +- **Unit tests**: Mocha and NYC for code coverage +- **NUT tests**: Integration tests for end-to-end scenarios + +```bash +# Run unit tests +yarn test + +# Run integration tests +yarn test:nuts + +# Run a specific test file +yarn test:only +``` + +# Contributor License Agreement ("CLA") + +In order to accept your pull request, we need you to submit a CLA. You only need +to do this once to work on any of Salesforce's open source projects. + +Complete your CLA here: + +# Issues + +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. Please also report any issues at https://github.com/forcedotcom/cli/issues. + +# Code of Conduct + +Please follow our [Code of Conduct](CODE_OF_CONDUCT.md). + +# License + +By contributing your code, you agree to license your contribution under the terms of our project [LICENSE](LICENSE.txt) and to sign the [Salesforce CLA](https://cla.salesforce.com/sign-cla) diff --git a/package.json b/package.json index 856d8f4..3b6217d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/plugin-app-dev", - "description": "", + "description": "A CLI plugin for building UI that integrates with Salesforce", "version": "1.2.0", "author": "Salesforce", "bugs": "https://github.com/forcedotcom/cli/issues",