-
Notifications
You must be signed in to change notification settings - Fork 637
Typings Intaller initial work #844
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
228ebe4
to
859598b
Compare
41dc074
to
29168d5
Compare
29168d5
to
ca7e12a
Compare
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.
Pull Request Overview
This PR ports the TypeScript installer logic from Strada into a more concurrent design by replacing separate processes with goroutines and extending type acquisition support.
- Introduces changes to how typings are discovered, cached, and installed.
- Updates module resolution and project setup to incorporate typings location and type acquisition.
- Adds new helper methods and fields in several modules (e.g. tsoptions, project, parsedcommandline, resolver) to support the new installer design.
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
internal/tsoptions/tsconfigparsing.go | Replaces legacy functions with vfs methods for generating regexes. |
internal/testutil/projecttestutil/projecttestutil.go | Updates test installer setup and adds NpmInstall behavior using panics for unexpected cases. |
internal/project/watch.go | Adjusts watched file management by introducing watchType and switching to host.Client() calls. |
internal/project/* | Extends type acquisition and typings-handling across project construction, resolution, and update. |
internal/lsp/server.go | Adds typingsLocation to server options and logs its usage. |
internal/core/nodemodules.go, internal/module/resolver.go | Propagates typings-related fields down to the resolver and module resolution logic. |
cmd/tsgo/lsp.go | Implements cross-platform logic to derive a global typings cache location. |
Comments suppressed due to low confidence (2)
internal/project/discovertypings.go:294
- Ensure thorough unit tests cover edge cases for removeMinAndVersionNumbers to validate that its behavior matches the legacy regex approach.
func removeMinAndVersionNumbers(fileName string) string {
internal/api/api.go:75
- [nitpick] If the nil return is intentional as a stub, add an inline comment explaining that the TypingsInstaller is not yet implemented.
func (api *API) TypingsInstaller() *project.TypingsInstaller { return nil }
looking into test failures |
…nd avoids race when script is attached through multiple threads
Works on my machine 😄 |
This ports the typescript installer code from Strada
Instead of different process we use go routine to queue discovery of the packages install and then another go routine to do actual install.
Here are things that are still not ported and are todo for later
While working on this, found out current bug in strada where typings already installed are not cached correctly if lockfile version is newer. This i havent fixed but will do that separately later. This means even if say
@types/chai
is already in our cache location installed, we will reinstall it. (Becausepackage-lock.json
structure change)