|
7 | 7 |
|
8 | 8 | # Contributing
|
9 | 9 |
|
10 |
| -This part of the documentation gives you a basic overview of how to help with the development of our `@sentry/*` |
11 |
| -packages contained in this repo. |
| 10 | +We welcome suggested improvements and bug fixes to the `@sentry/*` family of packages, in the form of pull requests on [`GitHub`](https://github.com/getsentry/sentry-javascript). The guide below will help you get started, but if you have further questions, please feel free to reach out on [Discord](https://discord.gg/Ww9hbqr). |
12 | 11 |
|
13 |
| -## Community |
14 |
| - |
15 |
| -The public-facing channels for support and development of Sentry SDKs can be found on [Discord](https://discord.gg/Ww9hbqr). |
16 | 12 |
|
17 | 13 | ## Setting up an Environment
|
18 | 14 |
|
19 |
| -To run the test suite and run our code linter, node.js and yarn are required. |
20 |
| - |
21 |
| -[`node`](https://nodejs.org/download) [`yarn`](https://yarnpkg.com/en/docs/install) |
| 15 | +To run the test suite and our code linter, node.js and yarn are required. |
22 | 16 |
|
23 |
| -Since this is a mono repo containing several packages, we use `lerna` to manage them. |
| 17 | +[`node` download](https://nodejs.org/download) |
| 18 | +[`yarn` download](https://yarnpkg.com/en/docs/install) |
24 | 19 |
|
25 |
| -To get started, install all dependencies, bootstrap the workspace and perform initial build, so TypeScript can read all the linked type definitions from a monorepo. |
| 20 | +`sentry-javascript` is a monorepo containing several packages, and we use `lerna` to manage them. To get started, install all dependencies, use `lerna` to bootstrap the workspace, and then perform an initial build, so TypeScript can read all of the linked type definitions. |
26 | 21 |
|
27 | 22 | ```
|
28 | 23 | $ yarn
|
29 | 24 | $ yarn lerna bootstrap
|
30 | 25 | $ yarn build
|
31 | 26 | ```
|
32 | 27 |
|
33 |
| -With that, the repo is fully setup and you are ready to run all commands. |
| 28 | +With that, the repo is fully set up and you are ready to run all commands. |
34 | 29 |
|
35 |
| -## Build |
| 30 | +## Building Packages |
36 | 31 |
|
37 |
| -Since we are using [`TypeScript`](https://www.typescriptlang.org/) you need to transpile the code to JavaScript to be |
38 |
| -able to use it. Every package has a `build` script which takes care of everything. You can also run `build` on every |
39 |
| -package by calling |
| 32 | +Since we are using [`TypeScript`](https://www.typescriptlang.org/), you need to transpile the code to JavaScript to be |
| 33 | +able to use it. Every package has a `build` script which takes care of everything. You can also run `build` on all of the |
| 34 | +packages at once by calling `yarn build` in the project root. |
40 | 35 |
|
41 |
| -``` |
42 |
| -$ yarn build |
43 |
| -``` |
| 36 | +## Adding Tests |
| 37 | + |
| 38 | +**Any nontrivial fixes/features should include tests.** You'll find a `test` folder in each package. |
| 39 | + |
| 40 | +Note that _for the `browser` package only_, if you add a new file to the [integration test suite](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser/test/integration/suites), you also need to add it to [the list in `shell.js`](https://github.com/getsentry/sentry-javascript/blob/b74e199254147fd984e7bb1ea24193aee70afa74/packages/browser/test/integration/suites/shell.js#L25) as well. Adding tests to existing files will work out of the box in all packages. |
| 41 | + |
| 42 | +## Running Tests |
| 43 | + |
| 44 | +Running tests works the same way as building - running `yarn test` at the project root will run tests for all packages, and running `yarn test` in a specific package will run tests for that package. There are also commands to run subsets of the tests in each location. Check out the `scripts` entry of the corresponding `package.json` for details. |
44 | 45 |
|
45 |
| -in the project root. |
| 46 | +Note: you must run `yarn build` before `yarn test` will work. |
46 | 47 |
|
47 |
| -## Running the Test Suite |
| 48 | +## Linting |
48 | 49 |
|
49 |
| -You can run all test at once by calling `yarn test` in the project root or in individual sub packages. Note that you must run `yarn build` before the test command will work. |
| 50 | +Similar to building and testing, linting can be done in the project root or in individual packages by calling `yarn lint`. |
50 | 51 |
|
51 |
| -## Lint |
| 52 | +Note: you must run `yarn build` before `yarn lint` will work. |
52 | 53 |
|
53 |
| -You can run all test at once by calling `yarn lint` in the project root or in individual sub packages. Note that you must run `yarn build` before the lint command will work. |
| 54 | +## Final Notes |
54 | 55 |
|
55 |
| -## Contributing Back Code |
| 56 | +When contributing to the codebase, please make note of the following: |
56 | 57 |
|
57 |
| -Please, send over suggestions and bug fixes in the form of pull requests on |
58 |
| -[`GitHub`](https://github.com/getsentry/sentry-javascript). Any nontrivial fixes/features should include tests. Do not |
59 |
| -bump version numbers yourself. For new features and improvements consider contributing to our new SDKs instead, |
60 |
| -`raven-js` and `raven-node` will still be supported but are in maintenance mode and will only receive bug fixes. |
| 58 | +- Non-trivial PRs will not be accepted without tests (see above). |
| 59 | +- Please do not bump version numbers yourself. |
| 60 | +- `raven-js` and `raven-node` are deprecated, and only bug and security fix PRs will be accepted. Any new features and improvements should be to our new SDKs (`browser` and `node`) and the packages (`core`, `hub`, `integrations`, and the like) which support them. |
0 commit comments