-
Notifications
You must be signed in to change notification settings - Fork 1.7k
address the follow-up tasks related to --init #5959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Thanks, I'll review this one to make sure i understand the installation process |
|
Let's move the telemetry consent prompt to be the last question before installation of dependencies |
Resolves #5954
--init, this doesn't need to be e2e but it should test at a minimum it should prove that spawn works on different platforms.--initdoesn’t show “help us improve…”--initdoesn’t check for existing dependencies.viemalready installed in the package, it just installs it again, potentially a different versionTests for installation
We had the test for installation committed, but marked as skipped. I now enabled it, but I added a conditional skip statement to that test.
Now, if a flag
HARDHAT_DISABLE_SLOW_TESTS=trueis present, the long running tests will be skipped.The test I reenabled tests installing dependencies for all the templates using
npm(pnpmandyarnremain untested for now).Help us improve...
I added the telemetry consent question as the first one in the init flow (immediately after the welcome message). My thinking is that it will allow us to collect data about aborted init flows.
Please let me know if you prefer me to move the question to the end of the flow.
Existing dependencies handling
Checking if a dependency already exists before proceeding with installation was already put in place. The behaviour that I opted for in the original version was to skip installation of the dependencies that are already installed. There are some adjustments that I introduced in this PR.
Firstly, we used to only browse the
devDependencieswhen checking if a dependency is installed or not. Now, we'll also checkdependenciesjust in case.Secondly, I added version checks. Now, if a dependency is already installed, we'll check if the installed version (or a version range) satisfies the version (or a version range) specified in the template. If it doesn't, we'll suggest upgrading/downgrading the installed version to the version from the template. I intentionally kept the updates separate from the installs of completely new dependencies because I think it is quite likely a user might want to proceed with one while skipping the other. Also, I suspect the messaging around both will evolve in slightly different directions.