aspect-build / aspect-build/rules_js
[FR]: ability to register custom package script during package extraction
- Dominant language
- Starlark
- Stars
- 378
- Forks
- 183
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 32
Description
### What is the current behavior?
Today we would have to list out, for each dependency, a postinstall hook or similar and hope they have a lifecycle hook defined. Otherwise, we are on our own here.
### Describe the feature
Provide the ability to modify the content of a third-party npm package during the initial fetch/extraction process. Similar to the `exclude_package_contents` feature filtering package files, but would allow custom processing and not only file exclusion.
This would be similar to lifecycle hooks, but defined by the workspace author and not by packages themselves.
### Reasons
As codebases grow, we find the need to run tools on third party packages to cutdown on the number of files we have to pass around. Having a central way to run an `js_binary` on an NPM package before it is linked allows developers to efficiently prune, modify, and enhance third party code before it gets linked and used downstream. In our case, we are looking at creating single files (concatenation/bundling/etc) for each package so as to cut down on dependent files in the graph.
Contributor guide
Assessment
This issue has not been assessed yet.