Skip to content

Latest commit

 

History

History
153 lines (102 loc) · 5.37 KB

CONTRIBUTING.md

File metadata and controls

153 lines (102 loc) · 5.37 KB

Contributing to UTAM JavaScript recipes

We encourage the developer community to contribute to UTAM JavaScript recipes.

Note: It might take months before we can review a pull request. Please be patient!

The UTAM JavaScript recipes project has a Code of Conduct to which all contributors must adhere.

Requirements

This project uses Volta to ensure that all the contributors share the same version of Node and Yarn for development. If you are considering making frequent contributions to this project, we recommend installing Volta.

If you install Volta, run this command to install node and yarn:

$ volta install node yarn

If you're having issues with Yarn and Volta, see Yarn's documentation on Corepack.

Installation

Set up SSH access to GitHub if you haven't done so already.

1) Setup your Salesforce DX environment

If you don't have an SFDX environment set up, you need to set up one before contributing to the project. To set up your Salesforce DX environment, follow the Prerequisites and Org Setup sections from the README.

2) Fork the repository

We recommend that you fork the salesforce/utam-js-recipes repo.

After you fork the repo, clone your fork in your local workspace:

$ git clone [email protected]<YOUR-USERNAME>/utam-js-recipes.git
$ cd utam-js-recipes

3) Install dependencies

We use yarn because it is significantly faster than npm for our use case. See this command cheatsheet.

$ yarn install

4) Build the project

Execute yarn build to build the project and generate page objects.

If you change a page object or test later, run yarn build to update the project.

5) Run Tests

Once the project has been built, execute tests as indicated in the running tests section of the README.

Git Workflow

The process of submitting a pull request is straightforward and generally follows the same pattern each time:

  1. Fork the UTAM JS Recipes repo
  2. Create a feature branch
  3. Make your changes
  4. Rebase
  5. Create a pull request
  6. Update the pull request

Fork the UTAM JS Recipes repo

Fork the salesforce/utam-js-recipes repo. Clone your fork in your local workspace and configure your remote repository settings.

$ git clone [email protected]:<YOUR-USERNAME>/utam-js-recipes.git
$ cd utam-js-recipes
$ git remote add upstream [email protected]:salesforce/utam-js-recipes.git

Create a feature branch

$ git checkout master
$ git pull origin master
$ git checkout -b <name-of-the-feature>

Make your changes

Modify the files, lint, format and commit your code using the following commands:

$ git add <path/to/file/to/commit>
$ git commit
$ git push origin <username>/<name-of-the-feature>

The above commands will commit the files into your feature branch. You can keep pushing new changes into the same branch until you are ready to create a pull request.

Rebase

Sometimes your feature branch will get stale with respect to the master branch, and it will require a rebase. The following steps can help:

$ git checkout master
$ git pull origin master
$ git checkout <name-of-the-feature>
$ git rebase upstream/master

Note: If no conflicts arise, these commands will ensure that your changes are applied on top of the master branch. Any conflicts will have to be manually resolved.

Create a pull request

If you've never created a pull request before, follow these instructions.

Update the pull request

$ git fetch origin
$ git rebase origin/${base_branch}

# If there were no merge conflicts in the rebase
$ git push origin ${feature_branch}

# If there was a merge conflict that was resolved
$ git push origin ${feature_branch} --force

Note: If more changes are needed as part of the pull request, just keep committing and pushing your feature branch as described above and the pull request will automatically update.