1 | ```
|
2 | ::::::::: :::::::::: ::: :::::::: ::::::::::: ::::::::::: :::::::: :::: :::
|
3 | :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:+: :+:
|
4 | +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ :+:+:+ +:+
|
5 | +#++:++#: +#++:++# +#++:++#++: +#+ +#+ +#+ +#+ +:+ +#+ +:+ +#+
|
6 | +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+#+#
|
7 | #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#+#
|
8 | ### ### ########## ### ### ######## ### ########### ######## ### ####
|
9 | ```
|
10 |
|
11 | ## Meta
|
12 |
|
13 | - **State:** production
|
14 | - **Demo:** <https://artsy.github.io/reaction>
|
15 | - **CI:** [![CircleCI](https://circleci.com/gh/artsy/reaction.svg?style=shield)](https://circleci.com/gh/artsy/reaction)
|
16 | - **NPM:** [![npm version](https://badge.fury.io/js/%40artsy%2Freaction.svg)](https://www.npmjs.com/package/@artsy/reaction)
|
17 | - **Coverage:** [![codecov](https://codecov.io/gh/artsy/reaction/branch/master/graph/badge.svg)](https://codecov.io/gh/artsy/reaction)
|
18 | - **Point People:** [@damassi](https://github.com/damassi)
|
19 |
|
20 | ## Installation
|
21 |
|
22 | $ git clone --recursive https://github.com/artsy/reaction.git
|
23 | $ cd reaction
|
24 | $ npm install -g yarn
|
25 | $ yarn install
|
26 | $ brew install watchman (If you don't already have Homebrew, go here for installation instructions: https://brew.sh/)
|
27 | $ cp .env.oss .env
|
28 |
|
29 | ## Instructions
|
30 |
|
31 | - Development of components happen in [storybooks](https://storybook.js.org/):
|
32 |
|
33 | $ yarn start
|
34 | $ open http://localhost:9001/
|
35 |
|
36 | - Run the tests:
|
37 |
|
38 | $ yarn test
|
39 |
|
40 | - Run the tests continuously (or use `vscode-jest`):
|
41 |
|
42 | $ yarn test -- --watch
|
43 |
|
44 | - In vscode, run the `TypeScript: Run type-checker` task and open the `PROBLEMS` view to see continuous type-checker
|
45 | results.
|
46 |
|
47 | - After updating components, be sure to deploy a new demo (sharing is caring!):
|
48 |
|
49 | $ yarn deploy-storybook
|
50 |
|
51 | - When using new changes in metaphysics’ schema, be sure to update the local schema copy:
|
52 |
|
53 | $ yarn sync-schema
|
54 |
|
55 | * There are some suggested VSCode extensions in `.vscode/extensions.json` and additional docs at [docs/vscode.md](docs/vscode.md).
|
56 |
|
57 | ## Developing in Force
|
58 |
|
59 | _Before you start, you should ensure Force is on the right branch and up-to-date._
|
60 |
|
61 | Use yarn to kick off the force development process.
|
62 |
|
63 | ```
|
64 | yarn integrate force
|
65 | ```
|
66 |
|
67 | This command will build and compile reaction, publish it locally so it can be used
|
68 | in other places, link it into force for you, and then start reaction and force in watch mode.
|
69 |
|
70 | This _assumes_ force is a sibling directory of reaction. If it's not you can use the following
|
71 | setup instead.
|
72 |
|
73 | ```
|
74 | PROJECT_PATH=path/to/force yarn integrate
|
75 | ```
|
76 |
|
77 | If you need to attach force to a debugger, use the `ENABLE_DEBUGGER` command as follows
|
78 |
|
79 | ```
|
80 | ENABLE_DEBUGGER=true yarn integrate force
|
81 | ```
|
82 |
|
83 | ## Manual Linking and Unlinking with Force
|
84 |
|
85 | To _link_ your local reaction with your local force, run:
|
86 |
|
87 | $ yarn link && yarn watch
|
88 | (wait until you see a message that X files have been successfully compiled before moving on)
|
89 |
|
90 | $ cd ../force && yarn link @artsy/reaction && yarn start
|
91 |
|
92 | To _unlink_ your local reaction from your local force, run (in **Force**):
|
93 |
|
94 | $ yarn unlink @artsy/reaction
|
95 | $ yarn add @artsy/reaction
|
96 | $ yarn start
|
97 |
|
98 | ## Deployments
|
99 |
|
100 | Reaction uses [auto-release](https://github.com/intuit/auto-release#readme) to automatically release on every PR. Every PR should have a label that matches one of the following
|
101 |
|
102 | - Version: Trivial
|
103 | - Version: Patch
|
104 | - Version: Minor
|
105 | - Version: Major
|
106 |
|
107 | Peril will automatically add "Version: Patch", if you don't set one on creating your PR. No release will happen on a `Trivial` update.
|
108 |
|
109 | If you're making a change but you don't want to immediate trigger a release (i.e. when 2 PRs need to go out together), specify the correct
|
110 | version and add the `Skip Release` label. That'll ensure when the next release happens the version is still bumped appropriately.
|
111 |
|
112 | ### Publishing a Canary to NPM
|
113 |
|
114 | Canaries are [automatically published](https://github.com/artsy/reaction/pull/3168) to NPM when creating a PR based off of a repo branch (i.e. not a fork). If you need to publish a canary of a fork you'll have to do a few manual steps:
|
115 |
|
116 | 1. Update `package.json`, set version to a canary version, e.g. `2.0.0-canary-<PR#>`, `3.1.5-canary-<PR#>`, ...
|
117 | 1. Run `npm publish --tag canary` to publish the package under the canary tag
|
118 | 1. Run `yarn add @artsy/reaction@canary` to install canary package
|
119 | 1. Running `npm dist-tag ls` can be helpful to see what tagged packages are available
|
120 |
|
121 | ## License
|
122 |
|
123 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fartsy%2Freaction.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fartsy%2Freaction?ref=badge_large)
|
124 |
|
125 | ## About Artsy
|
126 |
|
127 | <a href="https://www.artsy.net/">
|
128 | <img align="left" src="https://avatars2.githubusercontent.com/u/546231?s=200&v=4"/>
|
129 | </a>
|
130 |
|
131 | This project is the work of engineers at [Artsy][footer_website], the world's
|
132 | leading and largest online art marketplace and platform for discovering art.
|
133 | One of our core [Engineering Principles][footer_principles] is being [Open
|
134 | Source by Default][footer_open] which means we strive to share as many details
|
135 | of our work as possible.
|
136 |
|
137 | You can learn more about this work from [our blog][footer_blog] and by following
|
138 | [@ArtsyOpenSource][footer_twitter] or explore our public data by checking out
|
139 | [our API][footer_api]. If you're interested in a career at Artsy, read through
|
140 | our [job postings][footer_jobs]!
|
141 |
|
142 | [footer_website]: https://www.artsy.net/
|
143 | [footer_principles]: culture/engineering-principles.md
|
144 | [footer_open]: culture/engineering-principles.md#open-source-by-default
|
145 | [footer_blog]: https://artsy.github.io/
|
146 | [footer_twitter]: https://twitter.com/ArtsyOpenSource
|
147 | [footer_api]: https://developers.artsy.net/
|
148 | [footer_jobs]: https://www.artsy.net/jobs
|