Skip to content

Commit 167a21b

Browse files
authored
Update Readme Files (#628)
This commit moves the contribution instructions to CONTRIBUTING.md and adds installation instructions to README.me and the welcome story for Storybook. Fixes #626
1 parent 4c7b036 commit 167a21b

File tree

3 files changed

+68
-32
lines changed

3 files changed

+68
-32
lines changed

CONTRIBUTING.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,50 @@
1+
# Contributing
2+
3+
Thanks for contributing to the Cloud Four Pattern Library!
4+
5+
## Getting Started
6+
7+
1. `npm ci` — to install dependencies
8+
1. `npm run storybook` — to run a local instance of Storybook
9+
10+
## Building
11+
12+
- `npm run build` — Builds CSS+JS for npm package
13+
- `npm run build-storybook` — Creates a static storybook site build, for example for publishing the pattern library to Netlify
14+
15+
## Project Structure
16+
17+
```
18+
cloudfour.com-patterns
19+
├── .github # GitHub workflows and templates
20+
├── .storybook
21+
│   ├── main.js # Settings for Storybook UI
22+
│   └── preview.js # Settings for story previews
23+
├── .theo # Settings for design token processing
24+
├── gulpfile.js
25+
│   └── tasks/*.js # Complex build tasks
26+
├── src
27+
│   ├── **/*.scss # Styles (Sass)
28+
│   ├── **/*.stories.mdx # Documentation (Storybook Docs)
29+
│   ├── **/*.twig # Templates (Twig)
30+
│   └── **/*.yml # Design tokens (Theo)
31+
├── .editorconfig # Low-level code consistency
32+
├── .nvmrc # Node version (used by Netlify)
33+
├── .svgo.yml # Inline SVG optimization settings
34+
├── CONTRIBUTING.md # ⬅️ You are here!
35+
├── README.md # Pattern library install instructions
36+
├── netlify.toml # Netlify build settings
37+
└── package.json # Project info and dependencies
38+
```
39+
140
## Publishing to npm
241

342
1. `git checkout v-next`
443
2. `git pull`
544
3. Make sure you have a clean working tree (`git status` should show no changes)
6-
4. `npm publish` - This will automatically install and compile everything, run linting, and publish
45+
4. `npm version` - This will bump the version number in `package.json` and `package-lock.json`
46+
5. `npm publish --access public` - This will automatically install and compile everything, run linting, and publish
47+
48+
You can run `npm publish --dry-run` to see everything that _would_ happen during publish, without actually publishing to the npm registry.
749

8-
Note the branch is `v-next` for now. When we we merge this branch to master, these instructions should be updated.
50+
Note the branch is `v-next` for now. When we we merge this branch to `master`, these instructions should be updated.

README.md

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,25 @@
22

33
# Cloud Four Patterns 🚧
44

5-
[![Netlify Status](https://api.netlify.com/api/v1/badges/1923e350-3172-409a-9361-b04d54d1c3b4/deploy-status)](https://app.netlify.com/sites/cloudfour-patterns/deploys?filter=v-next)
5+
[![NPM version](http://img.shields.io/npm/v/@cloudfour/patterns.svg)](https://www.npmjs.org/package/@cloudfour/patterns) [![Build Status](https://github.com/cloudfour/cloudfour.com-patterns/workflows/CI/badge.svg)](https://github.com/cloudfour/cloudfour.com-patterns/actions?query=workflow%3ACI) [![Renovate Status](https://badges.renovateapi.com/github/cloudfour/cloudfour.com-patterns)](https://renovatebot.com/) [![Netlify Status](https://api.netlify.com/api/v1/badges/1923e350-3172-409a-9361-b04d54d1c3b4/deploy-status)](https://app.netlify.com/sites/cloudfour-patterns/deploys?filter=v-next)
66

7-
You are currently viewing the `v-next` branch. This represents a significant refactor of our environment and coding standards. It is a work in progress and not yet ready for use.
7+
🚨 **You are currently viewing the `v-next` branch.** This represents a significant refactor of our environment and coding standards. It is a work in progress and not yet ready for use.
88

99
If you’re looking for the most stable version of our pattern library, check out [the `master` branch](https://github.com/cloudfour/cloudfour.com-patterns/tree/master).
1010

1111
[View Netlify Preview →](https://v-next--cloudfour-patterns.netlify.com/)
1212

13-
## Getting Started
13+
## Installation
1414

15-
1. `npm ci`
16-
1. `npm run storybook`
15+
<!---
16+
note that this content is duplicated between readme.md and welcome.stories.mdx
17+
be sure to make any changes to both files!
18+
-->
1719

18-
## Building
20+
The package includes both the compiled code and the source files. So you can either include the compiled CSS and JS directly, or load the source files using your own build system. If you use the source files, you'll need to compile them yourself using Sass and PostCSS.
1921

20-
- `npm run build` Builds CSS+JS for npm package
21-
- `npm run build-storybook` Creates a static storybook site build, for example for publishing the pattern library to Netlify
22-
23-
## Project Structure
22+
You can add the pattern library package as a dependency to your JavaScript application using npm:
2423

2524
```
26-
cloudfour.com-patterns
27-
├── .github # GitHub workflows and templates
28-
├── .storybook
29-
│   ├── main.js # Settings for Storybook UI
30-
│   └── preview.js # Settings for story previews
31-
├── .theo # Settings for design token processing
32-
├── gulpfile.js
33-
│   └── tasks/*.js # Complex build tasks
34-
├── src
35-
│   ├── **/*.scss # Styles (Sass)
36-
│   ├── **/*.stories.mdx # Documentation (Storybook Docs)
37-
│   ├── **/*.twig # Templates (Twig)
38-
│   └── **/*.yml # Design tokens (Theo)
39-
├── .editorconfig # Low-level code consistency
40-
├── .nvmrc # Node version (used by Netlify)
41-
├── .svgo.yml # Inline SVG optimization settings
42-
├── README.md # ⬅️ You are here!
43-
├── netlify.toml # Netlify build settings
44-
└── package.json # Project info and dependencies
25+
npm install @cloudfour/patterns
4526
```

src/welcome.stories.mdx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,17 @@ import { Meta } from '@storybook/addon-docs/blocks';
66

77
This is the pattern library for Cloud Four.
88

9-
Details coming soon.
9+
## Installation
10+
11+
<!---
12+
note that this content is duplicated between readme.md and welcome.stories.mdx
13+
be sure to make any changes to both files!
14+
-->
15+
16+
The package includes both the compiled code and the source files. So you can either include the compiled CSS and JS directly, or load the source files using your own build system. If you use the source files, you'll need to compile them yourself using Sass and PostCSS.
17+
18+
You can add the pattern library package as a dependency to your JavaScript application using npm:
19+
20+
```
21+
npm install @cloudfour/patterns
22+
```

0 commit comments

Comments
 (0)