UNPKG

5.44 kBMarkdownView Raw
1<p align="center">
2 <img src="http://danger.systems/images/js/danger-logo-hero-cachable@2x.png" width=250 /></br>
3 Formalize your Pull Request etiquette.
4</p>
5
6<p align="center">
7 <a href="#what-is-danger-js">What is Danger JS?</a> &bull;
8 <a href="VISION.md">Vision</a> &bull;
9 <a href="#this-thing-is-broken-i-should-help-improve-it">Helping Out</a> &bull;
10 <a href="http://danger.systems/js/usage/extending-danger.html">Plugin Development</a>
11</p>
12
13## What is Danger JS?
14
15Danger runs after your CI, automating your team's conventions surrounding code review.
16
17This provides another logical step in your process, through which Danger can help lint your rote tasks in daily code
18review.
19
20You can use Danger to codify your team's norms, leaving humans to think about harder problems.
21
22Danger JS works with GitHub, BitBucket Server, BitBucket Cloud for code review, then with: Travis CI, GitLab CI,
23Semaphore, Circle CI, GitHub Actions, Jenkins, Docker Cloud, Bamboo, Bitrise, surf-build, Codeship, Drone, Buildkite,
24Nevercode, buddybuild, Buddy.works, TeamCity, Visual Studio Team Services, Screwdriver, Concourse, Netlify, CodeBuild,
25Codefresh, AppCenter, BitBucket Pipelines, Cirrus CI, Codemagic or Xcode Cloud.
26
27[![npm](https://img.shields.io/npm/v/danger.svg)](https://www.npmjs.com/package/danger)
28[![Build Status](https://travis-ci.org/danger/danger-js.svg?branch=main)](https://travis-ci.org/danger/danger-js)
29[![Build Status](https://ci.appveyor.com/api/projects/status/ep5hgeox3lbc5c7f?svg=true)](https://ci.appveyor.com/project/orta/danger-js/branch/main)
30
31## For example?
32
33You can:
34
35- Enforce CHANGELOGs
36- Enforce links to Trello/JIRA in PR/MR bodies
37- Enforce using descriptive labels
38- Look out for common anti-patterns
39- Highlight interesting build artifacts
40- Give warnings when specific files change
41
42Danger provides the glue to let _you_ build out the rules specific to your team's culture, offering useful metadata and
43a comprehensive plugin system to share common issues.
44
45## Getting Started
46
47Alright. So, actually, you may be in the wrong place. From here on in, this README is going to be for people who are
48interested in working on and improving on Danger JS.
49
50We keep all of the end-user documentation at <http://danger.systems/js>.
51
52Some quick links to get you started:
53
54- [Getting Started](http://danger.systems/js/guides/getting_started.html)
55- [Guides Index](http://danger.systems/js/guides.html)
56- [DSL Reference](http://danger.systems/js/reference.html)
57
58## This thing is broken, I should help improve it!
59
60Awesommmmee. Everything you need is down below. You can also refer to [CONTRIBUTING](CONTRIBUTING.md) file where you'll
61find the same information listed below.
62
63```sh
64git clone https://github.com/danger/danger-js.git
65cd danger-js
66
67# if you don't have yarn installed
68npm install -g yarn
69
70yarn install
71```
72
73You can then verify your install by running the tests, and the linters:
74
75```sh
76yarn test
77yarn lint
78```
79
80The fixers for both tslint and prettier will be applied when you commit, and on a push your code will be verified that
81it compiles.
82
83You can run your dev copy of danger against a PR by running:
84
85```sh
86yarn build; node --inspect distribution/commands/danger-pr.js https://github.com/danger/danger-js/pull/817
87```
88
89### How does Danger JS work?
90
91Check the [architecture doc](https://github.com/danger/danger-js/blob/main/docs/architecture.md).
92
93### What is the TODO?
94
95Check the issues, I try and keep my short term perspective there. Long term is in the [VISION.md](VISION.md).
96
97### Releasing a new version of Danger
98
99Following [this commit](https://github.com/danger/danger-js/commit/a26ac3b3bd4f002acd37f6a363c8e74c9d5039ab) as a model:
100
101- Checkout the `main` branch. Ensure your working tree is clean, and make sure you have the latest changes by running
102 `git pull; yarn`.
103- Publish - `npm run release -- patch --ci`.
104- This will trigger a CI run which updates homebrew for the native builds
105
106:ship:
107
108## License, Contributor's Guidelines and Code of Conduct
109
110We try to keep as much discussion as possible in GitHub issues, but also have a pretty inactive Slack --- if you'd like
111an invite, ping [@Orta](https://twitter.com/orta/) a DM on Twitter with your email. It's mostly interesting if you want
112to stay on top of Danger without all the emails from GitHub.
113
114> This project is open source under the MIT license, which means you have full access to the source code and can modify
115> it to fit your own needs but don't have access to deploy.
116>
117> This project subscribes to the [Moya Contributors Guidelines](https://github.com/Moya/contributors) which TLDR: means
118> we give out push access easily and often.
119>
120> Contributors subscribe to the [Contributor Code of Conduct](http://contributor-covenant.org/version/1/3/0/) based on
121> the [Contributor Covenant](http://contributor-covenant.org) version 1.3.0.
122
123[emiss]: https://github.com/artsy/emission/blob/master/dangerfile.ts
124[danger-js]: https://github.com/danger/danger-js/blob/main/dangerfile.ts
125[meta]: https://github.com/artsy/metaphysics/blob/master/dangerfile.js
126[fbj]: https://github.com/facebook/jest/blob/master/dangerfile.js
127[sc]: https://github.com/styled-components/styled-components/blob/master/dangerfile.js
128[rxjs]: https://github.com/ReactiveX/rxjs/blob/master/dangerfile.js
129[setup]: http://danger.systems/guides/getting_started.html#creating-a-bot-account-for-danger-to-use
130[jest]: https://github.com/facebook/jest