[rush] postinstall config is not getting executed by default on "rush install/rush update"
Please prefix the issue title with the project name i.e. [rush], [api-extractor] etc.
Is this a feature or a bug?
- [ ] Feature
- [ ] Bug
Please describe the actual behavior. Need help: we are having a monorepo which contains multiple angular projects(libraries). Recently, we upgraded to angular V9. During this phase we explored that our library node_modules needs to be Angular Ivy compatible for which we have to make sure running "ngcc" after any change in node_module installation in each individual project/library.
In npm/yarn scenario we can use "postinstall" option which is available in package.json.
Is there a way we can achieve the same in Rush ? and also, will "postRushInstall" option can be of any help ? if so, can you please provide an example for the same ?
If the issue is a bug, how can we reproduce it? Please provide detailed steps and include a GitHub branch if applicable. Your issue will get resolved faster if you can make it easy to investigate.
What is the expected behavior?
If this is a bug, please provide the tool version, Node.js version, and OS.
- Tool:
- Tool Version:
- Node Version:
- Is this a LTS version?
- Have you tested on a LTS version?
- OS:
I'm not very familiar with Angular. Can you share a repro?
Sorry for delay in response. I am trying to get a simple repro scenario out of my current application(which is a bit difficult...trying). meanwhile I just want to check a simple thing. as part of "rush update/rush install" command will it run package.json's "postinstall" config(which happens default in yarn/npm ?
meanwhile I just want to check a simple thing. as part of "rush update/rush install" command will it run package.json's "postinstall" config(which happens default in yarn/npm ?
rush install will run the postinstall scripts for external dependencies. It will NOT run postinstall scripts found in the package.json for a local project, because those projects are locally linked rather than being "installed."
The postRushInstall script runs once for the entire monorepo, after rush install is finished.
Related to #862
Didn't realize that when "useWorkspaces": true is used, postinstall scripts run automatically after each rush install/update.
With "useWorkspaces": false, rush collects dependencies from all projects, to generate a new package.json to be used pnpm install. Now with "useWorkspaces": true, rush calls pnpm install --recursive, which uses each package.json directly, thus also runs postinstall scripts.