vendor tsgo

This commit is contained in:
2026-07-09 16:50:43 -04:00
parent c06ea2e5a4
commit 98978e4930
5804 changed files with 1556156 additions and 101 deletions

View File

@@ -0,0 +1,45 @@
package tsoptions
import (
"sync"
"github.com/microsoft/typescript-go/internal/ast"
"github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/locale"
"github.com/microsoft/typescript-go/internal/tspath"
)
type ParsedBuildCommandLine struct {
BuildOptions *core.BuildOptions `json:"buildOptions"`
CompilerOptions *core.CompilerOptions `json:"compilerOptions"`
WatchOptions *core.WatchOptions `json:"watchOptions"`
Projects []string `json:"projects"`
Errors []*ast.Diagnostic `json:"errors"`
Raw any `json:"raw"`
comparePathsOptions tspath.ComparePathsOptions
resolvedProjectPaths []string
resolvedProjectPathsOnce sync.Once
locale locale.Locale
localeOnce sync.Once
}
func (p *ParsedBuildCommandLine) ResolvedProjectPaths() []string {
p.resolvedProjectPathsOnce.Do(func() {
p.resolvedProjectPaths = core.Map(p.Projects, func(project string) string {
return core.ResolveConfigFileNameOfProjectReference(
tspath.ResolvePath(p.comparePathsOptions.CurrentDirectory, project),
)
})
})
return p.resolvedProjectPaths
}
func (p *ParsedBuildCommandLine) Locale() locale.Locale {
p.localeOnce.Do(func() {
p.locale, _ = locale.Parse(p.CompilerOptions.Locale)
})
return p.locale
}