-
Notifications
You must be signed in to change notification settings - Fork 310
Home
Welcome to the Microsoft Graph Toolkit Wiki. These pages are primarily intended for those who wish to contribute to the project by submitting bug reports, suggesting new features, building extensions, commenting on new ideas, or even by submitting pull requests. We love community contributions so please do get involved.
Please refer to the sidebar (on the right) for details on Contributing.
If you are looking for more information on using Microsoft Graph Toolkit, please visit our Documentation and Component Playground!
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
If you are not sure how you can contribute to the toolkit, start with our issues. Issues labeled help wanted are good issues to submit a PR for. Issues labeled good first issue are great candidates to pick up if you are in the code for the first time. If you are contributing significant changes, please discuss with the assignee of the issue first before starting to work on the issue.
Once you are ready to do your first contribution, follow these steps to get setup for contributing code to the Microsoft Graph Toolkit!
- Setup the development environment
- Clone and build the project
- Develop
- Git workflow
- Submitting a pull request and participating in code review
- Quality assurance for new features
For more advanced topic, see the nav bar on the right.
If you have a really big idea, it would be best to raise an issue to discuss the idea before jumping straight to writing code.
Before cloning the repository, make sure you've installed the following prerequisites
-
Node.js (
Node.js 18
is supported) -
yarn is used as a package manager, to ensure this works run
corepack enable
-
VS Code (or your favorite code editor)
We also recommend to install the workplace recommended extensions once you've opened the cloned project in vscode.
-
Clone the repository and navigate to the project root.
git clone https://github.com/microsoftgraph/microsoft-graph-toolkit cd microsoft-graph-toolkit
-
Install all dependencies
yarn
-
Build the project
yarn build
NOTE it will take few minutes to install all dependencies and build the project
There are several ways to "run" the project and test your changes. All have pros and cons and you might find using a combination of these as you are developing and testing changes.
yarn start
The main start script will spin up a basic web server and open the browser pointing to the index.html in the root of the repo. This script will also start up the typescript compiler in watch mode which will reload the page as you are changing the code.
You can use index.html while developing and this is, for most scenarios, the fastest way to see your changes. However, please DO NOT commit any changes to this file unless you've already discussed this with the maintainers. We'd like to keep the index.html file simple and clean which makes it easier to use for debugging.
> yarn start:storybook
This script will launch storybook, the local version of mgt.dev. It will also watch for any changes to the source files and reload the story as you are working. See Storybook for how to use storybook for development.
The repository also contains one in-depth sample that makes it easier to developer and test specific features. The react-contoso sample is useful when building components and ensuring full compatibility with the @microsoft/mgt-react
package.
cd ./samples/react-contoso
yarn start
The Microsoft Graph Toolkit uses the GitHub flow where most development happens directly on the main
branch. The main
branch should always be in a healthy state which is ready for release. In general, you will use the main
branch as the base for your Pull Requests unless a maintainer has specified a different branch.
If your change is complex, please clean up the branch history before submitting a pull request. You can use git rebase to group your changes into a small number of commits which we can review one at a time.
When completing a pull request, we will generally squash your changes into a single commit. Please let us know if your pull request needs to be merged as separate commits.
Writing a good description for your pull request is crucial to help reviewers and future maintainers understand your change. Make sure to complete the pull request template to avoid delays. More detail is better.
- Link the issue you're addressing in the pull request. Each pull request must be linked to an issue.
- Describe why the change is being made and why you've chosen a particular solution.
- Describe any manual testing you performed to validate your change.
- Ensure the appropriate documentation has been added and linked to the Pull Request
- Write stories to demonstrate and help test your changes. The stories will be part of mgt.dev
Please submit one pull request per issue. Large pull requests which have unrelated changes can be difficult to review.
After submitting a pull request, core members of the project will review your code.
Often, multiple iterations will be needed to responding to feedback from reviewers.
When submitting a new Pull Request, we will be looking for the following items and may ask you to complete them before we can do a full review:
- Run
yarn build
locally to make sure the build will not fail and any autogenerated code has been committed - Write stories to demonstrate and help test your changes. Verify your changes have not broken any existing stories
- Test your feature in at least two browsers (Edge + 1 non-Chromium based browser)
- Ensure the code is properly documented following the jsdoc syntax. We expect all public APIs to be fully documented
- Update the documentation when necessary and link a documentation PR
- Follow the accessibility guidance for web development, and please refer to our specific accessibility guidance for component work
- If introducing breaking changes, make sure to document those and describe why they are necessary. Keep in mind, any breaking changes will delay your feature until the next major release.
- Use conventional commits to describe your changes. The git history on this project is used to automate release generation including version increments and updating the changelog.