Adds a prepare script to @datadog/browser-rum-react #3182
Merged
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.
Motivation
The standard
prepack
script is called by Yarn when a repository is installed as a dependency. Its purpose is to let the package describe how its sources should be compiled whenyarn pack
is called. Since the script was missing, Yarn was packing the original TypeScript source files rather than the JavaScript ones.Changes
Adds a
prepack
script that callsnpm run build
. The reason it'snpm run
(rather thanyarn run
, despite the repository being installed with Yarn) is that the build script currently relies on hoisting to have most of its binaries available. Runningyarn run
won't make those binaries available (because they aren't dependencies of@datadog/browser-rum-react
), butnpm run
(because it just puts as many bins as possible innode_modules/.bin
). Since Lerna works, it suggests that they are usingnpm run
even on Yarn-installed projects.Testing
I have gone over the contributing documentation.