diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b7e522f0650..266b14e1684d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ We welcome suggested improvements and bug fixes to the `@sentry/*` family of pac To run the test suite and our code linter, node.js and yarn are required. -[`node` download](https://nodejs.org/download) +[`node` download](https://nodejs.org/download) [`yarn` download](https://yarnpkg.com/en/docs/install) `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. @@ -29,13 +29,15 @@ With that, the repo is fully set up and you are ready to run all commands. ## Building Packages -Since we are using [`TypeScript`](https://www.typescriptlang.org/), you need to transpile the code to JavaScript to be -able to use it. Every package has a `build` script which takes care of everything. You can also run `build` on all of the -packages at once by calling `yarn build` in the project root. +Since we are using [`TypeScript`](https://www.typescriptlang.org/), you need to transpile the code to JavaScript to be able to use it. From the top level of the repo, there are three commands available: + +- `yarn build:dev`, which runs a one-time build of ES5 and ES6 versions of every package +- `yarn build:dev:filter `, which runs `yarn build:dev` only in projects relevant to the given package (so, for example, running `yarn build:dev:filter @sentry/react` will build the `react` package, all of its dependencies (`utils`, `core`, `browser`, etc), and all packages which depend on it (currently `gatsby` and `nextjs`)) +- `yarn build:dev:watch`, which runs `yarn build:dev` in watch mode (recommended) ## Adding Tests -**Any nontrivial fixes/features should include tests.** You'll find a `test` folder in each package. +**Any nontrivial fixes/features should include tests.** You'll find a `test` folder in each package. 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. @@ -56,15 +58,15 @@ Note: you must run `yarn build` before `yarn lint` will work. When contributing to the codebase, please note: - Non-trivial PRs will not be accepted without tests (see above). -- Please do not bump version numbers yourself. -- [`raven-js`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-js) and [`raven-node`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-node) are deprecated, and only bug and security fix PRs will be accepted targeting the [3.x branch](https://github.com/getsentry/sentry-javascript/tree/3.x). 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. +- Please do not bump version numbers yourself. +- [`raven-js`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-js) and [`raven-node`](https://github.com/getsentry/sentry-javascript/tree/3.x/packages/raven-node) are deprecated, and only bug and security fix PRs will be accepted targeting the [3.x branch](https://github.com/getsentry/sentry-javascript/tree/3.x). Any new features and improvements should be to our new SDKs (`browser`, `node`, and framework-specific packages like `react` and `nextjs`) and the packages which support them (`core`, `hub`, `integrations`, and the like). ## Publishing a Release _These steps are only relevant to Sentry employees when preparing and publishing a new SDK release._ 1. Determine what version will be released (we use [semver](https://semver.org)). -2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry to the next release number and a list of changes since the last release. +2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release. 3. Run the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) workflow. 4. A new issue should appear in https://github.com/getsentry/publish/issues. 5. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release.