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.
- Salesforce CLI
- Node >= 16
- Yarn >= 4
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.
Set up SSH access to GitHub if you haven't done so already.
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.
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
We use yarn because it is significantly faster than npm for our use case. See this command cheatsheet.
$ yarn install
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.
Once the project has been built, execute tests as indicated in the running tests section of the README.
The process of submitting a pull request is straightforward and generally follows the same pattern each time:
- Fork the UTAM JS Recipes repo
- Create a feature branch
- Make your changes
- Rebase
- Create a pull request
- Update the pull request
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
$ git checkout master
$ git pull origin master
$ git checkout -b <name-of-the-feature>
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.
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.
If you've never created a pull request before, follow these instructions.
$ 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.