Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: env-doctor script (Agoric#10078)
_incidental_ ## Description Adds `yarn doctor` which calls `scripts/env-doctor.sh` to diagnose and repair common problems with the development environment. I made this using [Aider](https://aider.chat): ``` Main model: claude-3-5-sonnet-20240620 with diff edit format, infinite output # 2024-09-12 08:25:25.666744 +/add scripts/env-doctor.sh # 2024-09-12 08:31:22.746300 +make env-doctor run a series of diagnostics on the development environment. each diagnostic has one remedy that is offered if its diagnostic test has an error exit code. each remedy is shown to the user and they are prompted to confirm whether to execute it. Each diagnostic and remedy has a description displayed to the user instead of the code. A user can reply "Yes" or"No", or "All" which answers Yes to the remaining questions. Each answer has an alias of its first letter (Y, N, A). # 2024-09-12 08:35:00.044883 +add a check that `node --version` has the same version as in `.node-version` # 2024-09-12 08:36:58.653105 +use fnm instead of nvm # 2024-09-12 08:39:32.091136 +add a run_recommendation function that does not have a diagnostic and one of the recommendations is to run scripts/configure-vscode.sh to "Configure VS Code with recommended settings" # 2024-09-12 08:45:13.008441 +add a last diagnostic "Build repo" that runs "yarn build". If that fails the remedy offered is to "git clean -fdx && yarn install && yarn build". If a remedy exits non-zero then alert the user to seek more help and exit the script. # 2024-09-12 08:46:03.698422 +replace the NPM check with a check that `yarn --version` matches the version in the 'packageManager' field of the root package.json # 2024-09-12 08:47:23.858173 +add a recommendation to run "yarn doctor" within a3p-integration ``` I wish Aider would include the chat message in the commit. Aider-AI/aider@16856bb looks like it was supposed to. ### Security Considerations n/a ### Scaling Considerations n/a ### Documentation Considerations Maybe docs.agoric.com gets some advice to use `yarn doctor`. It could save some of the setup steps. ### Testing Considerations Needs some testing on different machines. Though it doesn't have to be perfect. I expect it will get iterated upon whenever someone runs into a problem. I've tried it a few times locally. Once I had `"build": "exit 1"` to test the build remedy. ### Upgrade Considerations n/a
- Loading branch information