feat(dev): Clean up package.json
scripts and add build:dev
option
#4048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The more packages our repo accumulates, the slower building gets. When we're actively working on a particular task, though, what we actually need to build is only a subset of what running
yarn:build
at the top level of the repo gets us. Specifically, we generally don't need CDN bundles, and we don't need any non-core ("core" in the English sense, not the@sentry/core
sense) packages other than the one we're working on.This introduces three new top-level yarn scripts:,
build:dev
,build:dev:filter
, andbuild:dev:watch
. The first is the same asbuild
, except it doesn't build any CDN bundles. The second takes an argument, the name of a particular package, and only builds packages related to it - it, its dependents, and its dependencies. The third is the first, but in watch mode. It doesn't bother with filtering because incremental builds are so fast that the filtering really doesn't gain you much.It also does some cleanup and standardization of the
scripts
entry of all of thepackage.json
files in the repo - it alphabetizes the options, gets rid of the unusedbuild:dist
synonym ofbuild:es5
which exists only in the browser package and isn't used anywhere, and moves the:watch
suffix last in all script names with three parts (as was the case in some packages but not others).A sampling of the time savings when using the new options:
yarn build
: 190 secyarn build:dev
: 89 secyarn build:dev:filter @sentry/angular
: 27 secyarn build:dev:filter @sentry/ember
: 30 secyarn build:dev:filter @sentry/gatsby
: 40 secyarn build:dev:filter @sentry/nextjs
: 50 secyarn build:dev:filter @sentry/node
: 64 secyarn build:dev:filter @sentry/react
: 54 secyarn build:dev:filter @sentry/serverless
: 48 secyarn build:dev:filter @sentry/tracing
: 70 secyarn build:dev:filter @sentry/vue
: 28 secyarn build:dev:filter @sentry/wasm
: 27 sec