Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jan 3, 2018
1 parent 9767464 commit 98139e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 137 deletions.
9 changes: 6 additions & 3 deletions docs/guides/the_dangerfile.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,24 @@ If you'd like to work with some reference material, here are some examples in th

JavaScript:

* **Apps** - [Artsy/metaphysics][meta].
* **Libraries** - [facebook/react-native][rn], [styled-components/styled-components][sc] and [ReactiveX/rxjs][rxjs].
* **Libraries** - [facebook/react-native][rn], [facebook/react][r], [styled-components/styled-components][sc] and [ReactiveX/rxjs][rxjs].
* **Docs** - [bamlab/dev-standards][bamlab]

Some TypeScript examples:

* **Apps** - [Artsy/Emission][emiss]
* **Libraries** [danger/danger-js][danger-js]
* **Libraries** [danger/danger-js][danger-js], [apollographql/apollo-client][apollo]

[emiss]: https://github.com/artsy/emission/blob/master/dangerfile.ts
[danger-js]: https://github.com/danger/danger-js/blob/master/dangerfile.ts
[meta]: https://github.com/artsy/metaphysics/blob/master/dangerfile.js
[rn]: https://github.com/facebook/react-native/blob/master/danger/dangerfile.js
[r]: https://github.com/facebook/react/blob/master/dangerfile.js
[sc]: https://github.com/styled-components/styled-components/blob/master/dangerfile.js
[rxjs]: https://github.com/ReactiveX/rxjs/blob/master/dangerfile.js
[setup]: http://danger.systems/guides/getting_started.html#creating-a-bot-account-for-danger-to-use
[jest]: https://github.com/facebook/jest
[transpilation_guide]: /js/tutorials/transiplation.html
[changelog]: http://danger.systems/js/changelog.html
[apollo]: https://github.com/apollographql/apollo-client/blob/master/dangerfile.ts
[bamlab]: https://github.com/bamlab/dev-standards/blob/master/dangerfile.js
14 changes: 14 additions & 0 deletions docs/tutorials/transpilation.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ A few notes:
* Babel 7 support for TypeScript is supported
* Whether you use `dangerfile.ts` or `dangerfile.js` is irrelevant

### TypeScript gotchas

You might have a `src` folder where your actual source code is kept, and adding a `dangerfile.ts` at the root which will break compilation. The answer to this is to add the dangerfile to the `"exclude"` section. Then to get inline errors working correct, add it to the `"include"`. It's a neat little trick. You can see it working in [artsy/emission#tsconfig.json][tsconfig]

```json
{
"compilerOptions": {},
"include": ["src/**/*.ts", "src/**/*.tsx", "dangerfile.ts"],
"exclude": ["dangerfile.ts", "node_modules"]
}
```

### The "danger" module

The `danger` module is removed before evaluation, it's only there to fake your dev env into working correctly. In reality, all of the exports are added to the global environment. If you import `"danger"` in code that isn't evaluated inside Danger itself, it will raise an exception.
Expand Down Expand Up @@ -47,3 +59,5 @@ it("does nothing when there's a PR body", () => {
})
})
```

[tsconfig]: https://github.com/artsy/emission/blob/master/tsconfig.json
134 changes: 0 additions & 134 deletions jq

This file was deleted.

0 comments on commit 98139e7

Please sign in to comment.