-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Use @definitelytyped/types-registry for ATA #33791
Conversation
Fall back to types-registry if `npm install @definitelytyped/types-registry` doesn't work. Notes: 1. This currently requires you to be authenticated with npm. After the Github package registry leaves beta, that will no longer be true. 2. The error handling was incorrect -- it double-handled an exception and ignored the return code of execSyncAndLog. I corrected it so that it logs if either npm or GHPR fails. 3. I haven't added tests for this change yet. I see some references to types-registry in the tests so I'll see if that's the right place.
Adding some reviewers for visibility mainly. The tests all mock the registry itself and override the constructor. (This explains why TypingsInstaller is an apparently superfluous base-class -- it's all the pure code in one place, with NodeTypingsInstaller doing all the mutation.) Any idea how this could be tested? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testability, you could move the execSync implementation onto this.installTypingsHost
?
So. The second commit is now unit tested. This was the result of lots of flailing about, so let me explain what happened so nobody has to repeat it.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to come back around and approve this after the testing changes 👍
Since this is reviewed, I'm going to merge as-is when GPR comes out of beta, but at our meeting on Friday @minestarks pointed out that we should work with the editor to have it pass a |
@sandersn Thanks -- the ability to configure / turn off the registry override is a pretty important requirement from my perspective, can we track it with an issue to make sure it doesn't slip through the cracks by 3.8 beta? |
This is blocked until Github Packages allows installation of packages without authenticating with a github user's credentials, which it does not yet. I'll update the bug when that does. In the meantime, I may fold in the fix to #35038 to this PR. |
This may not be needed since presumably npm and github packages will soon be sharing infrastructure and microsoft will be paying the bill for hosting both. |
After discussing this, we decided that this feature doesn't make sense with Microsoft owning both github and npm. There's no gain in redundancy anymore. |
Use @definitelytyped/types-registry for ATA and fall back to types-registry if
npm install @definitelytyped/types-registry
doesn't work.Notes:
execSyncAndLog
. I corrected it so that it logs if either npm or GHPR fails.Step 2 of #33330
Edit: Ignoring whitespace makes the diff a little easier to read.
Further edit: I had to create a new file, so the diff is basically impossible to read. You're better off looking at just the first commit to figure out what the PR does, then reading the rest separately.