Contributor Guide
Getting startedβ
Machine setupβ
To work with the FAST monorepo you'll need Git, Node.js, and Npm setup on your machine.
FAST uses Git as its source control system. If you haven't already installed it, you can download it here or if you prefer a GUI-based approach, try GitHub Desktop.
Once Git is installed, you'll also need Node.js, which FAST uses as its JavaScript runtime, enabling its build and test scripts. Node.js instructions and downloads for your preferred OS can be found here.
Cloning the repositoryβ
Now that your machine is setup, you can clone the FAST repository. Open a terminal and run this command:
git clone https://github.com/microsoft/fast.git
Cloning via SSH:
git clone git@github.com:microsoft/fast.git
Installing and buildingβ
From within the fast
folder where you've cloned the repo, install all package dependencies and build all workspaces (local dependencies) with this command:
npm ci
After the initial install, you can re-build all workspaces in the future with:
npm run build
Testingβ
To run all tests for all packages, use the following command:
npm run test
This command can also be run from within individual package folders to execute only tests from that package.
Packages are located within the packages
folder of the repository. Each package has a package.json
file with a scripts
section that defines the commands available to you for common tasks such as build, test, lint, etc.
Submitting a pull requestβ
If you'd like to contribute by fixing a bug, implementing a feature, or even correcting typos in our documentation, you'll want to submit a pull request. Before submitting a pull request, be sure to rebase your branch (typically from master) or use the merge button provided by GitHub.
For additional details on branch management, read the branch guide documentation.
Change Filesβ
Any pull request which includes changes within the packages/*
directory requires a corresponding change file. Before pushing your changes to create a pull request, be sure you have included the necessary change file(s). To generate a change file, run npm run change
in the root of the repository. The generated file will be checked into the repo automatically for you as part of the process.
When working across feature branches, you'll need to target the branch using the following command: npm run change --branch origin/{branch-name}
.
Example: Generated change file:
{
"type": "minor",
"comment": "add fancy new feature to FASTElement",
"packageName": "@microsoft/fast-element",
"email": "name@example.com",
"dependentChangeType": "minor",
"date": "2021-03-01T19:10:06.323Z"
}
Running npm run change
will walk you through a CLI process for generating change files. The process will walk you through selecting the type of change as well as ask you to provide a description of any changes. As a convenience, the utility looks to provide recent commit messages for use in the description. For changes that do not affect the published package(s), please use "none" when selecting the change type.
More information on the change process and change types can be found on the Beachball website.
If you are addressing multiple issues which are unrelated, consider either doing multiple pull requests, or generating separate change files to ensure accurate generation of changelogs and versioning of packages.
If you are finding that your changes are either breaking changes or require multiple pull requests, open a discussion to discuss this.
Merging a pull requestβ
If you are merging a pull request, be sure to use the pull request title as the commit title. The title should follow the conventional commit guidelines.
Documenting breaking changesβ
Make sure to document the migration strategy in a MIGRATION.md
file in the package(s) that has breaking changes, eg. packages/web-components/fast-element/MIGRATION.md
.
Example of how to format MIGRATION.md
:
# Migrating from previous versions
## v1 to v2
- Export `Foo` has been renamed to `Bar`.
- `Bat` has been updated to use the new API [`BatConfig`](link/to/api).
Recommended Settings for Visual Studio Codeβ
You can use any code editor you like when working with the FAST monorepo. One of our favorites is Visual Studio Code. VS Code has great autocomplete support for TypeScript and JavaScript APIs, as well as a rich ecosystem of plugins.
Default VS Code settings for this project are configured as Workspace settings in the .vscode
directory. These settings override user settings for the workspace and are configured to ensure consistent code formatting across different environments. We also include a list of Workspace recommended extensions for VS Code for syntax highlighting and code linting.
Contribution policyβ
A βContributionβ is work voluntarily submitted to a project. This submitted work can include code, documentation, design, answering questions, or submitting and triaging issues.
Many contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to grant and do grant the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot automatically determines if you need to provide a CLA and decorates the pull request appropriately (e.g., label, comment). Follow the instructions provided by the bot. You only need to do this once across all repositories using our CLA.
Guiding principleβ
Owners, the steering committee, collaborators, code owners, and contributors work in concert with one another on behalf of the FAST community and prioritize the community's interests over their own.
The development, release, and work management processes must reflect this principle. Accepting contributions to the project requires a review by collaborators.
Governanceβ
Ownersβ
Owners have admin access and are responsible for the management, maintenance, and operations of the FAST repository.