Typings Intaller initial work#844
Merged
Merged
Conversation
228ebe4 to
859598b
Compare
41dc074 to
29168d5
Compare
29168d5 to
ca7e12a
Compare
Contributor
There was a problem hiding this comment.
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 }
Member
Author
|
looking into test failures |
…nd avoids race when script is attached through multiple threads
jakebailey
requested changes
May 29, 2025
jakebailey
reviewed
May 29, 2025
andrewbranch
approved these changes
May 30, 2025
jakebailey
approved these changes
May 30, 2025
Member
|
Works on my machine 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/chaiis already in our cache location installed, we will reinstall it. (Becausepackage-lock.jsonstructure change)