Thanks for showing interest in contributing!
The following is a set of guidelines for contributing to Catalyst. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
Catalyst is a monorepo that contains the code for the Catalyst Next.js application inside of core/, and supporting packages such as the GraphQL API client and the create-catalyst CLI in packages/.
The default branch for this repository is called canary. This is the primary development branch where active development takes place, including the introduction of new features, bug fixes, and other changes before they are released in stable versions.
To contribute to the canary branch, you can create a new branch off of canary and submit a PR against that branch.
In addition to canary, we also maintain the integrations/makeswift branch, which contains additional code required to integrate with Makeswift.
To contribute to the integrations/makeswift branch, you can create a new branch off of integrations/makeswift and submit a PR against that branch.
Except for the additional code required to integrate with Makeswift, the integrations/makeswift branch is a mirror of the canary branch. This means that the integrations/makeswift branch should be kept in sync with the canary branch as much as possible.
In order to complete the following steps, you will need to have met the following prerequisites:
- You have a remote named
originpointing to thebigcommerce/catalystrepository on GitHub. - You have rights to push to the
integrations/makeswiftbranch on GitHub.
-
Fetch latest from
origingit fetch origin
-
Create a branch to perform a merge from
canarygit checkout -B sync-integrations-makeswift origin/integrations/makeswift
Tip
The -B flag means "create branch or reset existing branch":
- If the local branch doesn't exist, it creates it from
origin/integrations/makeswift - If the local branch exists, it resets it to match
origin/integrations/makeswift
-
Merge
canaryand resolve merge conflicts, if necessary:git merge canary
Warning
Gotchas when merging canary into integrations/makeswift:
- The
namefield incore/package.jsonshould remain@bigcommerce/catalyst-makeswift - The
versionfield incore/package.jsonshould remain whatever the latest published@bigcommerce/catalyst-makeswiftversion was
-
After resolving any merge conflicts, open a new PR in GitHub to merge your
sync-integrations-makeswiftintointegrations/makeswift. This PR should be code reviewed and approved before the next steps. -
Rebase
integrations/makeswiftto establish new merge basegit checkout -B integrations/makeswift origin/integrations/makeswift git rebase sync-integrations-makeswift
-
Push the changes up to GitHub:
git push origin integrations/makeswift
This should close the PR in GitHub automatically.
Important
Do not squash or rebase-and-merge PRs into integrations/makeswift. Always use a true merge commit or rebase locally (as shown below). This is to preserve the merge commit and establish a new merge base between canary and integrations/makeswift.
Catalyst uses Changesets to manage version bumps, changelogs, and publishing. Releases happen in two stages:
- Cut a release from
canary - Sync that release into
integrations/makeswiftand cut again
This ensures integrations/makeswift remains a faithful mirror of canary while including its additional integration code.
- Begin the release process by merging the Version Packages (
canary) PR. When.changeset/files exist oncanary, a GitHub Action opens a Version Packages (canary) PR. This PR consolidates pending changesets, bumps versions, and updates changelogs. Merging this PR should publish new tags to GitHub, and optionally publish new package versions to NPM.
-
Follow steps 1-6 under "Keeping
integrations/makeswiftin sync withcanary" -
IMPORTANT: After step 6, you'll need to open another PR into
integrations/makeswift- Ensure a local
integrations/makeswiftbranch exists and is up to date (git checkout -B integrations/makeswift origin/integrations/makeswift) - Run
git fetch originand create a new branch fromintegrations/makeswift(git checkout -B bump-version origin/integrations/makeswift) - From this new
bump-versionbranch, runpnpm changeset - Select
@bigcommerce/catalyst-makeswift - For choosing between a
patch/minor/majorbump, you should copy the bump from Stage 1. (e.g., if@bigcommerce/catalyst-corewent from1.1.0to1.2.0, chooseminor) - Commit the generated changeset file and open a PR to merge this branch into
integrations/makeswift - Once merged, you can proceed to the next step
- Ensure a local
-
Merge the Version Packages (
integrations/makeswift) PR: Changesets will open another PR (similar to Stage 1) bumping@bigcommerce/catalyst-makeswift. Merge it following the same process. This cuts a new release of the Makeswift variant.
- Tags and Releases: Confirm tags exist for both
@bigcommerce/catalyst-coreand@bigcommerce/catalyst-makeswift. If needed, updatelatesttags in GitHub manually. - Release cadence: Teams typically review on Wednesdays whether to cut a release, but you may cut releases more frequently as needed.
- Consider reporting bugs, contributing to test coverage, or helping spread the word about Catalyst.
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference pull requests and external links liberally
Thank you again for your interest in contributing to Catalyst!