Skip to content

Commit 7dff157

Browse files
authored
Merge pull request #1051 from FormidableLabs/readmes
Readmes
2 parents 433a86d + f562328 commit 7dff157

File tree

30 files changed

+9644
-2314
lines changed

30 files changed

+9644
-2314
lines changed

CONTRIBUTING.md

+19-34
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Thanks for helping out!
77

88
Victory is a monorepo built with [Lerna](https://lernajs.io/) and [Yarn](https://yarnpkg.com/) workspaces. All `victory-*` packages live in the `packages` directory, and each has its own `package.json`. Installing this repo with `yarn` will automatically link all interdependent `victory-*` packages. **You must use `yarn` rather than `npm` when installing and running `package.json` scripts in this project.**
99

10+
## `package-scripts.js`
11+
12+
Victory uses [`nps`](https://github.com/kentcdodds/nps) to organize package scripts. Check `package-scripts.js` for the full list of commands.
13+
1014
### Requirements
1115

1216
- [Node.js](https://nodejs.org/) 8.10.0 or higher.
@@ -27,33 +31,17 @@ Use [Yarn](https://yarnpkg.com/) to install dependencies:
2731
$ yarn install
2832
```
2933

30-
A `postinstall` script will build `lib/` and `es/` for all `victory-*` packages.
31-
32-
Now you're ready to run a development server and check out the demos. Demos will be served at localhost:3000/
34+
Run a development server and check out the demos. Demos will be served at localhost:3000/. This command will also build and watch `lib/` and `es/` directories in all packages, so your demos will always be in sync with code changes.
3335

3436
```console
3537
$ yarn start
3638
```
3739

38-
## Developing multiple packages
39-
40-
When making changes across multiple dependent packages, it is necessary to rebuild libs in order to pick up changes in dependent packages. You can manually rebuild libs by running:
41-
42-
```console
43-
$ nps build-libs
44-
```
45-
46-
or start a task in a new terminal window that will watch for code changes, and automatically rebuild libs
47-
48-
```console
49-
$ nps watch
50-
```
51-
5240
## Checks, Tests
5341

5442
All checks and tests run from the root directory.
5543

56-
The `check` script will lint all packages and infrastructure before starting a test server and running our suite of tests
44+
The `check` script will lint all packages and infrastructure before building packages and starting a test server and running our suite of tests
5745

5846
```console
5947
$ nps check
@@ -74,36 +62,26 @@ Victory relies heavily on visual regression testing with [Storybook](https://sto
7462
Write visual tests for new features by adding them in the `stories` directory. Run storybooks and check out changes. Storybooks are served from localhost:6006/
7563

7664
```console
77-
$ nps storybook
65+
$ yarn storybook
7866
```
7967

8068
[Chromatic](https://www.chromaticqa.com/) provides automated visual testing. All PRs will trigger a new chromatic build, which will be displayed along with CI status. You can also trigger a new build manually with:
8169

8270
```console
83-
$ nps storybook
71+
$ yarn chromatic
8472
```
8573

86-
**External contributors will not be able to automate their visual regression testing with Chromatic, as it requires a secret app code.**
87-
88-
TODO: Set up chromatic CI for this repo
89-
74+
**External contributors will not be able to use Chromatic to automate their visual regression testing, as it requires a secret app code.**
9075

9176
## Release
9277

93-
Victory uses [publishr](https://github.com/FormidableLabs/publishr) to organize compiled code for released versions.
78+
Victory uses [Lerna](https://lernajs.io/) to automate versioning and publishing packages.
9479

95-
Each package must contain the following version scripts and publishr config in its `package.json`:
80+
Each package must contain the following `version` script `package.json`:
9681

9782
```
9883
"scripts": {
9984
"version": "nps build-libs && nps build-dists",
100-
"postversion": "publishr postversion -V",
101-
"postpublish": "publishr postpublish -V"
102-
},
103-
"publishr": {
104-
"files": {
105-
".npmignore": "../../.npmignore.publishr"
106-
}
10785
}
10886
```
10987
Pre version checks are run _once_ for all packages, and are defined in the root directory `package.json`
@@ -115,10 +93,17 @@ Pre version checks are run _once_ for all packages, and are defined in the root
11593
The following commands will let you try a version without publishing or creating git commits:
11694

11795
```console
118-
// This command bumps versions, runs checks, builds libs, and runs publishr postversion (~5 minutes)
96+
// This command bumps versions, runs checks, builds libs. No git commits will be made, and nothing will be published. `package.json` files in all packages will be altered, so be careful to clean up afterwards.
11997
$ nps lerna-dry-run
12098
```
12199

100+
To publish a package _for real_
101+
102+
```console
103+
$ lerna publish
104+
```
105+
You will be prompted to select an appropriate version before continuing. Lerna will run preversion checks, bump versions in all packages, create git commits, build libs, and publish packages. The whole process takes about 5 minutes. Be patient!
106+
122107
## Contributor Covenant Code of Conduct
123108

124109
### Our Pledge

0 commit comments

Comments
 (0)