Skip to content

Commit 7dbea20

Browse files
authored
Merge pull request #222 from puppetlabs/update-contributing-docs
Update contributing docs
2 parents 385456c + 0e4d81a commit 7dbea20

File tree

19 files changed

+130
-288
lines changed

19 files changed

+130
-288
lines changed

CONTRIBUTING.md

+20-12
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
The Puppet Design System is a cross-functional team effort across Puppet with shared ownership where contributions are encouraged. Though designed for and maintained by Puppet, outside PRs are welcome. A good place to start is by visiting [#team-design-system](https://puppet.slack.com/messages/CFFECRQAY) in Puppet's internal Slack or contacting <[email protected]>.
44

5-
- See the general [Consumption and Contribution](https://github.com/puppetlabs/design-system/wiki/Consumption-and-Contribution) principles on the wiki.
6-
- See individual CONTRIBUTING.md files for specific packages:
7-
- react-components: [packages/react-components/CONTRIBUTING.md](packages/react-components/CONTRIBUTING.md)
8-
95
## Install
106

117
Clone the design-system monorepo:
@@ -14,7 +10,7 @@ Clone the design-system monorepo:
1410
git clone [email protected]:puppetlabs/design-system.git && cd design-system
1511
```
1612

17-
Run `npm install` in the root of the design-system to install all package dependencies (which uses [Lerna](https://lerna.js.org/) to link local packages together and hoist duplicate dependencies up to the top directory to reduce install time):
13+
We recommend the latest LTS version of Node.js. Run `npm install` in the root of the design-system to install all package dependencies (which uses [Lerna](https://lerna.js.org/) to link local packages together and hoist duplicate dependencies up to the top directory to reduce install time):
1814

1915
```sh
2016
npm install
@@ -30,30 +26,42 @@ npm start
3026

3127
## Local development
3228

33-
To develop locally using a separate app that consumes a design-system package, you can run `npm link` in a particular package subfolder and `npm link @puppet/<package-name>` in the consuming app. See each individual package's own README.md; some have `npm run watch` commands to rebuild on change.
29+
To develop locally using a separate app that consumes a design-system package:
30+
31+
1. Run `npx lerna run link` (which will run `npm link` in consumable packages).
32+
2. Run `npm link @puppet/<package-name>` in the consuming app.
33+
3. Run `npx lerna run --parallel watch` to rebuild packages on change ( or just `npm run watch` in the desired package).
3434

3535
## Testing
3636

37-
You can run `npm test` in a package subfolder or `npm test` in the top folder to test all packages.
37+
Run `npm test` in the top folder to test all packages, or `npm test` in the desired package. You can also run `npm lint` to check for code formatting errors or `npm format` to attempt to automatically fix them.
3838

3939
## Pull requests
4040

4141
Put up a PR for the design-system repo that follows these guidelines:
4242

43-
- Granularity: Make commits of logical units (ideally with each commit passing tests).
44-
- Tense: Use the imperative present tense (e.g. "Change", not "Changed" or "Changes") to describe what changed from the consumer's perspective in the commit summary (with any extra details or motivation in the commit body).
45-
- Ticket: Associate with the Jira issue by adding the issue key to the commit body and, if it resolves the ticket, use the "PDS-123 #resolve" syntax to resolve the issue.
46-
- Fork: For the Jira issue to be resolved on merging rather than opening the PR (with the above syntax), the PR can be opened from a branch on your fork of the design-system repo.
43+
- Granularity: Make commits of logical units (ideally with each commit passing tests, and formatting and refactoring in separate commits).
44+
- Commit summary: The first line should be no more than 72 characters (with any extra details or motivation in the commit body).
45+
- Tense: Use the imperative present tense (e.g. "Add feature", not "Added feature") to describe what changed from the consumer's perspective in the commit summary.
46+
- Changelog: Add a line about your change to the package's CHANGELOG.md file.
47+
48+
| <img src="https://imgs.xkcd.com/comics/git_commit.png" alt="xkcd comic about commit messages"/> |
49+
| ------------- |
50+
| <p align="center">Don't do this</p> |
51+
52+
See more guidelines for contributors and maintainers in the [Principles, Patterns, and Guidelines](principles-patterns-guidelines.md) doc.
4753

4854
## Publishing
4955

56+
New versions are currently released by maintainers using `npm run publish`. Please collaborate with the team to release a new version. (Note: This process will likely be replaced with automated releases on push to master.)
57+
5058
This project currently uses Lerna's independent mode, so the following command will prompt you to select a new version for any packages that have changed since the last version tags. WARNING: this command results in a git push to your `origin` remote.
5159

5260
```sh
5361
npm run publish
5462
```
5563

56-
If `origin` was not puppetlabs/design-system, push the "Publish" commit that created, along with version tags, to the upstream repo:
64+
If `origin` was not puppetlabs/design-system, push the "Publish" commit the above command created, along with version tags, to the upstream repo:
5765

5866
```sh
5967
git push --follow-tags [email protected]:puppetlabs/design-system.git master

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"postinstall": "lerna bootstrap",
99
"test": "lerna run lint && lerna run test",
1010
"start": "cd packages/design-system-website && npm start",
11-
"styleguide:build": "cd packages/design-system-website && npm run styleguide:build"
11+
"styleguide:build": "cd packages/design-system-website && npm run styleguide:build",
12+
"publish": "lerna publish"
1213
},
1314
"devDependencies": {
1415
"@babel/preset-stage-2": "^7.0.0",

packages/data-grid/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "Apache-2.0",
66
"main": "dist/index.js",
77
"scripts": {
8+
"link": "npm link",
89
"build": "webpack",
910
"watch": "webpack --watch",
1011
"watch:dev": "webpack --watch --env.development",

packages/design-system-website/README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,15 @@ For background, see [Puppet Design System](https://confluence.puppetlabs.com/dis
88

99
### Getting started
1010

11-
**Designers** should download and install the [Sketch library](https://github.com/puppetlabs/design-system/blob/master/packages/design-assets/puppet-ui-library.sketch). Instructions for [installation and receiving updates](https://confluence.puppetlabs.com/display/UXT/Design+System+Sketch+library) are on Confluence.
12-
13-
**Developers** can get started by cloning the repo and following the [quickstart guide](https://github.com/puppetlabs/design-system).
14-
15-
**Writers** should start with the [foundation on content writing](#/Foundations/Content%20Writing) or the [writing guidelines on Confluence](https://confluence.puppetlabs.com/display/Writing/Puppet+content+style+guide). These are helpful for anyone creating content, from full pages to micro-copy.
11+
Get started by cloning the repo and following the [quickstart guide](https://github.com/puppetlabs/design-system).
1612

1713
### Release notes
1814

1915
See the changelog for each package, like react-components' [CHANGELOG.md](https://github.com/puppetlabs/design-system/blob/master/packages/react-components/CHANGELOG.md).
2016

2117
### Contribute
2218

23-
The Puppet Design System is a cross-functional team effort with shared ownership. Contributions are both welcome and encouraged. We have written a [best-practices guide](https://github.com/puppetlabs/design-system/wiki) to help you get started.
24-
25-
Developers should start with the the [CONTRIBUTING.md](https://github.com/puppetlabs/design-system/blob/master/CONTRIBUTING.md) in the repo. Designers should reference the [design criteria for adding symbols and styles](https://github.com/puppetlabs/design-system/wiki/Design-criteria) to the Sketch library.
19+
The Puppet Design System is a cross-functional team effort with shared ownership. Contributions are both welcome and encouraged. Please read our [CONTRIBUTING.md](https://github.com/puppetlabs/design-system/blob/master/CONTRIBUTING.md) guide (and [Designing](#/Foundations/Designing) guide if applicable).
2620

2721
### Feedback
2822

packages/design-system-website/foundations/Iconography.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ The vast majority of icons do not provide enough information by themselves for a
7575

7676
## Naming conventions
7777

78-
The same name should be used between the Sketch library and the component library.
79-
Names should be prioritized in descending order:
78+
The same name should be used between the Figma library and the component library. Names should be prioritized in descending order:
8079

8180
1. **Object noun** - eg. Diamond, not Quality. Pencil, not Edit.
8281
2. **Verb**. Describe the action, if the noun would be less clear. - eg. Undo, not Curved-Arrow-Left.
@@ -127,7 +126,7 @@ Test that the icon:
127126

128127
- Scales correctly
129128
- Accepts style changes
130-
- Name corresponds with Sketch library and exported SVG
129+
- Name corresponds with Figma library and exported SVG
131130
- Is added to documentation
132131

133132
## Related

packages/react-components/CONTRIBUTING.md

-166
This file was deleted.

packages/react-components/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ npm install @puppet/react-components
2020

2121
## Setup
2222

23-
### Webpack (without Create React App)
23+
### With webpack (without Create React App)
2424

2525
React Components utilizes Calibre and Open Sans. In order for Calibre to load, you will need to process the react-components scss with Webpack. This has currently been tested with webpack 4 using css-loader, sass-loader, file-loader, resolve-url-loader, and mini-css-extract-plugin. The following is an example configuration for a consuming application:
2626

@@ -66,7 +66,7 @@ const common = {
6666
};
6767
```
6868

69-
### Create React App
69+
### With Create React App (CRA)
7070

7171
If you are using CRA with [react-app-rewired](https://github.com/timarney/react-app-rewired) (after following their [instructions](https://github.com/timarney/react-app-rewired/blob/master/README.md#how-to-rewire-your-create-react-app-project) for switching from react-scripts to react-app-rewired in package.json), you can use this included rewire instead (after adding `resolve-url-loader` to devDependencies):
7272

packages/react-components/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "Apache-2.0",
66
"main": "build/library.js",
77
"scripts": {
8+
"link": "npm link",
89
"analyze": "webpack --config webpack.analyze.config.js",
910
"prebuild": "rimraf build",
1011
"build": "NODE_ENV=production webpack",

0 commit comments

Comments
 (0)