Skip to content

Commit f9dfd40

Browse files
committed
Updated contributor guide and added start:storybook script
1 parent cf4e341 commit f9dfd40

File tree

3 files changed

+7
-165
lines changed

3 files changed

+7
-165
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -22,170 +22,10 @@ Please use [GitHub Issues](https://github.com/microsoftgraph/microsoft-graph-too
2222

2323
We highly recommend you browse existing issues first.
2424

25-
## Setting up the project
25+
## Contributing to the project
2626

27-
- Install [nodejs](https://nodejs.org) if you don't already have it.
28-
- We recommend using [VS Code](https://code.visualstudio.com/) as your editor
29-
- We also recommend installing the recommended extensions (recommended by VS Code once the folder is opened)
27+
[See our wiki](https://github.com/microsoftgraph/microsoft-graph-toolkit/wiki)
3028

31-
Clone the repo and run the following in the terminal/command line/powershell:
32-
33-
```bash
34-
# If you haven't already, install yarn globally
35-
npm i -g yarn
36-
37-
# Install dependencies in node_modules
38-
yarn
39-
40-
# Build
41-
yarn build
42-
43-
# Watch and serve
44-
yarn start
45-
```
46-
47-
## Creating a new component (quick start)
48-
49-
The best way to get started with a new component is to use our snippets for scaffolding:
50-
51-
> Note: The steps below assume you are using Visual Studio Code and you've installed all the recommended extensions.
52-
53-
1. Chose a name for your component. The component must be prefixed with `mgt`. For example `mgt-component`
54-
55-
1. Create a new folder for your new component under `src` \ `components` and name it with the name of your component.
56-
57-
1. Create a new typescript file in your new folder with the same name. Ex: `mgt-component.ts`
58-
59-
1. Open the file and use the `mgtnew` snippet to scaffold the new component.
60-
61-
> To use a snippet, start typing the name of the snippet (`mgtnew`) and press `tab`
62-
63-
1. Tab through the generated code to set the name of your component.
64-
65-
1. Add your code!
66-
67-
<!-- ## Testing the preview NPM package
68-
69-
If you want to install the preview package just once, run this command:
70-
71-
```bash
72-
npm install @microsoft/mgt --registry https://pkgs.dev.azure.com/microsoft-graph-toolkit/_packaging/MGT/npm/registry/
73-
```
74-
75-
If you want to be able to do it again later, by running `npm install`, add the preview feed to your project's '.npmrc' file (create a '.npmrc' file if you don't have one already):
76-
77-
```
78-
registry=https://pkgs.dev.azure.com/microsoft-graph-toolkit/_packaging/MGT/npm/registry/
79-
always-auth=true
80-
```
81-
82-
Then just install the package:
83-
84-
```bash
85-
npm install @microsoft/mgt
86-
```
87-
88-
[TODO: Make sure everybody can access this feed publicly.] -->
89-
90-
## Contributing
91-
92-
### Finding issues you can help with
93-
94-
Looking for something to work on?
95-
[Issues marked _good first issue_](https://github.com/microsoftgraph/microsoft-graph-toolkit/labels/good%20first%20issue)
96-
are a good place to start.
97-
98-
You can also check [the _help wanted_ tag](https://github.com/microsoftgraph/microsoft-graph-toolkit/labels/help%20wanted)
99-
to find other issues to help with.
100-
101-
### Git workflow
102-
103-
The Microsoft Graph Toolkit uses the [GitHub flow](https://guides.github.com/introduction/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.
104-
105-
If your change is complex, please clean up the branch history before submitting a pull request.
106-
You can use [git rebase](https://docs.microsoft.com/en-us/azure/devops/repos/git/rebase#squash-local-commits) to group your changes into a small number of commits which we can review one at a time.
107-
108-
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.
109-
110-
### Submitting a pull request and participating in code review
111-
112-
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.
113-
114-
- [Link the issue you're addressing in the pull request](https://github.com/blog/957-introducing-issue-mentions). Each pull request must be linked to an issue.
115-
- Describe _why_ the change is being made and _why_ you've chosen a particular solution.
116-
- Describe any manual testing you performed to validate your change.
117-
- Ensure the appropriate tests and [documentation](https://github.com/microsoftgraph/microsoft-graph-docs/tree/main/concepts/toolkit) have been added
118-
119-
Please submit one pull request per issue. Large pull requests which have unrelated changes can be difficult to review.
120-
121-
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
122-
123-
Often, multiple iterations will be needed to responding to feedback from reviewers.
124-
125-
### Quality assurance for new features
126-
127-
We encourage developers to follow the following guidance when submitting new features:
128-
129-
1. Ensure the appropriate tests have been added in the `src\test` folder. Run the tests and make sure they all pass.
130-
1. Ensure the code is properly documented following the [tsdoc](https://github.com/Microsoft/tsdoc) syntax
131-
1. Update the [documentation](https://github.com/microsoftgraph/microsoft-graph-docs/tree/main/concepts/toolkit) when necessary
132-
1. Follow the [accessibility guidance](https://developer.mozilla.org/en-US/docs/Web/Accessibility) for web development
133-
134-
135-
### Accessibility Guidelines
136-
137-
New features and components should folow the following accessibility implementation guidelines:
138-
139-
(for ease of use)
140-
1. Visit the following location: https://accessibilityinsights.io/en/
141-
2. Install the extension, and test
142-
143-
**required**:
144-
- [ ] `aria-label` | *string*: "Login Button", "Megan Bowen" | - meaningful text should have identifiable labels for screen readers
145-
146-
*example (mgt-login):*
147-
148-
```html
149-
<button
150-
class="popup-command"
151-
@click=${this.logout}
152-
aria-label="Sign Out">
153-
Sign Out
154-
</button>
155-
```
156-
157-
- [ ] `tab-index/focus` | *string*: "0", "-1" | - components that are interactive or display information should be **visibilly** navigatable by `tab` key control. Additional information in the aria label should be displayed when this feature is used.
158-
159-
*example (mgt-people):*
160-
161-
```html
162-
<mgt-person tabindex="0" ></mgt-person>
163-
```
164-
```css
165-
mgt-person:focus{
166-
border-color: blue;
167-
}
168-
```
169-
170-
- [ ] `alt` | *string*: "person icon" | - any `<img>` tag should contain `alt` text as well
171-
172-
*example (mgt-person):*
173-
174-
```html
175-
<img
176-
title=${this.personDetails.displayName}
177-
aria-label=${this.personDetails.displayName}
178-
alt=${this.personDetails.displayName}
179-
src=${this.personDetails.image as string}
180-
/>
181-
```
182-
183-
184-
<!-- ### Testing
185-
186-
Your changes should include tests to verify new functionality wherever possible.
187-
188-
[[TODO - how to add and run tests]] -->
18929

19030
## Code of Conduct
19131

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"serve": "es-dev-server --port 3000 --node-resolve --open --watch --compatibility none --app-index index.html",
2727
"serve:https": "es-dev-server --http2 --port 3000 --node-resolve --open --watch --compatibility none --app-index index.html",
2828
"start": "npm-run-all prettier:check watch:serve",
29+
"start:storybook": "npm-run-all storybook:dev storybook:watch",
2930
"start:https": "npm-run-all prettier:check build:esm watch:serve:https",
3031
"watch": "lerna run --parallel --stream --scope @microsoft/* build:watch ",
3132
"watch:serve": "npm-run-all --parallel watch serve",
@@ -34,10 +35,11 @@
3435
"prettier:check": "npm run prettier:base -- --list-different \"packages/**/*.{ts,tsx}\"",
3536
"prettier:write": "npm run prettier:base -- --write \"packages/**/*.{ts,tsx}\"",
3637
"storybook": "start-storybook -p 6006 -s assets",
37-
"storybook:dev": "npm run build:compile && npm run storybook:bundle && wca analyze packages --format json --outFile custom-elements.json",
38+
"storybook:dev": "npm run build:compile && wca analyze packages --format json --outFile custom-elements.json",
39+
"storybook:watch": "npm-run-all --parallel watch storybook:bundle:watch storybook",
40+
"storybook:bundle:watch": "rollup -c ./.storybook/rollup.config.js --watch",
3841
"storybook:build": "npm run storybook:dev && build-storybook -s assets && cpx .storybook/CNAME storybook-static",
3942
"storybook:deploy": "npm run storybook:build && storybook-to-ghpages -e storybook-static",
40-
"storybook:bundle": "rollup -c ./.storybook/rollup.config.js",
4143
"setLicense": "gulp setLicense"
4244
},
4345
"storybook-deployer": {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ To workaround this, use samples that are known to be compatible with a specific
136136

137137
## Contribute
138138

139-
We enthusiastically welcome contributions and feedback. Please read the [contributing guide](CONTRIBUTING.md) before you begin.
139+
We enthusiastically welcome contributions and feedback. Please read our [wiki](https://github.com/microsoftgraph/microsoft-graph-toolkit/wiki) and the [contributing guide](CONTRIBUTING.md) before you begin.
140140

141141
### Code Contribution Challenge
142142
There are many exciting new features or interesting bugs that have been left behind because our team is small with limited capacity. We would love your help! We have tagged these issues with 'help wanted' and/or 'good first issue'. We added them into project board [Community Love](https://github.com/microsoftgraph/microsoft-graph-toolkit/projects/29) for easy tracking. If you see anything you would like to contribute to, you can reach out to [email protected] or tag one of us ([Beth](https://github.com/beth-panx), [Elise](https://github.com/elisenyang), [Nick](https://github.com/vogtn), [Nikola](https://github.com/nmetulev), and [Shane](https://github.com/shweaver-MSFT)) in the issue for help or further discussion. By submitting a PR to solve an issue mentioned above, you can enter to win some exciting prizes! We have some cool socks and t-shirts waiting for you. Check out the official rules for [Code Contribution Challenge](contest.md). The contest will continue until March 2021 where prizes are awarded every month from now on.

0 commit comments

Comments
 (0)