Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix attribution generation (#28415)
## **Description** Fix the `attribution:generate` command by ensuring that it is possible to install just production dependencies. Previously the command `yarn workspaces focus --production` (used to discard development dependencies, keeping just production dependencies installed) would fail because `rimraf` was not found. `rimraf` was a development dependency used in the `postinstall` script. This was resolved by replacing `rimraf` with a Node.js script that does the same thing without needing any dependency. Once that failure was resolved, another was revealed. The `allow-scripts` step of the installation began failing because there was a package detected that had an install script that was missing from our configuration. This package was in our configuration already, but the `allow-scripts` configuration is sensitive to changes in the directory structure of `node_modules`, and that structure changed due to differences in which packages were hoisted in the production-only install. That failure was resolved by updating `generate-attributions.sh` to remove the `allow-scripts` plugin while generating attributions. We don't need `postinstall` scripts to run in order to read licences from disk. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28415?quickstart=1) ## **Related issues** Fixes #28412 ## **Manual testing steps** 1. Run `yarn attributions:generate`, and see that it completes successfully * Locally, it should also re-install the `allow-scripts` plugin and development dependencies * If this command is run with `CI=true` (e.g. `CI=true yarn attributions:generate`), it will skip the step of re-installing the `allow-scripts` plugin and development dependencies. This is what would happen on CI, where the environment gets discarded after this is run so there is no point in re-installing things. ## **Screenshots/Recordings** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot <[email protected]>
- Loading branch information