Skip to content

Commit f714dfb

Browse files
authored
Merge pull request #3 from primer/contrib-docs
Stub out contributing docs
2 parents 2e43230 + 6af79a8 commit f714dfb

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

contributing.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing
2+
Hi, and thanks for contributing to `primer.style`!
3+
4+
5+
## Tools
6+
This site is built with [Primer React components][components] and [x0].
7+
8+
9+
## Development
10+
To start up your local dev environment, run:
11+
12+
1. `npm install` to install all the Node dependencies
13+
2. `npm start` to start the server
14+
15+
16+
## Deployment
17+
This site is deployed on [Now] and mapped to the `primer.style` domain. With the Now CLI installed globally (and authenticated), you should be able deploy the site by running three commands:
18+
19+
1. `now` to deploy the current working directory. This creates a new deployment with a unique id. Keep in mind that:
20+
21+
* All pull requests are automatically deployed by the [Now GitHub app].
22+
* You don't have to be a member of the the Primer team to deploy this site to Now! (You just won't be able to alias your deployment to `primer.style`.)
23+
24+
2. `now alias` to alias the most recent deployment to `primer.style`.
25+
26+
3. `now alias -r rules.json` to update any [path aliases](#path-aliases) configured in `rules.json`.
27+
28+
Or just run `script/deploy`, which runs these commands in the same order.
29+
30+
### Path aliases
31+
Now's [path alias] feature allows us to serve multiple apps under a single domain (in this case, `primer.style`). As this site grows, we will split larger pages off into separate apps and manage their aliases in this repo's `rules.json`, then re-run `now alias -r rules.json` whenever those mappings change.
32+
33+
#### Path alias tips and tricks
34+
Because of the way that Now's path alias feature works, separate apps need to be configured to serve all of their URLs under the same path as they're aliased to here. In other words, an app aliased to `/alias/**` will need to serve all of its content from `/alias/` rather than `/`. For Next.js apps, this means nesting all of your page content in `pages/<alias>/`. Serving static assets is trickier; you can see how we did it for [the components site][components] in [this pull request](https://github.com/primer/primer-react/pull/238).
35+
36+
[Now]: https://zeit.co/now
37+
[Now GitHub app]: https://github.com/apps/now
38+
[components]: https://primer.style/components/
39+
[path alias]: https://zeit.co/docs/features/path-aliases
40+
[x0]: https://github.com/c8r/x0

0 commit comments

Comments
 (0)