We strongly encourage community feedback and contributions.
The foundation of the Microsoft Graph Toolkit is simplicity.
A developer should be able to quickly and easily learn to use the component/API.
Simplicity and a low barrier to entry are must-have features of every component and API. If you have any second thoughts about the complexity of a design, it is almost always much better to cut the feature from the current release and spend more time to get the design right for the next release.
You can always add to an API, you cannot ever remove anything from one. If the design does not feel right, and you ship it anyway, you are likely to regret having done so.
For general questions and support, please use Stack Overflow where questions should be tagged with microsoft-graph-toolkit
Please use GitHub Issues for bug reports and feature request.
We highly recommend you browse existing issues first.
- Install nodejs if you don't already have it.
- We recommend using VS Code as your editor
- We also recommend installing the recommended extensions (recommended by VS Code once the folder is opened)
Clone the repo and run the following in the terminal/command line/powershell:
npm install
npm start
The best way to get started with a new component is to use our snippets for scaffolding:
Note: The steps below assume you are using Visual Studio Code and you've installed all the recommended extensions.
-
Chose a name for your component. The component must be prefixed with
mgt
. For examplemgt-component
-
Create a new folder for your new component under
src
\components
and name it with the name of your component. -
Create a new typescript file in your new folder with the same name. Ex:
mgt-component.ts
-
Open the file and use the
mgtnew
snippet to scaffold the new component.To use a snippet, start typing the name of the snippet (
mgtnew
) and presstab
-
Tab through the generated code to set the name of your component.
-
Add your code!
Looking for something to work on? Issues marked good first issue are a good place to start.
You can also check the help wanted tag to find other issues to help with.
The Microsoft Graph Toolkit uses the GitHub flow where most development happens directly on the master
branch. The master
branch should always be in a healthy state which is ready for release.
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 tests and documentation have been added
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. Each pull request must be validated by at least two core members before being merged
Often, multiple iterations will be needed to responding to feedback from reviewers.
We encourage developers to follow the following guidance when submitting new features:
- Ensure the appropriate tests have been added in the
src\test
folder. Run the tests and make sure they all pass. - Ensure the code is properly documented following the tsdoc syntax
- Update the documentation when necessary
- Follow the accessibility guidance for web development
New features and components should folow the following accessibility implementation guidelines:
(for ease of use)
- Visit the following location: https://accessibilityinsights.io/en/
- Install the extension, and test
required:
-
aria-label
| string: "Login Button", "Megan Bowen" | - meaningful text should have identifiable labels for screen readers
example (mgt-login):
<button
class="popup-command"
@click=${this.logout}
aria-label="Sign Out">
Sign Out
</button>
-
tab-index/focus
| string: "0", "-1" | - components that are interactive or display information should be visibilly navigatable bytab
key control. Additional information in the aria label should be displayed when this feature is used.
example (mgt-people):
<mgt-person tabindex="0" ></mgt-person>
mgt-person:focus{
border-color: blue;
}
-
alt
| string: "person icon" | - any<img>
tag should containalt
text as well
example (mgt-person):
<img
title=${this.personDetails.displayName}
aria-label=${this.personDetails.displayName}
alt=${this.personDetails.displayName}
src=${this.personDetails.image as string}
/>
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.