diff --git a/internal/api/server.go b/internal/api/server.go
index 7d0dcc1f0a..28bb965917 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -8,6 +8,7 @@ import (
"io"
"strconv"
"sync"
+ "time"
"github.com/go-json-experiment/json"
"github.com/microsoft/typescript-go/internal/bundled"
@@ -472,3 +473,8 @@ func (s *Server) Stat(path string) vfs.FileInfo {
func (s *Server) Remove(path string) error {
panic("unimplemented")
}
+
+// Chtimes implements vfs.FS.
+func (s *Server) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ panic("unimplemented")
+}
diff --git a/internal/bundled/embed.go b/internal/bundled/embed.go
index 82ba6f9634..36c00137b2 100644
--- a/internal/bundled/embed.go
+++ b/internal/bundled/embed.go
@@ -161,6 +161,13 @@ func (vfs *wrappedFS) Remove(path string) error {
return vfs.fs.Remove(path)
}
+func (vfs *wrappedFS) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ if _, ok := splitPath(path); ok {
+ panic("cannot change times on embedded file system")
+ }
+ return vfs.fs.Chtimes(path, aTime, mTime)
+}
+
type fileInfo struct {
mode fs.FileMode
name string
diff --git a/internal/checker/checker.go b/internal/checker/checker.go
index 91ab33f1ea..0e405d6375 100644
--- a/internal/checker/checker.go
+++ b/internal/checker/checker.go
@@ -14633,7 +14633,7 @@ func (c *Checker) resolveExternalModule(location *ast.Node, moduleReference stri
}
var message *diagnostics.Message
- if overrideHost != nil && overrideHost.Kind == ast.KindImportDeclaration && overrideHost.AsImportDeclaration().ImportClause.IsTypeOnly() {
+ if overrideHost != nil && overrideHost.Kind == ast.KindImportDeclaration && overrideHost.AsImportDeclaration().ImportClause != nil && overrideHost.AsImportDeclaration().ImportClause.IsTypeOnly() {
message = diagnostics.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute
} else if overrideHost != nil && overrideHost.Kind == ast.KindImportType {
message = diagnostics.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute
diff --git a/internal/collections/syncset.go b/internal/collections/syncset.go
index 1b9be611c0..c933d6ec90 100644
--- a/internal/collections/syncset.go
+++ b/internal/collections/syncset.go
@@ -11,8 +11,13 @@ func (s *SyncSet[T]) Has(key T) bool {
return ok
}
+func (s *SyncSet[T]) AddIfAbsent(key T) bool {
+ _, loaded := s.m.LoadOrStore(key, struct{}{})
+ return !loaded
+}
+
func (s *SyncSet[T]) Add(key T) {
- s.m.Store(key, struct{}{})
+ s.AddIfAbsent(key)
}
func (s *SyncSet[T]) Delete(key T) {
diff --git a/internal/compiler/emitter.go b/internal/compiler/emitter.go
index d0cb58c162..9cdc8503a7 100644
--- a/internal/compiler/emitter.go
+++ b/internal/compiler/emitter.go
@@ -42,9 +42,6 @@ type emitter struct {
}
func (e *emitter) emit() {
- if e.host.Options().ListEmittedFiles.IsTrue() {
- e.emitResult.EmittedFiles = []string{}
- }
// !!! tracing
e.emitJSFile(e.sourceFile, e.paths.JsFilePath(), e.paths.SourceMapFilePath())
e.emitDeclarationFile(e.sourceFile, e.paths.DeclarationFilePath(), e.paths.DeclarationMapPath())
@@ -262,7 +259,7 @@ func (e *emitter) printSourceFile(jsFilePath string, sourceMapFilePath string, s
err := e.host.WriteFile(sourceMapFilePath, sourceMap, false /*writeByteOrderMark*/)
if err != nil {
e.emitterDiagnostics.Add(ast.NewCompilerDiagnostic(diagnostics.Could_not_write_file_0_Colon_1, jsFilePath, err.Error()))
- } else if e.emitResult.EmittedFiles != nil {
+ } else {
e.emitResult.EmittedFiles = append(e.emitResult.EmittedFiles, sourceMapFilePath)
}
}
@@ -286,7 +283,7 @@ func (e *emitter) printSourceFile(jsFilePath string, sourceMapFilePath string, s
}
if err != nil {
e.emitterDiagnostics.Add(ast.NewCompilerDiagnostic(diagnostics.Could_not_write_file_0_Colon_1, jsFilePath, err.Error()))
- } else if e.emitResult.EmittedFiles != nil && !skippedDtsWrite {
+ } else if !skippedDtsWrite {
e.emitResult.EmittedFiles = append(e.emitResult.EmittedFiles, jsFilePath)
}
diff --git a/internal/compiler/fileInclude.go b/internal/compiler/fileInclude.go
index 2e16f018df..68687e5e03 100644
--- a/internal/compiler/fileInclude.go
+++ b/internal/compiler/fileInclude.go
@@ -8,6 +8,7 @@ import (
"github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/diagnostics"
"github.com/microsoft/typescript-go/internal/module"
+ "github.com/microsoft/typescript-go/internal/scanner"
"github.com/microsoft/typescript-go/internal/tsoptions"
"github.com/microsoft/typescript-go/internal/tspath"
)
@@ -57,7 +58,11 @@ type referenceFileLocation struct {
func (r *referenceFileLocation) text() string {
if r.node != nil {
- return r.node.Text()
+ if !ast.NodeIsSynthesized(r.node) {
+ return r.file.Text()[scanner.SkipTrivia(r.file.Text(), r.node.Loc.Pos()):r.node.End()]
+ } else {
+ return fmt.Sprintf(`"%s"`, r.node.Text())
+ }
} else {
return r.file.Text()[r.ref.Pos():r.ref.End()]
}
diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go
index 1df4c404ec..c59a5ce857 100644
--- a/internal/compiler/fileloader.go
+++ b/internal/compiler/fileloader.go
@@ -610,19 +610,19 @@ func (p *fileLoader) pathForLibFile(name string) *LibFile {
path := tspath.CombinePaths(p.defaultLibraryPath, name)
replaced := false
- if p.opts.Config.CompilerOptions().LibReplacement.IsTrue() {
+ if p.opts.Config.CompilerOptions().LibReplacement.IsTrue() && name != "lib.d.ts" {
libraryName := getLibraryNameFromLibFileName(name)
resolveFrom := getInferredLibraryNameResolveFrom(p.opts.Config.CompilerOptions(), p.opts.Host.GetCurrentDirectory(), name)
resolution, trace := p.resolver.ResolveModuleName(libraryName, resolveFrom, core.ModuleKindCommonJS, nil)
if resolution.IsResolved() {
path = resolution.ResolvedFileName
replaced = true
- p.pathForLibFileResolutions.LoadOrStore(p.toPath(resolveFrom), &libResolution{
- libraryName: libraryName,
- resolution: resolution,
- trace: trace,
- })
}
+ p.pathForLibFileResolutions.LoadOrStore(p.toPath(resolveFrom), &libResolution{
+ libraryName: libraryName,
+ resolution: resolution,
+ trace: trace,
+ })
}
libPath, _ := p.pathForLibFileCache.LoadOrStore(name, &LibFile{name, path, replaced})
diff --git a/internal/compiler/program.go b/internal/compiler/program.go
index e801aa0021..d62272c3af 100644
--- a/internal/compiler/program.go
+++ b/internal/compiler/program.go
@@ -270,6 +270,7 @@ func equalCheckJSDirectives(d1 *ast.CheckJsDirective, d2 *ast.CheckJsDirective)
func (p *Program) SourceFiles() []*ast.SourceFile { return p.files }
func (p *Program) Options() *core.CompilerOptions { return p.opts.Config.CompilerOptions() }
+func (p *Program) GetRootFileNames() []string { return p.opts.Config.FileNames() }
func (p *Program) Host() CompilerHost { return p.opts.Host }
func (p *Program) GetConfigFileParsingDiagnostics() []*ast.Diagnostic {
return slices.Clip(p.opts.Config.GetConfigFileParsingDiagnostics())
@@ -1364,9 +1365,7 @@ func CombineEmitResults(results []*EmitResult) *EmitResult {
result.EmitSkipped = true
}
result.Diagnostics = append(result.Diagnostics, emitResult.Diagnostics...)
- if emitResult.EmittedFiles != nil {
- result.EmittedFiles = append(result.EmittedFiles, emitResult.EmittedFiles...)
- }
+ result.EmittedFiles = append(result.EmittedFiles, emitResult.EmittedFiles...)
if emitResult.SourceMaps != nil {
result.SourceMaps = append(result.SourceMaps, emitResult.SourceMaps...)
}
diff --git a/internal/compiler/projectreferencedtsfakinghost.go b/internal/compiler/projectreferencedtsfakinghost.go
index 3bac411dad..aa343d7d7e 100644
--- a/internal/compiler/projectreferencedtsfakinghost.go
+++ b/internal/compiler/projectreferencedtsfakinghost.go
@@ -2,6 +2,7 @@ package compiler
import (
"strings"
+ "time"
"github.com/microsoft/typescript-go/internal/collections"
"github.com/microsoft/typescript-go/internal/core"
@@ -82,6 +83,11 @@ func (fs *projectReferenceDtsFakingVfs) Remove(path string) error {
panic("should not be called by resolver")
}
+// Chtimes implements vfs.FS.
+func (fs *projectReferenceDtsFakingVfs) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ panic("should not be called by resolver")
+}
+
// DirectoryExists implements vfs.FS.
func (fs *projectReferenceDtsFakingVfs) DirectoryExists(path string) bool {
if fs.projectReferenceFileMapper.opts.Host.FS().DirectoryExists(path) {
diff --git a/internal/core/buildoptions.go b/internal/core/buildoptions.go
new file mode 100644
index 0000000000..c7cde7504f
--- /dev/null
+++ b/internal/core/buildoptions.go
@@ -0,0 +1,15 @@
+package core
+
+type BuildOptions struct {
+ _ noCopy
+
+ Dry Tristate `json:"dry,omitzero"`
+ Force Tristate `json:"force,omitzero"`
+ Verbose Tristate `json:"verbose,omitzero"`
+ StopBuildOnErrors Tristate `json:"stopBuildOnErrors,omitzero"`
+
+ // CompilerOptions are not parsed here and will be available on ParsedBuildCommandLine
+
+ // Internal fields
+ Clean Tristate `json:"clean,omitzero"`
+}
diff --git a/internal/core/compileroptions.go b/internal/core/compileroptions.go
index 6fa6f5cfd5..ffca3d6c3d 100644
--- a/internal/core/compileroptions.go
+++ b/internal/core/compileroptions.go
@@ -26,7 +26,6 @@ type CompilerOptions struct {
AllowUnusedLabels Tristate `json:"allowUnusedLabels,omitzero"`
AssumeChangesOnlyAffectDirectDependencies Tristate `json:"assumeChangesOnlyAffectDirectDependencies,omitzero"`
AlwaysStrict Tristate `json:"alwaysStrict,omitzero"`
- Build Tristate `json:"build,omitzero"`
CheckJs Tristate `json:"checkJs,omitzero"`
CustomConditions []string `json:"customConditions,omitzero"`
Composite Tristate `json:"composite,omitzero"`
@@ -142,7 +141,7 @@ type CompilerOptions struct {
Version Tristate `json:"version,omitzero"`
Watch Tristate `json:"watch,omitzero"`
ShowConfig Tristate `json:"showConfig,omitzero"`
- TscBuild Tristate `json:"tscBuild,omitzero"`
+ Build Tristate `json:"build,omitzero"`
Help Tristate `json:"help,omitzero"`
All Tristate `json:"all,omitzero"`
diff --git a/internal/core/projectreference.go b/internal/core/projectreference.go
index ded897f4b6..d5dcf5a78f 100644
--- a/internal/core/projectreference.go
+++ b/internal/core/projectreference.go
@@ -9,10 +9,10 @@ type ProjectReference struct {
}
func ResolveProjectReferencePath(ref *ProjectReference) string {
- return resolveConfigFileNameOfProjectReference(ref.Path)
+ return ResolveConfigFileNameOfProjectReference(ref.Path)
}
-func resolveConfigFileNameOfProjectReference(path string) string {
+func ResolveConfigFileNameOfProjectReference(path string) string {
if tspath.FileExtensionIs(path, tspath.ExtensionJson) {
return path
}
diff --git a/internal/diagnostics/diagnostics_generated.go b/internal/diagnostics/diagnostics_generated.go
index d5f1d5b8e1..56fa836f40 100644
--- a/internal/diagnostics/diagnostics_generated.go
+++ b/internal/diagnostics/diagnostics_generated.go
@@ -2276,7 +2276,7 @@ var Unknown_build_option_0 = &Message{code: 5072, category: CategoryError, key:
var Build_option_0_requires_a_value_of_type_1 = &Message{code: 5073, category: CategoryError, key: "Build_option_0_requires_a_value_of_type_1_5073", text: "Build option '{0}' requires a value of type {1}."}
-var Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified = &Message{code: 5074, category: CategoryError, key: "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", text: "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."}
+var Failed_to_update_timestamp_of_file_0 = &Message{code: 5074, category: CategoryMessage, key: "Failed_to_update_timestamp_of_file_0_5074", text: "Failed to update timestamp of file '{0}'."}
var X_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2 = &Message{code: 5075, category: CategoryError, key: "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", text: "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."}
@@ -2858,7 +2858,7 @@ var Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2 = &Mes
var Project_0_is_out_of_date_because_output_file_1_does_not_exist = &Message{code: 6352, category: CategoryMessage, key: "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352", text: "Project '{0}' is out of date because output file '{1}' does not exist"}
-var Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date = &Message{code: 6353, category: CategoryMessage, key: "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353", text: "Project '{0}' is out of date because its dependency '{1}' is out of date"}
+var Failed_to_delete_file_0 = &Message{code: 6353, category: CategoryMessage, key: "Failed_to_delete_file_0_6353", text: "Failed to delete file '{0}'."}
var Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies = &Message{code: 6354, category: CategoryMessage, key: "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354", text: "Project '{0}' is up to date with .d.ts files from its dependencies"}
@@ -2938,7 +2938,7 @@ var Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the
var Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files = &Message{code: 6400, category: CategoryMessage, key: "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", text: "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"}
-var Project_0_is_out_of_date_because_there_was_error_reading_file_1 = &Message{code: 6401, category: CategoryMessage, key: "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", text: "Project '{0}' is out of date because there was error reading file '{1}'"}
+var Project_0_is_out_of_date_because_config_file_does_not_exist = &Message{code: 6401, category: CategoryMessage, key: "Project_0_is_out_of_date_because_config_file_does_not_exist_6401", text: "Project '{0}' is out of date because config file does not exist."}
var Resolving_in_0_mode_with_conditions_1 = &Message{code: 6402, category: CategoryMessage, key: "Resolving_in_0_mode_with_conditions_1_6402", text: "Resolving in {0} mode with conditions {1}."}
@@ -2976,7 +2976,7 @@ var Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colo
var Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors = &Message{code: 6419, category: CategoryMessage, key: "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", text: "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."}
-var Project_0_is_out_of_date_because_1 = &Message{code: 6420, category: CategoryMessage, key: "Project_0_is_out_of_date_because_1_6420", text: "Project '{0}' is out of date because {1}."}
+var Project_0_is_out_of_date_because_input_1_does_not_exist = &Message{code: 6420, category: CategoryMessage, key: "Project_0_is_out_of_date_because_input_1_does_not_exist_6420", text: "Project '{0}' is out of date because input '{1}' does not exist."}
var Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_in_output_files = &Message{code: 6421, category: CategoryMessage, key: "Rewrite_ts_tsx_mts_and_cts_file_extensions_in_relative_import_paths_to_their_JavaScript_equivalent_i_6421", text: "Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."}
diff --git a/internal/diagnostics/extraDiagnosticMessages.json b/internal/diagnostics/extraDiagnosticMessages.json
index 4e64552426..8b91e65d9f 100644
--- a/internal/diagnostics/extraDiagnosticMessages.json
+++ b/internal/diagnostics/extraDiagnosticMessages.json
@@ -22,5 +22,21 @@
"A JSDoc '@type' tag may not occur with a '@param' or '@returns' tag.": {
"category": "Error",
"code": 8040
+ },
+ "Failed to delete file '{0}'.": {
+ "category": "Message",
+ "code": 6353
+ },
+ "Project '{0}' is out of date because config file does not exist.": {
+ "category": "Message",
+ "code": 6401
+ },
+ "Project '{0}' is out of date because input '{1}' does not exist.": {
+ "category": "Message",
+ "code": 6420
+ },
+ "Failed to update timestamp of file '{0}'.": {
+ "category": "Message",
+ "code": 5074
}
}
diff --git a/internal/diagnosticwriter/diagnosticwriter.go b/internal/diagnosticwriter/diagnosticwriter.go
index 7001bed49e..520f769e8d4 100644
--- a/internal/diagnosticwriter/diagnosticwriter.go
+++ b/internal/diagnosticwriter/diagnosticwriter.go
@@ -39,7 +39,6 @@ func FormatDiagnosticsWithColorAndContext(output io.Writer, diags []*ast.Diagnos
if len(diags) == 0 {
return
}
-
for i, diagnostic := range diags {
if i > 0 {
fmt.Fprint(output, formatOpts.NewLine)
@@ -386,3 +385,15 @@ func WriteFormatDiagnostic(output io.Writer, diagnostic *ast.Diagnostic, formatO
WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine)
fmt.Fprint(output, formatOpts.NewLine)
}
+
+func FormatDiagnosticsStatusWithColorAndTime(output io.Writer, time string, diag *ast.Diagnostic, formatOpts *FormattingOptions) {
+ fmt.Fprint(output, "[")
+ writeWithStyleAndReset(output, time, foregroundColorEscapeGrey)
+ fmt.Fprint(output, "] ")
+ WriteFlattenedDiagnosticMessage(output, diag, formatOpts.NewLine)
+}
+
+func FormatDiagnosticsStatusAndTime(output io.Writer, time string, diag *ast.Diagnostic, formatOpts *FormattingOptions) {
+ fmt.Fprint(output, time, " - ")
+ WriteFlattenedDiagnosticMessage(output, diag, formatOpts.NewLine)
+}
diff --git a/internal/execute/buildordergenerator.go b/internal/execute/buildordergenerator.go
new file mode 100644
index 0000000000..85abf1abb0
--- /dev/null
+++ b/internal/execute/buildordergenerator.go
@@ -0,0 +1,367 @@
+package execute
+
+import (
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/microsoft/typescript-go/internal/ast"
+ "github.com/microsoft/typescript-go/internal/collections"
+ "github.com/microsoft/typescript-go/internal/compiler"
+ "github.com/microsoft/typescript-go/internal/core"
+ "github.com/microsoft/typescript-go/internal/diagnostics"
+ "github.com/microsoft/typescript-go/internal/incremental"
+ "github.com/microsoft/typescript-go/internal/tsoptions"
+ "github.com/microsoft/typescript-go/internal/tspath"
+)
+
+type upToDateStatusType uint16
+
+const (
+ // Errors:
+
+ // config file was not found
+ upToDateStatusTypeConfigFileNotFound upToDateStatusType = iota
+ // found errors during build
+ upToDateStatusTypeBuildErrors
+ // did not build because upstream project has errors - and we have option to stop build on upstream errors
+ upToDateStatusTypeUpstreamErrors
+
+ // Its all good, no work to do
+ upToDateStatusTypeUpToDate
+
+ // Pseudo-builds - touch timestamps, no actual build:
+
+ // The project appears out of date because its upstream inputs are newer than its outputs,
+ // but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
+ // This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
+ upToDateStatusTypeUpToDateWithUpstreamTypes
+ // The project appears up to date and even though input file changed, its text didnt so just need to update timestamps
+ upToDateStatusTypeUpToDateWithInputFileText
+
+ // Needs build:
+
+ // input file is missing
+ upToDateStatusTypeInputFileMissing
+ // output file is missing
+ upToDateStatusTypeOutputMissing
+ // input file is newer than output file
+ upToDateStatusTypeInputFileNewer
+ // build info is out of date as we need to emit some files
+ upToDateStatusTypeOutOfDateBuildInfoWithPendingEmit
+ // build info indiscates that project has errors and they need to be reported
+ upToDateStatusTypeOutOfDateBuildInfoWithErrors
+ // build info options indicate there is work to do based on changes in options
+ upToDateStatusTypeOutOfDateOptions
+ // file was root when built but not any more
+ upToDateStatusTypeOutOfDateRoots
+ // buildInfo.version mismatch with current ts version
+ upToDateStatusTypeTsVersionOutputOfDate
+ // build because --force was specified
+ upToDateStatusTypeForceBuild
+
+ // solution file
+ upToDateStatusTypeSolution
+)
+
+type inputOutputName struct {
+ input string
+ output string
+}
+
+type fileAndTime struct {
+ file string
+ time time.Time
+}
+
+type inputOutputFileAndTime struct {
+ input fileAndTime
+ output fileAndTime
+ buildInfo string
+}
+
+type upstreamErrors struct {
+ ref string
+ refHasUpstreamErrors bool
+}
+
+type upToDateStatus struct {
+ kind upToDateStatusType
+ data any
+}
+
+func (s *upToDateStatus) IsError() bool {
+ switch s.kind {
+ case upToDateStatusTypeConfigFileNotFound,
+ upToDateStatusTypeBuildErrors,
+ upToDateStatusTypeUpstreamErrors:
+ return true
+ default:
+ return false
+ }
+}
+
+func (s *upToDateStatus) NeedsBuild() bool {
+ switch s.kind {
+ case upToDateStatusTypeInputFileMissing,
+ upToDateStatusTypeOutputMissing,
+ upToDateStatusTypeInputFileNewer,
+ upToDateStatusTypeOutOfDateBuildInfoWithPendingEmit,
+ upToDateStatusTypeOutOfDateBuildInfoWithErrors,
+ upToDateStatusTypeOutOfDateOptions,
+ upToDateStatusTypeOutOfDateRoots,
+ upToDateStatusTypeTsVersionOutputOfDate,
+ upToDateStatusTypeForceBuild:
+ return true
+ default:
+ return false
+ }
+}
+
+func (s *upToDateStatus) IsPseudoBuild() bool {
+ switch s.kind {
+ case upToDateStatusTypeUpToDateWithUpstreamTypes,
+ upToDateStatusTypeUpToDateWithInputFileText:
+ return true
+ default:
+ return false
+ }
+}
+
+func (s *upToDateStatus) InputOutputFileAndTime() *inputOutputFileAndTime {
+ data, ok := s.data.(*inputOutputFileAndTime)
+ if !ok {
+ return nil
+ }
+ return data
+}
+
+type statusTask struct {
+ config string
+ referencedBy string
+ status chan *upToDateStatus
+}
+
+type solutionBuilderResult struct {
+ result CommandLineResult
+ errors []*ast.Diagnostic
+ statistics statistics
+ programStats []*statistics
+ filesToDelete []string
+}
+
+func (b *solutionBuilderResult) report(s *solutionBuilder) {
+ createReportErrorSummary(s.opts.sys, s.opts.command.CompilerOptions)(b.errors)
+ if b.filesToDelete != nil {
+ s.createBuilderStatusReporter(nil)(
+ ast.NewCompilerDiagnostic(
+ diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0,
+ strings.Join(core.Map(b.filesToDelete, func(f string) string {
+ return "\r\n * " + f
+ }), ""),
+ ))
+ }
+ if len(b.programStats) == 0 {
+ return
+ }
+ if !s.opts.command.CompilerOptions.Diagnostics.IsTrue() && !s.opts.command.CompilerOptions.ExtendedDiagnostics.IsTrue() {
+ return
+ }
+ b.statistics.isAggregate = true
+ b.statistics.compileTimes = &compileTimes{}
+ for _, stat := range b.programStats {
+ // Aggregate statistics
+ b.statistics.files += stat.files
+ b.statistics.lines += stat.lines
+ b.statistics.identifiers += stat.identifiers
+ b.statistics.symbols += stat.symbols
+ b.statistics.types += stat.types
+ b.statistics.instantiations += stat.instantiations
+ b.statistics.memoryUsed += stat.memoryUsed
+ b.statistics.memoryAllocs += stat.memoryAllocs
+ b.statistics.compileTimes.configTime += stat.compileTimes.configTime
+ b.statistics.compileTimes.buildInfoReadTime += stat.compileTimes.buildInfoReadTime
+ b.statistics.compileTimes.parseTime += stat.compileTimes.parseTime
+ b.statistics.compileTimes.bindTime += stat.compileTimes.bindTime
+ b.statistics.compileTimes.checkTime += stat.compileTimes.checkTime
+ b.statistics.compileTimes.emitTime += stat.compileTimes.emitTime
+ b.statistics.compileTimes.changesComputeTime += stat.compileTimes.changesComputeTime
+ }
+ b.statistics.compileTimes.totalTime = s.opts.sys.SinceStart()
+ b.statistics.report(s.opts.sys.Writer(), s.opts.testing)
+}
+
+type taskReporter struct {
+ builder strings.Builder
+ errors []*ast.Diagnostic
+ reportStatus diagnosticReporter
+ diagnosticReporter diagnosticReporter
+ exitStatus ExitStatus
+ statistics *statistics
+ program *incremental.Program
+ filesToDelete []string
+}
+
+func (b *taskReporter) reportDiagnostic(err *ast.Diagnostic) {
+ b.errors = append(b.errors, err)
+ b.diagnosticReporter(err)
+}
+
+func (b *taskReporter) report(s *solutionBuilder, configPath tspath.Path, buildResult *solutionBuilderResult) {
+ if len(b.errors) > 0 {
+ buildResult.errors = append(core.IfElse(buildResult.errors != nil, buildResult.errors, []*ast.Diagnostic{}), b.errors...)
+ }
+ fmt.Fprint(s.opts.sys.Writer(), b.builder.String())
+ if b.exitStatus > buildResult.result.Status {
+ buildResult.result.Status = b.exitStatus
+ }
+ if b.statistics != nil {
+ buildResult.programStats = append(buildResult.programStats, b.statistics)
+ }
+ if b.program != nil {
+ buildResult.result.IncrementalProgram = append(buildResult.result.IncrementalProgram, b.program)
+ buildResult.statistics.projectsBuilt++
+ }
+ buildResult.filesToDelete = append(buildResult.filesToDelete, b.filesToDelete...)
+}
+
+type buildTask struct {
+ config string
+ resolved *tsoptions.ParsedCommandLine
+ upStream []*statusTask
+ downStream []*statusTask
+ previousTaskReporter chan *taskReporter
+ reporter chan *taskReporter
+}
+
+type buildOrderGenerator struct {
+ host compiler.CompilerHost
+ tasks collections.SyncMap[tspath.Path, *buildTask]
+ order []string
+ errors []*ast.Diagnostic
+}
+
+func (b *buildOrderGenerator) Order() []string {
+ return b.order
+}
+
+func (b *buildOrderGenerator) Upstream(configName string) []string {
+ path := b.toPath(configName)
+ task, ok := b.tasks.Load(path)
+ if !ok {
+ panic("No build task found for " + configName)
+ }
+ return core.MapFiltered(task.upStream, func(t *statusTask) (string, bool) {
+ return t.config, t.status != nil
+ })
+}
+
+func (b *buildOrderGenerator) Downstream(configName string) []string {
+ path := b.toPath(configName)
+ task, ok := b.tasks.Load(path)
+ if !ok {
+ panic("No build task found for " + configName)
+ }
+ return core.Map(task.downStream, func(t *statusTask) string {
+ return t.referencedBy
+ })
+}
+
+func NewBuildOrderGenerator(command *tsoptions.ParsedBuildCommandLine, host compiler.CompilerHost, isSingleThreaded bool) *buildOrderGenerator {
+ b := &buildOrderGenerator{host: host}
+
+ projects := command.ResolvedProjectPaths()
+ // Parse all config files in parallel
+ wg := core.NewWorkGroup(isSingleThreaded)
+ b.createBuildTasks(projects, wg)
+ wg.RunAndWait()
+
+ // Generate the order
+ b.generateOrder(projects)
+
+ return b
+}
+
+func (b *buildOrderGenerator) toPath(configName string) tspath.Path {
+ return tspath.ToPath(configName, b.host.GetCurrentDirectory(), b.host.FS().UseCaseSensitiveFileNames())
+}
+
+func (b *buildOrderGenerator) createBuildTasks(projects []string, wg core.WorkGroup) {
+ for _, project := range projects {
+ b.createBuildTask(project, wg)
+ }
+}
+
+func (b *buildOrderGenerator) createBuildTask(configName string, wg core.WorkGroup) {
+ wg.Queue(func() {
+ path := b.toPath(configName)
+ task := &buildTask{config: configName}
+ if _, loaded := b.tasks.LoadOrStore(path, task); loaded {
+ return
+ }
+ task.resolved = b.host.GetResolvedProjectReference(configName, path)
+ if task.resolved != nil {
+ b.createBuildTasks(task.resolved.ResolvedProjectReferencePaths(), wg)
+ }
+ })
+}
+
+func (b *buildOrderGenerator) generateOrder(projects []string) {
+ completed := collections.Set[tspath.Path]{}
+ analyzing := collections.Set[tspath.Path]{}
+ circularityStack := []string{}
+ for _, project := range projects {
+ b.analyzeConfig(project, nil, false, &completed, &analyzing, circularityStack)
+ }
+}
+
+func (b *buildOrderGenerator) analyzeConfig(
+ configName string,
+ downStream *statusTask,
+ inCircularContext bool,
+ completed *collections.Set[tspath.Path],
+ analyzing *collections.Set[tspath.Path],
+ circularityStack []string,
+) {
+ path := b.toPath(configName)
+ task, ok := b.tasks.Load(path)
+ if !ok {
+ panic("No build task found for " + configName)
+ }
+ if !completed.Has(path) {
+ if analyzing.Has(path) {
+ if !inCircularContext {
+ b.errors = append(b.errors, ast.NewCompilerDiagnostic(
+ diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,
+ strings.Join(circularityStack, "\n"),
+ ))
+ }
+ return
+ }
+ analyzing.Add(path)
+ circularityStack = append(circularityStack, configName)
+ if task.resolved != nil {
+ for index, subReference := range task.resolved.ResolvedProjectReferencePaths() {
+ statusTask := statusTask{config: subReference, referencedBy: configName}
+ task.upStream = append(task.upStream, &statusTask)
+ b.analyzeConfig(subReference, &statusTask, inCircularContext || task.resolved.ProjectReferences()[index].Circular, completed, analyzing, circularityStack)
+ }
+ }
+ circularityStack = circularityStack[:len(circularityStack)-1]
+ completed.Add(path)
+ task.reporter = make(chan *taskReporter, 1)
+ prev := core.LastOrNil(b.order)
+ if prev != "" {
+ if prevTask, ok := b.tasks.Load(b.toPath(prev)); ok {
+ task.previousTaskReporter = prevTask.reporter
+ } else {
+ panic("No previous task found for " + prev)
+ }
+ }
+ b.order = append(b.order, configName)
+ }
+ if downStream != nil {
+ task.downStream = append(task.downStream, downStream)
+ downStream.status = make(chan *upToDateStatus, 1)
+ }
+}
diff --git a/internal/execute/buildordergenerator_test.go b/internal/execute/buildordergenerator_test.go
new file mode 100644
index 0000000000..a6dc22fb2f
--- /dev/null
+++ b/internal/execute/buildordergenerator_test.go
@@ -0,0 +1,134 @@
+package execute_test
+
+import (
+ "fmt"
+ "slices"
+ "strings"
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/compiler"
+ "github.com/microsoft/typescript-go/internal/core"
+ "github.com/microsoft/typescript-go/internal/execute"
+ "github.com/microsoft/typescript-go/internal/tsoptions"
+ "github.com/microsoft/typescript-go/internal/vfs/vfstest"
+ "gotest.tools/v3/assert"
+)
+
+func TestBuildOrderGenerator(t *testing.T) {
+ t.Parallel()
+ testCases := []*buildOrderTestCase{
+ {"specify two roots", []string{"A", "G"}, []string{"D", "E", "C", "B", "A", "G"}, false},
+ {"multiple parts of the same graph in various orders", []string{"A"}, []string{"D", "E", "C", "B", "A"}, false},
+ {"multiple parts of the same graph in various orders", []string{"A", "C", "D"}, []string{"D", "E", "C", "B", "A"}, false},
+ {"multiple parts of the same graph in various orders", []string{"D", "C", "A"}, []string{"D", "E", "C", "B", "A"}, false},
+ {"other orderings", []string{"F"}, []string{"E", "F"}, false},
+ {"other orderings", []string{"E"}, []string{"E"}, false},
+ {"other orderings", []string{"F", "C", "A"}, []string{"E", "F", "D", "C", "B", "A"}, false},
+ {"returns circular order", []string{"H"}, []string{"E", "J", "I", "H"}, true},
+ {"returns circular order", []string{"A", "H"}, []string{"D", "E", "C", "B", "A", "J", "I", "H"}, true},
+ }
+ for _, testcase := range testCases {
+ testcase.run(t)
+ }
+}
+
+type buildOrderTestCase struct {
+ name string
+ projects []string
+ expected []string
+ circular bool
+}
+
+func (b *buildOrderTestCase) configName(project string) string {
+ return fmt.Sprintf("/home/src/workspaces/project/%s/tsconfig.json", project)
+}
+
+func (b *buildOrderTestCase) projectName(config string) string {
+ str := strings.TrimPrefix(config, "/home/src/workspaces/project/")
+ str = strings.TrimSuffix(str, "/tsconfig.json")
+ return str
+}
+
+func (b *buildOrderTestCase) run(t *testing.T) {
+ t.Helper()
+ t.Run(b.name+" - "+strings.Join(b.projects, ","), func(t *testing.T) {
+ t.Parallel()
+ files := make(map[string]string)
+ deps := map[string][]string{
+ "A": {"B", "C"},
+ "B": {"C", "D"},
+ "C": {"D", "E"},
+ "F": {"E"},
+ "H": {"I"},
+ "I": {"J"},
+ "J": {"H", "E"},
+ }
+ reverseDeps := map[string][]string{}
+ for project, deps := range deps {
+ for _, dep := range deps {
+ reverseDeps[dep] = append(reverseDeps[dep], project)
+ }
+ }
+ for _, project := range []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"} {
+ files[fmt.Sprintf("/home/src/workspaces/project/%s/%s.ts", project, project)] = "export {}"
+ referencesStr := ""
+ if deps, ok := deps[project]; ok {
+ referencesStr = fmt.Sprintf(`, "references": [%s]`, strings.Join(core.Map(deps, func(dep string) string {
+ return fmt.Sprintf(`{ "path": "../%s" }`, dep)
+ }), ","))
+ }
+ files[b.configName(project)] = fmt.Sprintf(`{
+ "compilerOptions": { "composite": true },
+ "files": ["./%s.ts"],
+ %s
+ }`, project, referencesStr)
+ }
+
+ host := compiler.NewCompilerHost("/home/src/workspaces/project", vfstest.FromMap(files, true), "", nil, nil)
+ args := append([]string{"--build", "--dry"}, b.projects...)
+ buildCommand := tsoptions.ParseBuildCommandLine(args, host)
+ buildOrderGenerator := execute.NewBuildOrderGenerator(buildCommand, host, false)
+ buildOrder := core.Map(buildOrderGenerator.Order(), b.projectName)
+ assert.DeepEqual(t, buildOrder, b.expected)
+
+ for index, project := range buildOrder {
+ upstream := core.Map(buildOrderGenerator.Upstream(b.configName(project)), b.projectName)
+ expectedUpstream := deps[project]
+ assert.Assert(t, len(upstream) <= len(expectedUpstream), fmt.Sprintf("Expected upstream for %s to be at most %d, got %d", project, len(expectedUpstream), len(upstream)))
+ for _, expected := range expectedUpstream {
+ if slices.Contains(buildOrder[:index], expected) {
+ assert.Assert(t, slices.Contains(upstream, expected), fmt.Sprintf("Expected upstream for %s to contain %s", project, expected))
+ } else {
+ assert.Assert(t, !slices.Contains(upstream, expected), fmt.Sprintf("Expected upstream for %s to not contain %s", project, expected))
+ }
+ }
+
+ downstream := core.Map(buildOrderGenerator.Downstream(b.configName(project)), b.projectName)
+ expectedDownstream := reverseDeps[project]
+ assert.Assert(t, len(downstream) <= len(expectedDownstream), fmt.Sprintf("Expected downstream for %s to be at most %d, got %d", project, len(expectedDownstream), len(downstream)))
+ for _, expected := range expectedDownstream {
+ if slices.Contains(buildOrder[index+1:], expected) {
+ assert.Assert(t, slices.Contains(downstream, expected), fmt.Sprintf("Expected downstream for %s to contain %s", project, expected))
+ } else {
+ assert.Assert(t, !slices.Contains(downstream, expected), fmt.Sprintf("Expected downstream for %s to not contain %s", project, expected))
+ }
+ }
+ }
+
+ if !b.circular {
+ for project, projectDeps := range deps {
+ child := b.configName(project)
+ childIndex := slices.Index(buildOrder, child)
+ if childIndex == -1 {
+ continue
+ }
+ for _, dep := range projectDeps {
+ parent := b.configName(dep)
+ parentIndex := slices.Index(buildOrder, parent)
+
+ assert.Assert(t, childIndex > parentIndex, fmt.Sprintf("Expecting child %s to be built after parent %s", project, dep))
+ }
+ }
+ }
+ })
+}
diff --git a/internal/execute/outputs.go b/internal/execute/outputs.go
index 29b1e4c825..3e097316be 100644
--- a/internal/execute/outputs.go
+++ b/internal/execute/outputs.go
@@ -32,17 +32,16 @@ func getFormatOptsOfSys(sys System) *diagnosticwriter.FormattingOptions {
type diagnosticReporter = func(*ast.Diagnostic)
func quietDiagnosticReporter(diagnostic *ast.Diagnostic) {}
-func createDiagnosticReporter(sys System, options *core.CompilerOptions) diagnosticReporter {
+func createDiagnosticReporter(sys System, w io.Writer, options *core.CompilerOptions) diagnosticReporter {
if options.Quiet.IsTrue() {
return quietDiagnosticReporter
}
formatOpts := getFormatOptsOfSys(sys)
writeDiagnostic := core.IfElse(shouldBePretty(sys, options), diagnosticwriter.FormatDiagnosticWithColorAndContext, diagnosticwriter.WriteFormatDiagnostic)
-
return func(diagnostic *ast.Diagnostic) {
- writeDiagnostic(sys.Writer(), diagnostic, formatOpts)
- fmt.Fprint(sys.Writer(), formatOpts.NewLine)
+ writeDiagnostic(w, diagnostic, formatOpts)
+ fmt.Fprint(w, formatOpts.NewLine)
}
}
@@ -124,53 +123,110 @@ func (c *colors) brightWhite(str string) string {
return "\x1b[97m" + str + "\x1b[39m"
}
-func createReportErrorSummary(sys System, options *core.CompilerOptions) func(diagnostics []*ast.Diagnostic) {
+type diagnosticsReporter = func(diagnostics []*ast.Diagnostic)
+
+func quietDiagnosticsReporter(diagnostics []*ast.Diagnostic) {}
+
+func createReportErrorSummary(sys System, options *core.CompilerOptions) diagnosticsReporter {
if shouldBePretty(sys, options) {
formatOpts := getFormatOptsOfSys(sys)
return func(diagnostics []*ast.Diagnostic) {
diagnosticwriter.WriteErrorSummaryText(sys.Writer(), diagnostics, formatOpts)
}
}
- return func(diagnostics []*ast.Diagnostic) {}
+ return quietDiagnosticsReporter
}
-func reportStatistics(sys System, program *compiler.Program, result compileAndEmitResult, memStats *runtime.MemStats, testing CommandLineTesting) {
- var stats table
+func createBuilderStatusReporter(sys System, w io.Writer, options *core.CompilerOptions, testing CommandLineTesting) diagnosticReporter {
+ if options.Quiet.IsTrue() {
+ return quietDiagnosticReporter
+ }
+ formatOpts := getFormatOptsOfSys(sys)
+ writeStatus := core.IfElse(shouldBePretty(sys, options), diagnosticwriter.FormatDiagnosticsStatusWithColorAndTime, diagnosticwriter.FormatDiagnosticsStatusAndTime)
+ return func(diagnostic *ast.Diagnostic) {
+ if testing != nil {
+ testing.OnBuildStatusReportStart(w)
+ defer testing.OnBuildStatusReportEnd(w)
+ }
+ writeStatus(w, sys.Now().Format("03:04:05 PM"), diagnostic, formatOpts)
+ fmt.Fprint(w, formatOpts.NewLine, formatOpts.NewLine)
+ }
+}
+
+type statistics struct {
+ isAggregate bool
+ projects int
+ projectsBuilt int
+ timestampUpdates int
+ files int
+ lines int
+ identifiers int
+ symbols int
+ types int
+ instantiations int
+ memoryUsed uint64
+ memoryAllocs uint64
+ compileTimes *compileTimes
+}
+
+func statisticsFromProgram(program *compiler.Program, compileTimes *compileTimes, memStats *runtime.MemStats) *statistics {
+ return &statistics{
+ files: len(program.SourceFiles()),
+ lines: program.LineCount(),
+ identifiers: program.IdentifierCount(),
+ symbols: program.SymbolCount(),
+ types: program.TypeCount(),
+ instantiations: program.InstantiationCount(),
+ memoryUsed: memStats.Alloc,
+ memoryAllocs: memStats.Mallocs,
+ compileTimes: compileTimes,
+ }
+}
+
+func (p *statistics) report(w io.Writer, testing CommandLineTesting) {
if testing != nil {
- testing.OnStatisticsStart()
- defer testing.OnStatisticsEnd()
+ testing.OnStatisticsStart(w)
+ defer testing.OnStatisticsEnd(w)
}
- stats.add("Files", len(program.SourceFiles()))
- stats.add("Lines", program.LineCount())
- stats.add("Identifiers", program.IdentifierCount())
- stats.add("Symbols", program.SymbolCount())
- stats.add("Types", program.TypeCount())
- stats.add("Instantiations", program.InstantiationCount())
- stats.add("Memory used", fmt.Sprintf("%vK", memStats.Alloc/1024))
- stats.add("Memory allocs", strconv.FormatUint(memStats.Mallocs, 10))
- if result.configTime != 0 {
- stats.add("Config time", result.configTime)
+ var stats table
+ var prefix string
+
+ if p.isAggregate {
+ prefix = "Aggregate "
+ stats.add("Projects in scope", p.projects)
+ stats.add("Projects built", p.projectsBuilt)
+ stats.add("Timestamps only updates", p.timestampUpdates)
}
- if result.buildInfoReadTime != 0 {
- stats.add("BuildInfo read time", result.buildInfoReadTime)
+ stats.add(prefix+"Files", p.files)
+ stats.add(prefix+"Lines", p.lines)
+ stats.add(prefix+"Identifiers", p.identifiers)
+ stats.add(prefix+"Symbols", p.symbols)
+ stats.add(prefix+"Types", p.types)
+ stats.add(prefix+"Instantiations", p.instantiations)
+ stats.add(prefix+"Memory used", fmt.Sprintf("%vK", p.memoryUsed/1024))
+ stats.add(prefix+"Memory allocs", strconv.FormatUint(p.memoryAllocs, 10))
+ if p.compileTimes.configTime != 0 {
+ stats.add(prefix+"Config time", p.compileTimes.configTime)
}
- stats.add("Parse time", result.parseTime)
- if result.bindTime != 0 {
- stats.add("Bind time", result.bindTime)
+ if p.compileTimes.buildInfoReadTime != 0 {
+ stats.add(prefix+"BuildInfo read time", p.compileTimes.buildInfoReadTime)
}
- if result.checkTime != 0 {
- stats.add("Check time", result.checkTime)
+ stats.add(prefix+"Parse time", p.compileTimes.parseTime)
+ if p.compileTimes.bindTime != 0 {
+ stats.add(prefix+"Bind time", p.compileTimes.bindTime)
}
- if result.emitTime != 0 {
- stats.add("Emit time", result.emitTime)
+ if p.compileTimes.checkTime != 0 {
+ stats.add(prefix+"Check time", p.compileTimes.checkTime)
}
- if result.changesComputeTime != 0 {
- stats.add("Changes compute time", result.changesComputeTime)
+ if p.compileTimes.emitTime != 0 {
+ stats.add(prefix+"Emit time", p.compileTimes.emitTime)
}
- stats.add("Total time", result.totalTime)
-
- stats.print(sys.Writer())
+ if p.compileTimes.changesComputeTime != 0 {
+ stats.add(prefix+"Changes compute time", p.compileTimes.changesComputeTime)
+ }
+ stats.add(prefix+"Total time", p.compileTimes.totalTime)
+ stats.print(w)
}
func printVersion(sys System) {
@@ -269,6 +325,20 @@ func printEasyHelp(sys System, simpleOptions []*tsoptions.CommandLineOption) {
}
}
+func printBuildHelp(sys System, buildOptions []*tsoptions.CommandLineOption) {
+ var output []string
+ output = append(output, getHeader(sys, diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Format()+" - "+diagnostics.Version_0.Format(core.Version()))...)
+ before := diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0.Format("https://aka.ms/tsc-composite-builds")
+ options := core.Filter(buildOptions, func(option *tsoptions.CommandLineOption) bool {
+ return option != &tsoptions.TscBuildOption
+ })
+ output = append(output, generateSectionOptionsOutput(sys, diagnostics.BUILD_OPTIONS.Format(), options, false, &before, nil)...)
+
+ for _, chunk := range output {
+ fmt.Fprint(sys.Writer(), chunk)
+ }
+}
+
func generateSectionOptionsOutput(
sys System,
sectionName string,
diff --git a/internal/execute/solutionBuilderHost.go b/internal/execute/solutionBuilderHost.go
new file mode 100644
index 0000000000..5ccc31f2cc
--- /dev/null
+++ b/internal/execute/solutionBuilderHost.go
@@ -0,0 +1,232 @@
+package execute
+
+import (
+ "time"
+
+ "github.com/microsoft/typescript-go/internal/ast"
+ "github.com/microsoft/typescript-go/internal/collections"
+ "github.com/microsoft/typescript-go/internal/compiler"
+ "github.com/microsoft/typescript-go/internal/incremental"
+ "github.com/microsoft/typescript-go/internal/tsoptions"
+ "github.com/microsoft/typescript-go/internal/tspath"
+ "github.com/microsoft/typescript-go/internal/vfs"
+)
+
+type configAndTime struct {
+ resolved *tsoptions.ParsedCommandLine
+ time time.Duration
+}
+
+type buildInfoAndConfig struct {
+ buildInfo *incremental.BuildInfo
+ config tspath.Path
+}
+
+type solutionBuilderHost struct {
+ builder *solutionBuilder
+ host compiler.CompilerHost
+ extendedConfigCache collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry]
+ sourceFiles collections.SyncMap[ast.SourceFileParseOptions, *ast.SourceFile]
+ resolvedReferences collections.SyncMap[tspath.Path, *configAndTime]
+
+ buildInfos collections.SyncMap[tspath.Path, *buildInfoAndConfig]
+ mTimes collections.SyncMap[tspath.Path, time.Time]
+ latestChangedDtsFiles collections.SyncMap[tspath.Path, time.Time]
+}
+
+var (
+ _ vfs.FS = (*solutionBuilderHost)(nil)
+ _ compiler.CompilerHost = (*solutionBuilderHost)(nil)
+ _ incremental.BuildInfoReader = (*solutionBuilderHost)(nil)
+)
+
+func (h *solutionBuilderHost) FS() vfs.FS {
+ return h
+}
+
+func (h *solutionBuilderHost) UseCaseSensitiveFileNames() bool {
+ return h.host.FS().UseCaseSensitiveFileNames()
+}
+
+func (h *solutionBuilderHost) FileExists(path string) bool {
+ return h.host.FS().FileExists(path)
+}
+
+func (h *solutionBuilderHost) ReadFile(path string) (string, bool) {
+ return h.host.FS().ReadFile(path)
+}
+
+func (h *solutionBuilderHost) WriteFile(path string, data string, writeByteOrderMark bool) error {
+ err := h.host.FS().WriteFile(path, data, writeByteOrderMark)
+ if err == nil {
+ filePath := h.builder.toPath(path)
+ h.buildInfos.Delete(filePath)
+ h.mTimes.Delete(filePath)
+ }
+ return err
+}
+
+func (h *solutionBuilderHost) Remove(path string) error {
+ return h.host.FS().Remove(path)
+}
+
+func (h *solutionBuilderHost) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ return h.host.FS().Chtimes(path, aTime, mTime)
+}
+
+func (h *solutionBuilderHost) DirectoryExists(path string) bool {
+ return h.host.FS().DirectoryExists(path)
+}
+
+func (h *solutionBuilderHost) GetAccessibleEntries(path string) vfs.Entries {
+ return h.host.FS().GetAccessibleEntries(path)
+}
+
+func (h *solutionBuilderHost) Stat(path string) vfs.FileInfo {
+ return h.host.FS().Stat(path)
+}
+
+func (h *solutionBuilderHost) WalkDir(root string, walkFn vfs.WalkDirFunc) error {
+ return h.host.FS().WalkDir(root, walkFn)
+}
+
+func (h *solutionBuilderHost) Realpath(path string) string {
+ return h.host.FS().Realpath(path)
+}
+
+func (h *solutionBuilderHost) DefaultLibraryPath() string {
+ return h.host.DefaultLibraryPath()
+}
+
+func (h *solutionBuilderHost) GetCurrentDirectory() string {
+ return h.host.GetCurrentDirectory()
+}
+
+func (h *solutionBuilderHost) Trace(msg string) {
+ panic("solutionBuilderHost does not support tracing, use a different host for tracing")
+}
+
+func (h *solutionBuilderHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile {
+ if existing, loaded := h.sourceFiles.Load(opts); loaded {
+ return existing
+ }
+
+ file := h.host.GetSourceFile(opts)
+ file, _ = h.sourceFiles.LoadOrStore(opts, file)
+ return file
+}
+
+func (h *solutionBuilderHost) GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine {
+ if existing, loaded := h.resolvedReferences.Load(path); loaded {
+ return existing.resolved
+ }
+ configStart := h.builder.opts.sys.Now()
+ commandLine, _ := tsoptions.GetParsedCommandLineOfConfigFilePath(fileName, path, h.builder.opts.command.CompilerOptions, h, &h.extendedConfigCache)
+ configTime := h.builder.opts.sys.Now().Sub(configStart)
+ configAndTime, _ := h.resolvedReferences.LoadOrStore(path, &configAndTime{resolved: commandLine, time: configTime})
+ return configAndTime.resolved
+}
+
+func (h *solutionBuilderHost) ReadBuildInfo(buildInfoFileName string) *incremental.BuildInfo {
+ path := h.builder.toPath(buildInfoFileName)
+ if existing, loaded := h.buildInfos.Load(path); loaded {
+ return existing.buildInfo
+ }
+ return nil
+}
+
+func (h *solutionBuilderHost) readOrStoreBuildInfo(configPath tspath.Path, buildInfoFileName string) *incremental.BuildInfo {
+ if existing, loaded := h.buildInfos.Load(h.builder.toPath(buildInfoFileName)); loaded {
+ return existing.buildInfo
+ }
+
+ buildInfo := incremental.NewBuildInfoReader(h).ReadBuildInfo(buildInfoFileName)
+ entry := &buildInfoAndConfig{buildInfo, configPath}
+ entry, _ = h.buildInfos.LoadOrStore(h.builder.toPath(buildInfoFileName), entry)
+ return entry.buildInfo
+}
+
+func (h *solutionBuilderHost) hasConflictingBuildInfo(configPath tspath.Path) bool {
+ if existing, loaded := h.buildInfos.Load(configPath); loaded {
+ return existing.config != configPath
+ }
+ return false
+}
+
+func (h *solutionBuilderHost) getMTime(file string) time.Time {
+ path := h.builder.toPath(file)
+ if existing, loaded := h.mTimes.Load(path); loaded {
+ return existing
+ }
+ stat := h.host.FS().Stat(file)
+ var mTime time.Time
+ if stat != nil {
+ mTime = stat.ModTime()
+ }
+ mTime, _ = h.mTimes.LoadOrStore(path, mTime)
+ return mTime
+}
+
+func (h *solutionBuilderHost) setMTime(file string, mTime time.Time) error {
+ path := h.builder.toPath(file)
+ err := h.host.FS().Chtimes(file, time.Time{}, mTime)
+ if err == nil {
+ h.mTimes.Store(path, mTime)
+ }
+ return err
+}
+
+func (h *solutionBuilderHost) getLatestChangedDtsTime(config string) time.Time {
+ path := h.builder.toPath(config)
+ if existing, loaded := h.latestChangedDtsFiles.Load(path); loaded {
+ return existing
+ }
+
+ var changedDtsTime time.Time
+ if configAndTime, loaded := h.resolvedReferences.Load(path); loaded {
+ buildInfoPath := configAndTime.resolved.GetBuildInfoFileName()
+ buildInfo := h.readOrStoreBuildInfo(path, buildInfoPath)
+ if buildInfo != nil && buildInfo.LatestChangedDtsFile != "" {
+ changedDtsTime = h.getMTime(
+ tspath.GetNormalizedAbsolutePath(
+ buildInfo.LatestChangedDtsFile,
+ tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(buildInfoPath, h.GetCurrentDirectory())),
+ ),
+ )
+ }
+ }
+
+ changedDtsTime, _ = h.mTimes.LoadOrStore(path, changedDtsTime)
+ return changedDtsTime
+}
+
+type compilerHostForTaskReporter struct {
+ host *solutionBuilderHost
+ trace func(msg string)
+}
+
+var _ compiler.CompilerHost = (*compilerHostForTaskReporter)(nil)
+
+func (h *compilerHostForTaskReporter) FS() vfs.FS {
+ return h.host.FS()
+}
+
+func (h *compilerHostForTaskReporter) DefaultLibraryPath() string {
+ return h.host.DefaultLibraryPath()
+}
+
+func (h *compilerHostForTaskReporter) GetCurrentDirectory() string {
+ return h.host.GetCurrentDirectory()
+}
+
+func (h *compilerHostForTaskReporter) Trace(msg string) {
+ h.trace(msg)
+}
+
+func (h *compilerHostForTaskReporter) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile {
+ return h.host.GetSourceFile(opts)
+}
+
+func (h *compilerHostForTaskReporter) GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine {
+ return h.host.GetResolvedProjectReference(fileName, path)
+}
diff --git a/internal/execute/solutionbuilder.go b/internal/execute/solutionbuilder.go
new file mode 100644
index 0000000000..fb0804ecc5
--- /dev/null
+++ b/internal/execute/solutionbuilder.go
@@ -0,0 +1,690 @@
+package execute
+
+import (
+ "io"
+ "strings"
+
+ "github.com/microsoft/typescript-go/internal/ast"
+ "github.com/microsoft/typescript-go/internal/collections"
+ "github.com/microsoft/typescript-go/internal/compiler"
+ "github.com/microsoft/typescript-go/internal/core"
+ "github.com/microsoft/typescript-go/internal/diagnostics"
+ "github.com/microsoft/typescript-go/internal/incremental"
+ "github.com/microsoft/typescript-go/internal/tsoptions"
+ "github.com/microsoft/typescript-go/internal/tspath"
+)
+
+type solutionBuilderOptions struct {
+ sys System
+ command *tsoptions.ParsedBuildCommandLine
+ testing CommandLineTesting
+}
+
+type solutionBuilder struct {
+ opts solutionBuilderOptions
+ comparePathsOptions tspath.ComparePathsOptions
+ host *solutionBuilderHost
+ orderGenerator *buildOrderGenerator
+}
+
+func (s *solutionBuilder) Build() CommandLineResult {
+ s.setup()
+ if s.opts.command.BuildOptions.Verbose.IsTrue() {
+ s.createBuilderStatusReporter(nil)(ast.NewCompilerDiagnostic(
+ diagnostics.Projects_in_this_build_Colon_0,
+ strings.Join(core.Map(s.orderGenerator.Order(), func(p string) string {
+ return "\r\n * " + s.relativeFileName(p)
+ }), ""),
+ ))
+ }
+ var buildResult solutionBuilderResult
+ if len(s.orderGenerator.errors) == 0 {
+ wg := core.NewWorkGroup(s.opts.command.CompilerOptions.SingleThreaded.IsTrue())
+ s.buildProjects(wg, s.opts.command.ResolvedProjectPaths(), &buildResult, &collections.SyncSet[tspath.Path]{})
+ wg.RunAndWait()
+ buildResult.statistics.projects = len(s.orderGenerator.Order())
+ } else {
+ s.buildResultOfCircularOrder(&buildResult)
+ }
+ buildResult.report(s)
+ return buildResult.result
+}
+
+func (s *solutionBuilder) Clean() CommandLineResult {
+ s.setup()
+ var buildResult solutionBuilderResult
+ if len(s.orderGenerator.errors) == 0 {
+ wg := core.NewWorkGroup(s.opts.command.CompilerOptions.SingleThreaded.IsTrue())
+ s.cleanProjects(wg, &buildResult)
+ wg.RunAndWait()
+ buildResult.statistics.projects = len(s.orderGenerator.Order())
+ } else {
+ s.buildResultOfCircularOrder(&buildResult)
+ }
+ buildResult.report(s)
+ return buildResult.result
+}
+
+func (s *solutionBuilder) buildResultOfCircularOrder(buildResult *solutionBuilderResult) {
+ buildResult.result.Status = ExitStatusProjectReferenceCycle_OutputsSkipped
+ reportDiagnostic := s.createDiagnosticReporter(nil)
+ for _, err := range s.orderGenerator.errors {
+ reportDiagnostic(err)
+ }
+ buildResult.errors = s.orderGenerator.errors
+}
+
+func (s *solutionBuilder) relativeFileName(fileName string) string {
+ return tspath.ConvertToRelativePath(fileName, s.comparePathsOptions)
+}
+
+func (s *solutionBuilder) toPath(fileName string) tspath.Path {
+ return tspath.ToPath(fileName, s.comparePathsOptions.CurrentDirectory, s.comparePathsOptions.UseCaseSensitiveFileNames)
+}
+
+func (s *solutionBuilder) setup() {
+ s.host = &solutionBuilderHost{
+ builder: s,
+ host: compiler.NewCachedFSCompilerHost(s.opts.sys.GetCurrentDirectory(), s.opts.sys.FS(), s.opts.sys.DefaultLibraryPath(), nil, nil),
+ }
+ s.orderGenerator = NewBuildOrderGenerator(s.opts.command, s.host, s.opts.command.CompilerOptions.SingleThreaded.IsTrue())
+}
+
+func (s *solutionBuilder) buildProjects(wg core.WorkGroup, projects []string, buildResult *solutionBuilderResult, seen *collections.SyncSet[tspath.Path]) {
+ for _, project := range projects {
+ s.startProjectBuild(wg, project, buildResult, seen)
+ }
+}
+
+func (s *solutionBuilder) startProjectBuild(wg core.WorkGroup, config string, buildResult *solutionBuilderResult, seen *collections.SyncSet[tspath.Path]) {
+ path := s.toPath(config)
+ if !seen.AddIfAbsent(path) {
+ return // Already seen this project
+ }
+ wg.Queue(func() {
+ task, ok := s.orderGenerator.tasks.Load(path)
+ if !ok {
+ panic("No build task found for " + config)
+ }
+
+ // Queue the upstream tasks
+ for _, upstream := range task.upStream {
+ if upstream.status != nil {
+ s.startProjectBuild(wg, upstream.config, buildResult, seen)
+ }
+ }
+
+ // Wait on upstream tasks to complete
+ upStreamStatus := make([]*upToDateStatus, len(task.upStream))
+ for i, upstream := range task.upStream {
+ if upstream.status != nil {
+ upStreamStatus[i] = <-upstream.status
+ }
+ }
+
+ status, taskReporter := s.buildProject(config, path, task, upStreamStatus)
+ for _, downstream := range task.downStream {
+ downstream.status <- status
+ }
+
+ // Wait for previous build task to complete reporting status, errors etc
+ if task.previousTaskReporter != nil {
+ <-task.previousTaskReporter
+ }
+ taskReporter.report(s, path, buildResult)
+ task.reporter <- taskReporter
+ })
+}
+
+func (s *solutionBuilder) getWriter(taskReporter *taskReporter) io.Writer {
+ if taskReporter == nil {
+ return s.opts.sys.Writer()
+ }
+ return &taskReporter.builder
+}
+
+func (s *solutionBuilder) createBuilderStatusReporter(taskReporter *taskReporter) diagnosticReporter {
+ return createBuilderStatusReporter(s.opts.sys, s.getWriter(taskReporter), s.opts.command.CompilerOptions, s.opts.testing)
+}
+
+func (s *solutionBuilder) createDiagnosticReporter(taskReporter *taskReporter) diagnosticReporter {
+ return createDiagnosticReporter(s.opts.sys, s.getWriter(taskReporter), s.opts.command.CompilerOptions)
+}
+
+func (s *solutionBuilder) createTaskReporter() *taskReporter {
+ var taskReporter taskReporter
+ taskReporter.reportStatus = s.createBuilderStatusReporter(&taskReporter)
+ taskReporter.diagnosticReporter = s.createDiagnosticReporter(&taskReporter)
+ return &taskReporter
+}
+
+func (s *solutionBuilder) buildProject(config string, path tspath.Path, task *buildTask, upStreamStatus []*upToDateStatus) (*upToDateStatus, *taskReporter) {
+ status := s.getUpToDateStatus(config, path, task, upStreamStatus)
+ taskReporter := s.createTaskReporter()
+
+ projectStatusReport := s.reportUpToDateStatus(config, status)
+ if projectStatusReport != nil {
+ taskReporter.reportStatus(projectStatusReport)
+ }
+
+ handled := s.handleStatusThatDoesntRequireBuild(config, task, status, taskReporter)
+ if handled != nil {
+ if task.resolved != nil {
+ for _, diagnostic := range task.resolved.GetConfigFileParsingDiagnostics() {
+ taskReporter.reportDiagnostic(diagnostic)
+ }
+ }
+ if len(taskReporter.errors) > 0 {
+ taskReporter.exitStatus = ExitStatusDiagnosticsPresent_OutputsSkipped
+ }
+ return handled, taskReporter
+ }
+
+ if s.opts.command.BuildOptions.Verbose.IsTrue() {
+ taskReporter.reportStatus(ast.NewCompilerDiagnostic(diagnostics.Building_project_0, s.relativeFileName(config)))
+ }
+
+ // Real build
+ var compileTimes compileTimes
+ configAndTime, _ := s.host.resolvedReferences.Load(path)
+ compileTimes.configTime = configAndTime.time
+ buildInfoReadStart := s.opts.sys.Now()
+ oldProgram := incremental.ReadBuildInfoProgram(task.resolved, s.host, s.host)
+ compileTimes.buildInfoReadTime = s.opts.sys.Now().Sub(buildInfoReadStart)
+ parseStart := s.opts.sys.Now()
+ program := compiler.NewProgram(compiler.ProgramOptions{
+ Config: task.resolved,
+ Host: &compilerHostForTaskReporter{
+ host: s.host,
+ trace: getTraceWithWriterFromSys(&taskReporter.builder, s.opts.testing),
+ },
+ JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors,
+ })
+ compileTimes.parseTime = s.opts.sys.Now().Sub(parseStart)
+ changesComputeStart := s.opts.sys.Now()
+ taskReporter.program = incremental.NewProgram(program, oldProgram, s.opts.testing != nil)
+ compileTimes.changesComputeTime = s.opts.sys.Now().Sub(changesComputeStart)
+
+ result, statistics := emitAndReportStatistics(
+ s.opts.sys,
+ taskReporter.program,
+ program,
+ task.resolved,
+ taskReporter.reportDiagnostic,
+ quietDiagnosticsReporter,
+ &taskReporter.builder,
+ compileTimes,
+ s.opts.testing,
+ )
+ taskReporter.exitStatus = result.status
+ taskReporter.statistics = statistics
+ if (!program.Options().NoEmitOnError.IsTrue() || len(result.diagnostics) == 0) &&
+ (len(result.emitResult.EmittedFiles) > 0 || status.kind != upToDateStatusTypeOutOfDateBuildInfoWithErrors) {
+ // Update time stamps for rest of the outputs
+ s.updateTimeStamps(config, task, taskReporter, result.emitResult.EmittedFiles, diagnostics.Updating_unchanged_output_timestamps_of_project_0)
+ }
+
+ if result.status == ExitStatusDiagnosticsPresent_OutputsSkipped || result.status == ExitStatusDiagnosticsPresent_OutputsGenerated {
+ status = &upToDateStatus{kind: upToDateStatusTypeBuildErrors}
+ } else {
+ status = &upToDateStatus{kind: upToDateStatusTypeUpToDate}
+ }
+ return status, taskReporter
+}
+
+func (s *solutionBuilder) handleStatusThatDoesntRequireBuild(config string, task *buildTask, status *upToDateStatus, taskReporter *taskReporter) *upToDateStatus {
+ switch status.kind {
+ case upToDateStatusTypeUpToDate:
+ if s.opts.command.BuildOptions.Dry.IsTrue() {
+ taskReporter.reportStatus(ast.NewCompilerDiagnostic(diagnostics.Project_0_is_up_to_date, config))
+ }
+ return status
+ case upToDateStatusTypeUpstreamErrors:
+ upstreamStatus := status.data.(*upstreamErrors)
+ if s.opts.command.BuildOptions.Verbose.IsTrue() {
+ taskReporter.reportStatus(ast.NewCompilerDiagnostic(
+ core.IfElse(
+ upstreamStatus.refHasUpstreamErrors,
+ diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built,
+ diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,
+ ),
+ s.relativeFileName(config),
+ s.relativeFileName(upstreamStatus.ref),
+ ))
+ }
+ return status
+ case upToDateStatusTypeSolution:
+ return status
+ case upToDateStatusTypeConfigFileNotFound:
+ taskReporter.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.File_0_not_found, config))
+ return status
+ }
+
+ // update timestamps
+ if status.IsPseudoBuild() {
+ if s.opts.command.BuildOptions.Dry.IsTrue() {
+ taskReporter.reportStatus(ast.NewCompilerDiagnostic(diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, config))
+ status = &upToDateStatus{kind: upToDateStatusTypeUpToDate}
+ return status
+ }
+
+ s.updateTimeStamps(config, task, taskReporter, nil, diagnostics.Updating_output_timestamps_of_project_0)
+ status = &upToDateStatus{kind: upToDateStatusTypeUpToDate}
+ return status
+ }
+
+ if s.opts.command.BuildOptions.Dry.IsTrue() {
+ taskReporter.reportStatus(ast.NewCompilerDiagnostic(diagnostics.A_non_dry_build_would_build_project_0, config))
+ status = &upToDateStatus{kind: upToDateStatusTypeUpToDate}
+ return status
+ }
+ return nil
+}
+
+func (s *solutionBuilder) getUpToDateStatus(config string, configPath tspath.Path, task *buildTask, upStreamStatus []*upToDateStatus) *upToDateStatus {
+ // Config file not found
+ if task.resolved == nil {
+ return &upToDateStatus{kind: upToDateStatusTypeConfigFileNotFound}
+ }
+
+ // Solution - nothing to build
+ if len(task.resolved.FileNames()) == 0 && task.resolved.ProjectReferences() != nil {
+ return &upToDateStatus{kind: upToDateStatusTypeSolution}
+ }
+
+ for index, upstreamStatus := range upStreamStatus {
+ if upstreamStatus == nil {
+ // Not dependent on this upstream project (expected cycle was detected and hence skipped)
+ continue
+ }
+
+ if s.opts.command.BuildOptions.StopBuildOnErrors.IsTrue() && upstreamStatus.IsError() {
+ // Upstream project has errors, so we cannot build this project
+ return &upToDateStatus{kind: upToDateStatusTypeUpstreamErrors, data: &upstreamErrors{task.resolved.ProjectReferences()[index].Path, upstreamStatus.kind == upToDateStatusTypeUpstreamErrors}}
+ }
+ }
+
+ if s.opts.command.BuildOptions.Force.IsTrue() {
+ return &upToDateStatus{kind: upToDateStatusTypeForceBuild}
+ }
+
+ // Check the build info
+ buildInfoPath := task.resolved.GetBuildInfoFileName()
+ buildInfo := s.host.readOrStoreBuildInfo(configPath, buildInfoPath)
+ if buildInfo == nil {
+ return &upToDateStatus{kind: upToDateStatusTypeOutputMissing, data: buildInfoPath}
+ }
+
+ // build info version
+ if !buildInfo.IsValidVersion() {
+ return &upToDateStatus{kind: upToDateStatusTypeTsVersionOutputOfDate, data: buildInfo.Version}
+ }
+
+ // Report errors if build info indicates errors
+ if buildInfo.Errors || // Errors that need to be reported irrespective of "--noCheck"
+ (!task.resolved.CompilerOptions().NoCheck.IsTrue() && (buildInfo.SemanticErrors || buildInfo.CheckPending)) { // Errors without --noCheck
+ return &upToDateStatus{kind: upToDateStatusTypeOutOfDateBuildInfoWithErrors, data: buildInfoPath}
+ }
+
+ if task.resolved.CompilerOptions().IsIncremental() {
+ if !buildInfo.IsIncremental() {
+ // Program options out of date
+ return &upToDateStatus{kind: upToDateStatusTypeOutOfDateOptions, data: buildInfoPath}
+ }
+
+ // Errors need to be reported if build info has errors
+ if (task.resolved.CompilerOptions().GetEmitDeclarations() && buildInfo.EmitDiagnosticsPerFile != nil) || // Always reported errors
+ (!task.resolved.CompilerOptions().NoCheck.IsTrue() && // Semantic errors if not --noCheck
+ (buildInfo.ChangeFileSet != nil || buildInfo.SemanticDiagnosticsPerFile != nil)) {
+ return &upToDateStatus{kind: upToDateStatusTypeOutOfDateBuildInfoWithErrors, data: buildInfoPath}
+ }
+
+ // Pending emit files
+ if !task.resolved.CompilerOptions().NoEmit.IsTrue() &&
+ (buildInfo.ChangeFileSet != nil || buildInfo.AffectedFilesPendingEmit != nil) {
+ return &upToDateStatus{kind: upToDateStatusTypeOutOfDateBuildInfoWithPendingEmit, data: buildInfoPath}
+ }
+
+ // Some of the emit files like source map or dts etc are not yet done
+ if buildInfo.IsEmitPending(task.resolved, tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(buildInfoPath, s.comparePathsOptions.CurrentDirectory))) {
+ return &upToDateStatus{kind: upToDateStatusTypeOutOfDateOptions, data: buildInfoPath}
+ }
+ }
+ var inputTextUnchanged bool
+ oldestOutputFileAndTime := fileAndTime{buildInfoPath, s.host.getMTime(buildInfoPath)}
+ var newestInputFileAndTime fileAndTime
+ var seenRoots collections.Set[tspath.Path]
+ var buildInfoRootInfoReader *incremental.BuildInfoRootInfoReader
+ for _, inputFile := range task.resolved.FileNames() {
+ inputTime := s.host.getMTime(inputFile)
+ if inputTime.IsZero() {
+ return &upToDateStatus{kind: upToDateStatusTypeInputFileMissing, data: inputFile}
+ }
+ inputPath := s.toPath(inputFile)
+ if inputTime.After(oldestOutputFileAndTime.time) {
+ var version string
+ var currentVersion string
+ if buildInfo.IsIncremental() {
+ if buildInfoRootInfoReader == nil {
+ buildInfoRootInfoReader = buildInfo.GetBuildInfoRootInfoReader(tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(buildInfoPath, s.comparePathsOptions.CurrentDirectory)), s.comparePathsOptions)
+ }
+ buildInfoFileInfo, resolvedInputPath := buildInfoRootInfoReader.GetBuildInfoFileInfo(inputPath)
+ if fileInfo := buildInfoFileInfo.GetFileInfo(); fileInfo != nil && fileInfo.Version() != "" {
+ version = fileInfo.Version()
+ if text, ok := s.host.FS().ReadFile(string(resolvedInputPath)); ok {
+ currentVersion = incremental.ComputeHash(text, s.opts.testing != nil)
+ if version == currentVersion {
+ inputTextUnchanged = true
+ }
+ }
+ }
+ }
+
+ if version == "" || version != currentVersion {
+ return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{inputFile, buildInfoPath}}
+ }
+ }
+ if inputTime.After(newestInputFileAndTime.time) {
+ newestInputFileAndTime = fileAndTime{inputFile, inputTime}
+ }
+ seenRoots.Add(inputPath)
+ }
+
+ if buildInfoRootInfoReader == nil {
+ buildInfoRootInfoReader = buildInfo.GetBuildInfoRootInfoReader(tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(buildInfoPath, s.comparePathsOptions.CurrentDirectory)), s.comparePathsOptions)
+ }
+ for root := range buildInfoRootInfoReader.Roots() {
+ if !seenRoots.Has(root) {
+ // File was root file when project was built but its not any more
+ return &upToDateStatus{kind: upToDateStatusTypeOutOfDateRoots, data: &inputOutputName{string(root), buildInfoPath}}
+ }
+ }
+
+ if !task.resolved.CompilerOptions().IsIncremental() {
+ // Check output file stamps
+ for outputFile := range task.resolved.GetOutputFileNames() {
+ outputTime := s.host.getMTime(outputFile)
+ if outputTime.IsZero() {
+ // Output file missing
+ return &upToDateStatus{kind: upToDateStatusTypeOutputMissing, data: outputFile}
+ }
+
+ if outputTime.Before(newestInputFileAndTime.time) {
+ // Output file is older than input file
+ return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{newestInputFileAndTime.file, outputFile}}
+ }
+
+ if outputTime.Before(oldestOutputFileAndTime.time) {
+ oldestOutputFileAndTime = fileAndTime{outputFile, outputTime}
+ }
+ }
+ }
+
+ var refDtsUnchanged bool
+ for index, upstreamStatus := range upStreamStatus {
+ if upstreamStatus == nil || upstreamStatus.kind == upToDateStatusTypeSolution {
+ // Not dependent on the status or this upstream project
+ // (eg: expected cycle was detected and hence skipped, or is solution)
+ continue
+ }
+
+ // If the upstream project's newest file is older than our oldest output,
+ // we can't be out of date because of it
+ // inputTime will not be present if we just built this project or updated timestamps
+ // - in that case we do want to either build or update timestamps
+ refInputOutputFileAndTime := upstreamStatus.InputOutputFileAndTime()
+ if refInputOutputFileAndTime != nil && !refInputOutputFileAndTime.input.time.IsZero() && refInputOutputFileAndTime.input.time.Before(oldestOutputFileAndTime.time) {
+ continue
+ }
+
+ // Check if tsbuildinfo path is shared, then we need to rebuild
+ if s.host.hasConflictingBuildInfo(configPath) {
+ return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{task.resolved.ProjectReferences()[index].Path, oldestOutputFileAndTime.file}}
+ }
+
+ // If the upstream project has only change .d.ts files, and we've built
+ // *after* those files, then we're "pseudo up to date" and eligible for a fast rebuild
+ newestDtsChangeTime := s.host.getLatestChangedDtsTime(task.resolved.ResolvedProjectReferencePaths()[index])
+ if !newestDtsChangeTime.IsZero() && newestDtsChangeTime.Before(oldestOutputFileAndTime.time) {
+ refDtsUnchanged = true
+ continue
+ }
+
+ // We have an output older than an upstream output - we are out of date
+ return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{task.resolved.ProjectReferences()[index].Path, oldestOutputFileAndTime.file}}
+ }
+
+ configStatus := s.checkInputFileTime(config, &oldestOutputFileAndTime)
+ if configStatus != nil {
+ return configStatus
+ }
+
+ for _, extendedConfig := range task.resolved.ExtendedSourceFiles() {
+ extendedConfigStatus := s.checkInputFileTime(extendedConfig, &oldestOutputFileAndTime)
+ if extendedConfigStatus != nil {
+ return extendedConfigStatus
+ }
+ }
+
+ // !!! sheetal TODO : watch??
+ // // Check package file time
+ // const packageJsonLookups = state.lastCachedPackageJsonLookups.get(resolvedPath);
+ // const dependentPackageFileStatus = packageJsonLookups && forEachKey(
+ // packageJsonLookups,
+ // path => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName),
+ // );
+ // if (dependentPackageFileStatus) return dependentPackageFileStatus;
+
+ return &upToDateStatus{
+ kind: core.IfElse(
+ refDtsUnchanged,
+ upToDateStatusTypeUpToDateWithUpstreamTypes,
+ core.IfElse(inputTextUnchanged, upToDateStatusTypeUpToDateWithInputFileText, upToDateStatusTypeUpToDate),
+ ),
+ data: &inputOutputFileAndTime{newestInputFileAndTime, oldestOutputFileAndTime, buildInfoPath},
+ }
+}
+
+func (s *solutionBuilder) checkInputFileTime(inputFile string, oldestOutputFileAndTime *fileAndTime) *upToDateStatus {
+ inputTime := s.host.getMTime(inputFile)
+ if inputTime.After(oldestOutputFileAndTime.time) {
+ // Output file is older than input file
+ return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{inputFile, oldestOutputFileAndTime.file}}
+ }
+ return nil
+}
+
+func (s *solutionBuilder) reportUpToDateStatus(config string, status *upToDateStatus) *ast.Diagnostic {
+ if !s.opts.command.BuildOptions.Verbose.IsTrue() {
+ return nil
+ }
+ switch status.kind {
+ case upToDateStatusTypeConfigFileNotFound:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_config_file_does_not_exist,
+ s.relativeFileName(config),
+ )
+ case upToDateStatusTypeUpstreamErrors:
+ upstreamStatus := status.data.(*upstreamErrors)
+ return ast.NewCompilerDiagnostic(
+ core.IfElse(
+ upstreamStatus.refHasUpstreamErrors,
+ diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built,
+ diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
+ ),
+ s.relativeFileName(config),
+ s.relativeFileName(upstreamStatus.ref),
+ )
+ case upToDateStatusTypeUpToDate:
+ inputOutputFileAndTime := status.data.(*inputOutputFileAndTime)
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2,
+ s.relativeFileName(config),
+ s.relativeFileName(inputOutputFileAndTime.input.file),
+ s.relativeFileName(inputOutputFileAndTime.output.file),
+ )
+ case upToDateStatusTypeUpToDateWithUpstreamTypes:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,
+ s.relativeFileName(config),
+ )
+ case upToDateStatusTypeUpToDateWithInputFileText:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,
+ s.relativeFileName(config),
+ )
+ case upToDateStatusTypeInputFileMissing:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_input_1_does_not_exist,
+ s.relativeFileName(config),
+ s.relativeFileName(status.data.(string)),
+ )
+ case upToDateStatusTypeOutputMissing:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist,
+ s.relativeFileName(config),
+ s.relativeFileName(status.data.(string)),
+ )
+ case upToDateStatusTypeInputFileNewer:
+ inputOutput := status.data.(*inputOutputName)
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,
+ s.relativeFileName(config),
+ s.relativeFileName(inputOutput.output),
+ s.relativeFileName(inputOutput.input),
+ )
+ case upToDateStatusTypeOutOfDateBuildInfoWithPendingEmit:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,
+ s.relativeFileName(config),
+ s.relativeFileName(status.data.(string)),
+ )
+ case upToDateStatusTypeOutOfDateBuildInfoWithErrors:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors,
+ s.relativeFileName(config),
+ s.relativeFileName(status.data.(string)),
+ )
+ case upToDateStatusTypeOutOfDateOptions:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions,
+ s.relativeFileName(config),
+ s.relativeFileName(status.data.(string)),
+ )
+ case upToDateStatusTypeOutOfDateRoots:
+ inputOutput := status.data.(*inputOutputName)
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,
+ s.relativeFileName(config),
+ s.relativeFileName(inputOutput.output),
+ s.relativeFileName(inputOutput.input),
+ )
+ case upToDateStatusTypeTsVersionOutputOfDate:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
+ s.relativeFileName(config),
+ core.Version(),
+ s.relativeFileName(status.data.(string)),
+ )
+ case upToDateStatusTypeForceBuild:
+ return ast.NewCompilerDiagnostic(
+ diagnostics.Project_0_is_being_forcibly_rebuilt,
+ s.relativeFileName(config),
+ s.relativeFileName(status.data.(string)),
+ )
+ }
+ return nil
+}
+
+func (s *solutionBuilder) updateTimeStamps(config string, task *buildTask, taskReporter *taskReporter, emittedFiles []string, verboseMessage *diagnostics.Message) {
+ if task.resolved.CompilerOptions().NoEmit.IsTrue() {
+ return
+ }
+ emitted := collections.NewSetFromItems(emittedFiles...)
+ var verboseMessageReported bool
+ updateTimeStamp := func(file string) {
+ if emitted.Has(file) {
+ return
+ }
+ if !verboseMessageReported && s.opts.command.BuildOptions.Verbose.IsTrue() {
+ taskReporter.reportStatus(ast.NewCompilerDiagnostic(verboseMessage, s.relativeFileName(config)))
+ verboseMessageReported = true
+ }
+ err := s.host.setMTime(file, s.opts.sys.Now())
+ if err != nil {
+ taskReporter.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Failed_to_update_timestamp_of_file_0, file))
+ }
+ }
+
+ if task.resolved.CompilerOptions().IsIncremental() {
+ updateTimeStamp(task.resolved.GetBuildInfoFileName())
+ } else {
+ for outputFile := range task.resolved.GetOutputFileNames() {
+ updateTimeStamp(outputFile)
+ }
+ }
+}
+
+func (s *solutionBuilder) cleanProjects(wg core.WorkGroup, buildResult *solutionBuilderResult) {
+ for _, config := range s.orderGenerator.Order() {
+ path := s.toPath(config)
+ wg.Queue(func() {
+ task, ok := s.orderGenerator.tasks.Load(path)
+ if !ok {
+ panic("No build task found for " + config)
+ }
+
+ taskReporterr := s.cleanProject(config, path, task)
+ // Wait for previous build task to complete reporting status, errors etc
+ if task.previousTaskReporter != nil {
+ <-task.previousTaskReporter
+ }
+ taskReporterr.report(s, path, buildResult)
+ task.reporter <- taskReporterr
+ })
+ }
+}
+
+func (s *solutionBuilder) cleanProject(config string, path tspath.Path, task *buildTask) *taskReporter {
+ var taskReporter taskReporter
+ if task.resolved == nil {
+ taskReporter.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.File_0_not_found, config))
+ return &taskReporter
+ }
+
+ inputs := collections.NewSetFromItems(core.Map(task.resolved.FileNames(), s.toPath)...)
+ for outputFile := range task.resolved.GetOutputFileNames() {
+ s.cleanProjectOutput(outputFile, inputs, &taskReporter)
+ }
+ s.cleanProjectOutput(task.resolved.GetBuildInfoFileName(), inputs, &taskReporter)
+ return &taskReporter
+}
+
+func (s *solutionBuilder) cleanProjectOutput(outputFile string, inputs *collections.Set[tspath.Path], taskReporter *taskReporter) {
+ outputPath := s.toPath(outputFile)
+ // If output name is same as input file name, do not delete and ignore the error
+ if inputs.Has(outputPath) {
+ return
+ }
+ if s.host.FS().FileExists(outputFile) {
+ if !s.opts.command.BuildOptions.Dry.IsTrue() {
+ err := s.host.FS().Remove(outputFile)
+ if err != nil {
+ taskReporter.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Failed_to_delete_file_0, outputFile))
+ }
+ } else {
+ taskReporter.filesToDelete = append(taskReporter.filesToDelete, outputFile)
+ }
+ }
+}
+
+func newSolutionBuilder(opts solutionBuilderOptions) *solutionBuilder {
+ solutionBuilder := &solutionBuilder{
+ opts: opts,
+ comparePathsOptions: tspath.ComparePathsOptions{
+ CurrentDirectory: opts.sys.GetCurrentDirectory(),
+ UseCaseSensitiveFileNames: opts.sys.FS().UseCaseSensitiveFileNames(),
+ },
+ }
+ return solutionBuilder
+}
diff --git a/internal/execute/system.go b/internal/execute/system.go
index db7a40907b..6f0bf0f1ae 100644
--- a/internal/execute/system.go
+++ b/internal/execute/system.go
@@ -24,8 +24,8 @@ type ExitStatus int
const (
ExitStatusSuccess ExitStatus = 0
- ExitStatusDiagnosticsPresent_OutputsSkipped ExitStatus = 1
- ExitStatusDiagnosticsPresent_OutputsGenerated ExitStatus = 2
+ ExitStatusDiagnosticsPresent_OutputsGenerated ExitStatus = 1
+ ExitStatusDiagnosticsPresent_OutputsSkipped ExitStatus = 2
ExitStatusInvalidProject_OutputsSkipped ExitStatus = 3
ExitStatusProjectReferenceCycle_OutputsSkipped ExitStatus = 4
ExitStatusNotImplemented ExitStatus = 5
diff --git a/internal/execute/testsys_test.go b/internal/execute/testsys_test.go
index 44875635a9..d83ffed5c7 100644
--- a/internal/execute/testsys_test.go
+++ b/internal/execute/testsys_test.go
@@ -12,6 +12,7 @@ import (
"time"
"github.com/microsoft/typescript-go/internal/collections"
+ "github.com/microsoft/typescript-go/internal/compiler"
"github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/execute"
"github.com/microsoft/typescript-go/internal/incremental"
@@ -54,6 +55,16 @@ interface Symbol {
declare const console: { log(msg: any): void; };
`)
+func getTestLibPathFor(libName string) string {
+ var libFile string
+ if value, ok := tsoptions.LibMap.Get(libName); ok {
+ libFile = value.(string)
+ } else {
+ libFile = "lib." + libName + ".d.ts"
+ }
+ return tscLibPath + "/" + libFile
+}
+
type TestClock struct {
start time.Time
now time.Time
@@ -207,34 +218,65 @@ func (s *testSys) GetEnvironmentVariable(name string) string {
return s.env[name]
}
-func (s *testSys) OnListFilesStart() {
- fmt.Fprintln(s.Writer(), listFileStart)
+func (s *testSys) OnEmittedFiles(result *compiler.EmitResult) {
+ if result != nil {
+ for _, file := range result.EmittedFiles {
+ // Ensure that the timestamp for emitted files is in the order
+ now := s.Now()
+ if err := s.fsFromFileMap().Chtimes(file, time.Time{}, now); err != nil {
+ panic("Failed to change time for emitted file: " + file + ": " + err.Error())
+ }
+ }
+ }
}
-func (s *testSys) OnListFilesEnd() {
- fmt.Fprintln(s.Writer(), listFileEnd)
+func (s *testSys) OnListFilesStart(w io.Writer) {
+ fmt.Fprintln(w, listFileStart)
}
-func (s *testSys) OnStatisticsStart() {
- fmt.Fprintln(s.Writer(), statisticsStart)
+func (s *testSys) OnListFilesEnd(w io.Writer) {
+ fmt.Fprintln(w, listFileEnd)
}
-func (s *testSys) OnStatisticsEnd() {
- fmt.Fprintln(s.Writer(), statisticsEnd)
+func (s *testSys) OnStatisticsStart(w io.Writer) {
+ fmt.Fprintln(w, statisticsStart)
}
-func (s *testSys) GetTrace() func(str string) {
+func (s *testSys) OnStatisticsEnd(w io.Writer) {
+ fmt.Fprintln(w, statisticsEnd)
+}
+
+func (s *testSys) OnBuildStatusReportStart(w io.Writer) {
+ fmt.Fprintln(w, buildStatusReportStart)
+}
+
+func (s *testSys) OnBuildStatusReportEnd(w io.Writer) {
+ fmt.Fprintln(w, buildStatusReportEnd)
+}
+
+func (s *testSys) GetTrace(w io.Writer) func(str string) {
return func(str string) {
- fmt.Fprintln(s.currentWrite, traceStart)
- defer fmt.Fprintln(s.currentWrite, traceEnd)
- s.tracer.Trace(str)
+ fmt.Fprintln(w, traceStart)
+ defer fmt.Fprintln(w, traceEnd)
+ // With tsc -b building projects in parallel we cannot serialize the package.json lookup trace
+ // so trace as if it wasnt cached
+ s.tracer.TraceWithWriter(w, str, w == s.Writer())
}
}
-func (s *testSys) baselineProgram(baseline *strings.Builder, program *incremental.Program, watcher *execute.Watcher) {
+func (s *testSys) baselinePrograms(baseline *strings.Builder, programs []*incremental.Program, watcher *execute.Watcher) {
if watcher != nil {
- program = watcher.GetProgram()
+ programs = []*incremental.Program{watcher.GetProgram()}
}
+ for index, program := range programs {
+ if index > 0 {
+ baseline.WriteString("\n")
+ }
+ s.baselineProgram(baseline, program)
+ }
+}
+
+func (s *testSys) baselineProgram(baseline *strings.Builder, program *incremental.Program) {
if program == nil {
return
}
@@ -288,14 +330,16 @@ var (
fakeTimeStamp = "HH:MM:SS AM"
fakeDuration = "d.ddds"
- buildStartingAt = "build starting at "
- buildFinishedIn = "build finished in "
- listFileStart = "!!! List files start"
- listFileEnd = "!!! List files end"
- statisticsStart = "!!! Statistics start"
- statisticsEnd = "!!! Statistics end"
- traceStart = "!!! Trace start"
- traceEnd = "!!! Trace end"
+ buildStartingAt = "build starting at "
+ buildFinishedIn = "build finished in "
+ listFileStart = "!!! List files start"
+ listFileEnd = "!!! List files end"
+ statisticsStart = "!!! Statistics start"
+ statisticsEnd = "!!! Statistics end"
+ buildStatusReportStart = "!!! Build Status Report Start"
+ buildStatusReportEnd = "!!! Build Status Report End"
+ traceStart = "!!! Trace start"
+ traceEnd = "!!! Trace end"
)
func (s *testSys) baselineOutput(baseline io.Writer) {
@@ -315,6 +359,15 @@ func (o *outputSanitizer) addOutputLine(s string) {
o.outputLines = append(o.outputLines, s)
}
+func (o *outputSanitizer) sanitizeBuildStatusTimeStamp() string {
+ statusLine := o.lines[o.index]
+ hhSeparator := strings.IndexRune(statusLine, ':')
+ if hhSeparator < 2 {
+ panic("Expected timestamp")
+ }
+ return statusLine[:hhSeparator-2] + fakeTimeStamp + statusLine[hhSeparator+len(fakeTimeStamp)-2:]
+}
+
func (o *outputSanitizer) transformLines() string {
for ; o.index < len(o.lines); o.index++ {
line := o.lines[o.index]
@@ -334,9 +387,10 @@ func (o *outputSanitizer) transformLines() string {
}
continue
}
- if !o.addOrSkipLinesForComparing(listFileStart, listFileEnd, false) &&
- !o.addOrSkipLinesForComparing(statisticsStart, statisticsEnd, true) &&
- !o.addOrSkipLinesForComparing(traceStart, traceEnd, false) {
+ if !o.addOrSkipLinesForComparing(listFileStart, listFileEnd, false, nil) &&
+ !o.addOrSkipLinesForComparing(statisticsStart, statisticsEnd, true, nil) &&
+ !o.addOrSkipLinesForComparing(traceStart, traceEnd, false, nil) &&
+ !o.addOrSkipLinesForComparing(buildStatusReportStart, buildStatusReportEnd, false, o.sanitizeBuildStatusTimeStamp) {
o.addOutputLine(line)
}
}
@@ -347,17 +401,24 @@ func (o *outputSanitizer) addOrSkipLinesForComparing(
lineStart string,
lineEnd string,
skipEvenIfNotComparing bool,
+ sanitizeFirstLine func() string,
) bool {
if o.lines[o.index] != lineStart {
return false
}
o.index++
+ isFirstLine := true
for ; o.index < len(o.lines); o.index++ {
if o.lines[o.index] == lineEnd {
return true
}
if !o.forComparing && !skipEvenIfNotComparing {
- o.addOutputLine(o.lines[o.index])
+ line := o.lines[o.index]
+ if isFirstLine && sanitizeFirstLine != nil {
+ line = sanitizeFirstLine()
+ isFirstLine = false
+ }
+ o.addOutputLine(line)
}
}
panic("Expected lineEnd" + lineEnd + " not found after " + lineStart)
@@ -466,6 +527,12 @@ func (s *testSys) writeFileNoError(path string, content string, writeByteOrderMa
}
}
+func (s *testSys) removeNoError(path string) {
+ if err := s.fsFromFileMap().Remove(path); err != nil {
+ panic(err)
+ }
+}
+
func (s *testSys) replaceFileText(path string, oldText string, newText string) {
content, ok := s.fsFromFileMap().ReadFile(path)
if !ok {
diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go
index 066685a34e..9c95260ebd 100644
--- a/internal/execute/tsc.go
+++ b/internal/execute/tsc.go
@@ -3,6 +3,7 @@ package execute
import (
"context"
"fmt"
+ "io"
"runtime"
"strings"
"time"
@@ -41,16 +42,20 @@ func applyBulkEdits(text string, edits []core.TextChange) string {
type CommandLineResult struct {
Status ExitStatus
- IncrementalProgram *incremental.Program
+ IncrementalProgram []*incremental.Program
Watcher *Watcher
}
type CommandLineTesting interface {
- OnListFilesStart()
- OnListFilesEnd()
- OnStatisticsStart()
- OnStatisticsEnd()
- GetTrace() func(str string)
+ // Ensure that all emitted files are timestamped in order to ensure they are deterministic for test baseline
+ OnEmittedFiles(result *compiler.EmitResult)
+ OnListFilesStart(w io.Writer)
+ OnListFilesEnd(w io.Writer)
+ OnStatisticsStart(w io.Writer)
+ OnStatisticsEnd(w io.Writer)
+ OnBuildStatusReportStart(w io.Writer)
+ OnBuildStatusReportEnd(w io.Writer)
+ GetTrace(w io.Writer) func(msg string)
}
func CommandLine(sys System, commandLineArgs []string, testing CommandLineTesting) CommandLineResult {
@@ -58,8 +63,7 @@ func CommandLine(sys System, commandLineArgs []string, testing CommandLineTestin
// !!! build mode
switch strings.ToLower(commandLineArgs[0]) {
case "-b", "--b", "-build", "--build":
- fmt.Fprintln(sys.Writer(), "Build mode is currently unsupported.")
- return CommandLineResult{Status: ExitStatusNotImplemented}
+ return tscBuildCompilation(sys, tsoptions.ParseBuildCommandLine(commandLineArgs, sys), testing)
// case "-f":
// return fmtMain(sys, commandLineArgs[1], commandLineArgs[1])
}
@@ -94,9 +98,48 @@ func fmtMain(sys System, input, output string) ExitStatus {
return ExitStatusSuccess
}
+func tscBuildCompilation(sys System, buildCommand *tsoptions.ParsedBuildCommandLine, testing CommandLineTesting) CommandLineResult {
+ reportDiagnostic := createDiagnosticReporter(sys, sys.Writer(), buildCommand.CompilerOptions)
+
+ // if (buildOptions.locale) {
+ // validateLocaleAndSetLanguage(buildOptions.locale, sys, errors);
+ // }
+
+ if len(buildCommand.Errors) > 0 {
+ for _, err := range buildCommand.Errors {
+ reportDiagnostic(err)
+ }
+ return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsSkipped}
+ }
+
+ if pprofDir := buildCommand.CompilerOptions.PprofDir; pprofDir != "" {
+ // !!! stderr?
+ profileSession := pprof.BeginProfiling(pprofDir, sys.Writer())
+ defer profileSession.Stop()
+ }
+
+ if buildCommand.CompilerOptions.Help.IsTrue() {
+ printVersion(sys)
+ printBuildHelp(sys, tsoptions.BuildOpts)
+ return CommandLineResult{Status: ExitStatusSuccess}
+ }
+
+ // !!! sheetal watch mode
+ solutionBuilder := newSolutionBuilder(solutionBuilderOptions{
+ sys,
+ buildCommand,
+ testing,
+ })
+ if buildCommand.BuildOptions.Clean.IsTrue() {
+ return solutionBuilder.Clean()
+ } else {
+ return solutionBuilder.Build()
+ }
+}
+
func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testing CommandLineTesting) CommandLineResult {
configFileName := ""
- reportDiagnostic := createDiagnosticReporter(sys, commandLine.CompilerOptions())
+ reportDiagnostic := createDiagnosticReporter(sys, sys.Writer(), commandLine.CompilerOptions())
// if commandLine.Options().Locale != nil
if len(commandLine.Errors) > 0 {
@@ -170,11 +213,11 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin
compilerOptionsFromCommandLine := commandLine.CompilerOptions()
configForCompilation := commandLine
var extendedConfigCache collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry]
- var configTime time.Duration
+ var compileTimes compileTimes
if configFileName != "" {
configStart := sys.Now()
configParseResult, errors := tsoptions.GetParsedCommandLineOfConfigFile(configFileName, compilerOptionsFromCommandLine, sys, &extendedConfigCache)
- configTime = sys.Now().Sub(configStart)
+ compileTimes.configTime = sys.Now().Sub(configStart)
if len(errors) != 0 {
// these are unrecoverable errors--exit to report them as diagnostics
for _, e := range errors {
@@ -184,15 +227,16 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin
}
configForCompilation = configParseResult
// Updater to reflect pretty
- reportDiagnostic = createDiagnosticReporter(sys, commandLine.CompilerOptions())
+ reportDiagnostic = createDiagnosticReporter(sys, sys.Writer(), commandLine.CompilerOptions())
}
+ reportErrorSummary := createReportErrorSummary(sys, configForCompilation.CompilerOptions())
if compilerOptionsFromCommandLine.ShowConfig.IsTrue() {
showConfig(sys, configForCompilation.CompilerOptions())
return CommandLineResult{Status: ExitStatusSuccess}
}
if configForCompilation.CompilerOptions().Watch.IsTrue() {
- watcher := createWatcher(sys, configForCompilation, reportDiagnostic, testing)
+ watcher := createWatcher(sys, configForCompilation, reportDiagnostic, reportErrorSummary, testing)
watcher.start()
return CommandLineResult{Status: ExitStatusSuccess, Watcher: watcher}
} else if configForCompilation.CompilerOptions().IsIncremental() {
@@ -200,8 +244,9 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin
sys,
configForCompilation,
reportDiagnostic,
+ reportErrorSummary,
&extendedConfigCache,
- configTime,
+ compileTimes,
testing,
)
}
@@ -209,8 +254,9 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin
sys,
configForCompilation,
reportDiagnostic,
+ reportErrorSummary,
&extendedConfigCache,
- configTime,
+ compileTimes,
testing,
)
}
@@ -230,12 +276,16 @@ func findConfigFile(searchPath string, fileExists func(string) bool, configName
}
func getTraceFromSys(sys System, testing CommandLineTesting) func(msg string) {
+ return getTraceWithWriterFromSys(sys.Writer(), testing)
+}
+
+func getTraceWithWriterFromSys(w io.Writer, testing CommandLineTesting) func(msg string) {
if testing == nil {
return func(msg string) {
- fmt.Fprintln(sys.Writer(), msg)
+ fmt.Fprintln(w, msg)
}
} else {
- return testing.GetTrace()
+ return testing.GetTrace(w)
}
}
@@ -243,14 +293,15 @@ func performIncrementalCompilation(
sys System,
config *tsoptions.ParsedCommandLine,
reportDiagnostic diagnosticReporter,
+ reportErrorSummary diagnosticsReporter,
extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry],
- configTime time.Duration,
+ compileTimes compileTimes,
testing CommandLineTesting,
) CommandLineResult {
host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, testing))
buildInfoReadStart := sys.Now()
oldProgram := incremental.ReadBuildInfoProgram(config, incremental.NewBuildInfoReader(host), host)
- buildInfoReadTime := sys.Now().Sub(buildInfoReadStart)
+ compileTimes.buildInfoReadTime = sys.Now().Sub(buildInfoReadStart)
// todo: cache, statistics, tracing
parseStart := sys.Now()
program := compiler.NewProgram(compiler.ProgramOptions{
@@ -258,25 +309,24 @@ func performIncrementalCompilation(
Host: host,
JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors,
})
- parseTime := sys.Now().Sub(parseStart)
+ compileTimes.parseTime = sys.Now().Sub(parseStart)
changesComputeStart := sys.Now()
incrementalProgram := incremental.NewProgram(program, oldProgram, testing != nil)
- changesComputeTime := sys.Now().Sub(changesComputeStart)
+ compileTimes.changesComputeTime = sys.Now().Sub(changesComputeStart)
+ result, _ := emitAndReportStatistics(
+ sys,
+ incrementalProgram,
+ incrementalProgram.GetProgram(),
+ config,
+ reportDiagnostic,
+ reportErrorSummary,
+ sys.Writer(),
+ compileTimes,
+ testing,
+ )
return CommandLineResult{
- Status: emitAndReportStatistics(
- sys,
- incrementalProgram,
- incrementalProgram.GetProgram(),
- config,
- reportDiagnostic,
- configTime,
- parseTime,
-
- buildInfoReadTime,
- changesComputeTime,
- testing,
- ),
- IncrementalProgram: incrementalProgram,
+ Status: result.status,
+ IncrementalProgram: []*incremental.Program{incrementalProgram},
}
}
@@ -284,8 +334,9 @@ func performCompilation(
sys System,
config *tsoptions.ParsedCommandLine,
reportDiagnostic diagnosticReporter,
+ reportErrorSummary diagnosticsReporter,
extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry],
- configTime time.Duration,
+ compileTimes compileTimes,
testing CommandLineTesting,
) CommandLineResult {
host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, testing))
@@ -296,20 +347,20 @@ func performCompilation(
Host: host,
JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors,
})
- parseTime := sys.Now().Sub(parseStart)
+ compileTimes.parseTime = sys.Now().Sub(parseStart)
+ result, _ := emitAndReportStatistics(
+ sys,
+ program,
+ program,
+ config,
+ reportDiagnostic,
+ reportErrorSummary,
+ sys.Writer(),
+ compileTimes,
+ testing,
+ )
return CommandLineResult{
- Status: emitAndReportStatistics(
- sys,
- program,
- program,
- config,
- reportDiagnostic,
- configTime,
- parseTime,
- 0,
- 0,
- testing,
- ),
+ Status: result.status,
}
}
@@ -319,23 +370,18 @@ func emitAndReportStatistics(
program *compiler.Program,
config *tsoptions.ParsedCommandLine,
reportDiagnostic diagnosticReporter,
- configTime time.Duration,
- parseTime time.Duration,
- buildInfoReadTime time.Duration,
- changesComputeTime time.Duration,
+ reportErrorSummary diagnosticsReporter,
+ w io.Writer,
+ compileTimes compileTimes,
testing CommandLineTesting,
-) ExitStatus {
- result := emitFilesAndReportErrors(sys, programLike, program, reportDiagnostic, testing)
+) (compileAndEmitResult, *statistics) {
+ var statistics *statistics
+ result := emitFilesAndReportErrors(sys, programLike, program, reportDiagnostic, reportErrorSummary, w, compileTimes, testing)
if result.status != ExitStatusSuccess {
// compile exited early
- return result.status
+ return result, nil
}
-
- result.configTime = configTime
- result.parseTime = parseTime
- result.buildInfoReadTime = buildInfoReadTime
- result.changesComputeTime = changesComputeTime
- result.totalTime = sys.SinceStart()
+ result.times.totalTime = sys.SinceStart()
if config.CompilerOptions().Diagnostics.IsTrue() || config.CompilerOptions().ExtendedDiagnostics.IsTrue() {
var memStats runtime.MemStats
@@ -344,21 +390,19 @@ func emitAndReportStatistics(
runtime.GC()
runtime.ReadMemStats(&memStats)
- reportStatistics(sys, program, result, &memStats, testing)
+ statistics = statisticsFromProgram(program, &compileTimes, &memStats)
+ statistics.report(w, testing)
}
if result.emitResult.EmitSkipped && len(result.diagnostics) > 0 {
- return ExitStatusDiagnosticsPresent_OutputsSkipped
+ result.status = ExitStatusDiagnosticsPresent_OutputsSkipped
} else if len(result.diagnostics) > 0 {
- return ExitStatusDiagnosticsPresent_OutputsGenerated
+ result.status = ExitStatusDiagnosticsPresent_OutputsGenerated
}
- return ExitStatusSuccess
+ return result, statistics
}
-type compileAndEmitResult struct {
- diagnostics []*ast.Diagnostic
- emitResult *compiler.EmitResult
- status ExitStatus
+type compileTimes struct {
configTime time.Duration
parseTime time.Duration
bindTime time.Duration
@@ -368,14 +412,24 @@ type compileAndEmitResult struct {
buildInfoReadTime time.Duration
changesComputeTime time.Duration
}
+type compileAndEmitResult struct {
+ diagnostics []*ast.Diagnostic
+ emitResult *compiler.EmitResult
+ status ExitStatus
+ times compileTimes
+}
func emitFilesAndReportErrors(
sys System,
programLike compiler.ProgramLike,
program *compiler.Program,
reportDiagnostic diagnosticReporter,
+ reportErrorSummary diagnosticsReporter,
+ w io.Writer,
+ compileTimes compileTimes,
testing CommandLineTesting,
) (result compileAndEmitResult) {
+ result.times = compileTimes
ctx := context.Background()
allDiagnostics := compiler.GetDiagnosticsOfAnyProgram(
@@ -389,13 +443,13 @@ func emitFilesAndReportErrors(
// early so we can track the time.
bindStart := sys.Now()
diags := programLike.GetBindDiagnostics(ctx, file)
- result.bindTime = sys.Now().Sub(bindStart)
+ result.times.bindTime = sys.Now().Sub(bindStart)
return diags
},
func(ctx context.Context, file *ast.SourceFile) []*ast.Diagnostic {
checkStart := sys.Now()
diags := programLike.GetSemanticDiagnostics(ctx, file)
- result.checkTime = sys.Now().Sub(checkStart)
+ result.times.checkTime = sys.Now().Sub(checkStart)
return diags
},
)
@@ -404,49 +458,50 @@ func emitFilesAndReportErrors(
if !programLike.Options().ListFilesOnly.IsTrue() {
emitStart := sys.Now()
emitResult = programLike.Emit(ctx, compiler.EmitOptions{})
- result.emitTime = sys.Now().Sub(emitStart)
+ result.times.emitTime = sys.Now().Sub(emitStart)
}
if emitResult != nil {
allDiagnostics = append(allDiagnostics, emitResult.Diagnostics...)
}
+ if testing != nil {
+ testing.OnEmittedFiles(emitResult)
+ }
allDiagnostics = compiler.SortAndDeduplicateDiagnostics(allDiagnostics)
for _, diagnostic := range allDiagnostics {
reportDiagnostic(diagnostic)
}
- listFiles(sys, program, emitResult, testing)
+ listFiles(w, program, emitResult, testing)
- createReportErrorSummary(sys, programLike.Options())(allDiagnostics)
+ reportErrorSummary(allDiagnostics)
result.diagnostics = allDiagnostics
result.emitResult = emitResult
result.status = ExitStatusSuccess
return result
}
-// func isBuildCommand(args []string) bool {
-// return len(args) > 0 && args[0] == "build"
-// }
-
func showConfig(sys System, config *core.CompilerOptions) {
// !!!
_ = jsonutil.MarshalIndentWrite(sys.Writer(), config, "", " ")
}
-func listFiles(sys System, program *compiler.Program, emitResult *compiler.EmitResult, testing CommandLineTesting) {
+func listFiles(w io.Writer, program *compiler.Program, emitResult *compiler.EmitResult, testing CommandLineTesting) {
if testing != nil {
- testing.OnListFilesStart()
- defer testing.OnListFilesEnd()
- }
- for _, file := range emitResult.EmittedFiles {
- fmt.Fprintln(sys.Writer(), "TSFILE: ", tspath.GetNormalizedAbsolutePath(file, sys.GetCurrentDirectory()))
+ testing.OnListFilesStart(w)
+ defer testing.OnListFilesEnd(w)
}
options := program.Options()
+ if options.ListEmittedFiles.IsTrue() {
+ for _, file := range emitResult.EmittedFiles {
+ fmt.Fprintln(w, "TSFILE: ", tspath.GetNormalizedAbsolutePath(file, program.GetCurrentDirectory()))
+ }
+ }
if options.ExplainFiles.IsTrue() {
- program.ExplainFiles(sys.Writer())
+ program.ExplainFiles(w)
} else if options.ListFiles.IsTrue() || options.ListFilesOnly.IsTrue() {
for _, file := range program.GetSourceFiles() {
- fmt.Fprintln(sys.Writer(), file.FileName())
+ fmt.Fprintln(w, file.FileName())
}
}
}
diff --git a/internal/execute/tsc_test.go b/internal/execute/tsc_test.go
index 8b9f56d242..6524dcf23c 100644
--- a/internal/execute/tsc_test.go
+++ b/internal/execute/tsc_test.go
@@ -129,97 +129,220 @@ func TestTscCommandline(t *testing.T) {
}
}
-func TestNoEmit(t *testing.T) {
+func TestTscComposite(t *testing.T) {
t.Parallel()
- (&tscInput{
- subScenario: "when project has strict true",
- files: FileMap{
- "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
- {
- "compilerOptions": {
- "incremental": true,
- "strict": true
- }
- }`),
- "/home/src/workspaces/project/class1.ts": `export class class1 {}`,
+ testCases := []*tscInput{
+ {
+ subScenario: "when setting composite false on command line",
+ files: FileMap{
+ "/home/src/workspaces/project/src/main.ts": "export const x = 10;",
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "target": "es5",
+ "module": "commonjs",
+ "composite": true,
+ },
+ "include": [
+ "src/**/*.ts",
+ ],
+ }`),
+ },
+ commandLineArgs: []string{"--composite", "false"},
},
- commandLineArgs: []string{"--noEmit"},
- }).run(t, "noEmit")
-}
-
-func TestExtends(t *testing.T) {
- t.Parallel()
- extendsSysScenario := func(subScenario string, commandlineArgs []string) *tscInput {
- return &tscInput{
- subScenario: subScenario,
- commandLineArgs: commandlineArgs,
+ {
+ // !!! sheetal null is not reflected in final options
+ subScenario: "when setting composite null on command line",
files: FileMap{
- "/home/src/projects/configs/first/tsconfig.json": stringtestutil.Dedent(`
+ "/home/src/workspaces/project/src/main.ts": "export const x = 10;",
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
{
- "extends": "../second/tsconfig.json",
- "include": ["${configDir}/src"],
"compilerOptions": {
- "typeRoots": ["root1", "${configDir}/root2", "root3"],
- "types": [],
- }
+ "target": "es5",
+ "module": "commonjs",
+ "composite": true,
+ },
+ "include": [
+ "src/**/*.ts",
+ ],
}`),
- "/home/src/projects/configs/second/tsconfig.json": stringtestutil.Dedent(`
+ },
+ commandLineArgs: []string{"--composite", "null"},
+ },
+ {
+ subScenario: "when setting composite false on command line but has tsbuild info in config",
+ files: FileMap{
+ "/home/src/workspaces/project/src/main.ts": "export const x = 10;",
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
{
- "files": ["${configDir}/main.ts"],
"compilerOptions": {
- "declarationDir": "${configDir}/decls",
- "paths": {
- "@myscope/*": ["${configDir}/types/*"],
- "other/*": ["other/*"],
- },
- "baseUrl": "${configDir}",
+ "target": "es5",
+ "module": "commonjs",
+ "composite": true,
+ "tsBuildInfoFile": "tsconfig.json.tsbuildinfo",
},
- "watchOptions": {
- "excludeFiles": ["${configDir}/main.ts"],
+ "include": [
+ "src/**/*.ts",
+ ],
+ }`),
+ },
+ commandLineArgs: []string{"--composite", "false"},
+ },
+ {
+ subScenario: "when setting composite false and tsbuildinfo as null on command line but has tsbuild info in config",
+ files: FileMap{
+ "/home/src/workspaces/project/src/main.ts": "export const x = 10;",
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "target": "es5",
+ "module": "commonjs",
+ "composite": true,
+ "tsBuildInfoFile": "tsconfig.json.tsbuildinfo",
},
+ "include": [
+ "src/**/*.ts",
+ ],
}`),
- "/home/src/projects/myproject/tsconfig.json": stringtestutil.Dedent(`
+ },
+ commandLineArgs: []string{"--composite", "false", "--tsBuildInfoFile", "null"},
+ },
+ {
+ subScenario: "converting to modules",
+ files: FileMap{
+ "/home/src/workspaces/project/src/main.ts": "const x = 10;",
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
{
- "extends": "../configs/first/tsconfig.json",
"compilerOptions": {
- "declaration": true,
- "outDir": "outDir",
- "traceResolution": true,
+ "module": "none",
+ "composite": true,
},
}`),
- "/home/src/projects/myproject/main.ts": stringtestutil.Dedent(`
- // some comment
- export const y = 10;
- import { x } from "@myscope/sometype";
+ },
+ edits: []*tscEdit{
+ {
+ caption: "convert to modules",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/tsconfig.json", "none", "es2015")
+ },
+ },
+ },
+ },
+ {
+ subScenario: "synthetic jsx import of ESM module from CJS module no crash no jsx element",
+ files: FileMap{
+ "/home/src/projects/project/src/main.ts": "export default 42;",
+ "/home/src/projects/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "module": "Node16",
+ "jsx": "react-jsx",
+ "jsxImportSource": "solid-js",
+ },
+ }`),
+ "/home/src/projects/project/node_modules/solid-js/package.json": stringtestutil.Dedent(`
+ {
+ "name": "solid-js",
+ "type": "module"
+ }
`),
- "/home/src/projects/myproject/src/secondary.ts": stringtestutil.Dedent(`
- // some comment
- export const z = 10;
- import { k } from "other/sometype2";
+ "/home/src/projects/project/node_modules/solid-js/jsx-runtime.d.ts": stringtestutil.Dedent(`
+ export namespace JSX {
+ type IntrinsicElements = { div: {}; };
+ }
`),
- "/home/src/projects/myproject/types/sometype.ts": stringtestutil.Dedent(`
- // some comment
- export const x = 10;
+ },
+ cwd: "/home/src/projects/project",
+ },
+ {
+ subScenario: "synthetic jsx import of ESM module from CJS module error on jsx element",
+ files: FileMap{
+ "/home/src/projects/project/src/main.tsx": "export default
;",
+ "/home/src/projects/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "module": "Node16",
+ "jsx": "react-jsx",
+ "jsxImportSource": "solid-js",
+ },
+ }`),
+ "/home/src/projects/project/node_modules/solid-js/package.json": stringtestutil.Dedent(`
+ {
+ "name": "solid-js",
+ "type": "module"
+ }
`),
- "/home/src/projects/myproject/root2/other/sometype2/index.d.ts": stringtestutil.Dedent(`
- export const k = 10;
+ "/home/src/projects/project/node_modules/solid-js/jsx-runtime.d.ts": stringtestutil.Dedent(`
+ export namespace JSX {
+ type IntrinsicElements = { div: {}; };
+ }
`),
},
- cwd: "/home/src/projects/myproject",
- }
+ cwd: "/home/src/projects/project",
+ },
}
- cases := []*tscInput{
- extendsSysScenario("configDir template", []string{"--explainFiles"}),
- extendsSysScenario("configDir template showConfig", []string{"--showConfig"}),
- extendsSysScenario("configDir template with commandline", []string{"--explainFiles", "--outDir", "${configDir}/outDir"}),
+ for _, testCase := range testCases {
+ testCase.run(t, "composite")
}
+}
- for _, c := range cases {
- c.run(t, "extends")
+func TestTscListFilesOnly(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "loose file",
+ files: FileMap{
+ "/home/src/workspaces/project/test.ts": "export const x = 1;",
+ },
+ commandLineArgs: []string{"test.ts", "--listFilesOnly"},
+ },
+ {
+ subScenario: "combined with incremental",
+ files: FileMap{
+ "/home/src/workspaces/project/test.ts": "export const x = 1;",
+ "/home/src/workspaces/project/tsconfig.json": "{}",
+ },
+ commandLineArgs: []string{"--incremental", "--listFilesOnly"},
+ edits: []*tscEdit{
+ {
+ caption: "incremental actual build",
+ commandLineArgs: []string{"--incremental"},
+ },
+ noChange,
+ {
+ caption: "incremental should not build",
+ commandLineArgs: []string{"--incremental"},
+ },
+ },
+ },
+ }
+
+ for _, testCase := range testCases {
+ testCase.run(t, "listFilesOnly")
}
}
+func TestNoEmit(t *testing.T) {
+ t.Parallel()
+ (&tscInput{
+ subScenario: "when project has strict true",
+ files: FileMap{
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "incremental": true,
+ "strict": true
+ }
+ }`),
+ "/home/src/workspaces/project/class1.ts": `export class class1 {}`,
+ },
+ commandLineArgs: []string{"--noEmit"},
+ }).run(t, "noEmit")
+}
+
func TestTypeAcquisition(t *testing.T) {
t.Parallel()
(&tscInput{
diff --git a/internal/execute/tscbuild_test.go b/internal/execute/tscbuild_test.go
new file mode 100644
index 0000000000..18d948914d
--- /dev/null
+++ b/internal/execute/tscbuild_test.go
@@ -0,0 +1,1337 @@
+package execute_test
+
+import (
+ "fmt"
+ "slices"
+ "strings"
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/core"
+ "github.com/microsoft/typescript-go/internal/testutil/stringtestutil"
+ "github.com/microsoft/typescript-go/internal/vfs/vfstest"
+)
+
+func TestBuildCommandLine(t *testing.T) {
+ t.Parallel()
+ testCases := slices.Concat(
+ []*tscInput{
+ {
+ subScenario: "help",
+ files: FileMap{},
+ commandLineArgs: []string{"--build", "--help"},
+ },
+ {
+ subScenario: "different options",
+ files: getBuildCommandLineDifferentOptionsMap("composite"),
+ commandLineArgs: []string{"--build", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "with sourceMap",
+ commandLineArgs: []string{"--build", "--verbose", "--sourceMap"},
+ },
+ {
+ caption: "should re-emit only js so they dont contain sourcemap",
+ },
+ {
+ caption: "with declaration should not emit anything",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration"},
+ },
+ noChange,
+ {
+ caption: "with declaration and declarationMap",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration", "--declarationMap"},
+ },
+ {
+ caption: "should re-emit only dts so they dont contain sourcemap",
+ },
+ {
+ caption: "with emitDeclarationOnly should not emit anything",
+ commandLineArgs: []string{"--build", "--verbose", "--emitDeclarationOnly"},
+ },
+ noChange,
+ {
+ caption: "local change",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/a.ts", "Local = 1", "Local = 10")
+ },
+ },
+ {
+ caption: "with declaration should not emit anything",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration"},
+ },
+ {
+ caption: "with inlineSourceMap",
+ commandLineArgs: []string{"--build", "--verbose", "--inlineSourceMap"},
+ },
+ {
+ caption: "with sourceMap",
+ commandLineArgs: []string{"--build", "--verbose", "--sourceMap"},
+ },
+ },
+ },
+ {
+ subScenario: "different options with incremental",
+ files: getBuildCommandLineDifferentOptionsMap("incremental"),
+ commandLineArgs: []string{"--build", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "with sourceMap",
+ commandLineArgs: []string{"--build", "--verbose", "--sourceMap"},
+ },
+ {
+ caption: "should re-emit only js so they dont contain sourcemap",
+ },
+ {
+ caption: "with declaration, emit Dts and should not emit js",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration"},
+ },
+ {
+ caption: "with declaration and declarationMap",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration", "--declarationMap"},
+ },
+ noChange,
+ {
+ caption: "local change",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/a.ts", "Local = 1", "Local = 10")
+ },
+ },
+ {
+ caption: "with declaration and declarationMap",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration", "--declarationMap"},
+ },
+ noChange,
+ {
+ caption: "with inlineSourceMap",
+ commandLineArgs: []string{"--build", "--verbose", "--inlineSourceMap"},
+ },
+ {
+ caption: "with sourceMap",
+ commandLineArgs: []string{"--build", "--verbose", "--sourceMap"},
+ },
+ {
+ caption: "emit js files",
+ },
+ {
+ caption: "with declaration and declarationMap",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration", "--declarationMap"},
+ },
+ {
+ caption: "with declaration and declarationMap, should not re-emit",
+ commandLineArgs: []string{"--build", "--verbose", "--declaration", "--declarationMap"},
+ },
+ },
+ },
+ },
+ getBuildCommandLineEmitDeclarationOnlyTestCases([]string{"composite"}, ""),
+ getBuildCommandLineEmitDeclarationOnlyTestCases([]string{"incremental", "declaration"}, " with declaration and incremental"),
+ getBuildCommandLineEmitDeclarationOnlyTestCases([]string{"declaration"}, " with declaration"),
+ )
+
+ for _, test := range testCases {
+ test.run(t, "commandLine")
+ }
+}
+
+func TestBuildClean(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "file name and output name clashing",
+ files: FileMap{
+ "/home/src/workspaces/solution/index.js": "",
+ "/home/src/workspaces/solution/bar.ts": "",
+ "/home/src/workspaces/solution/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "allowJs": true }
+ }`),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "--clean"},
+ },
+ {
+ subScenario: "tsx with dts emit",
+ files: FileMap{
+ "/home/src/workspaces/solution/project/src/main.tsx": "export const x = 10;",
+ "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "declaration": true },
+ "include": ["src/**/*.tsx", "src/**/*.ts"]
+ }`),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "project", "-v", "--explainFiles"},
+ edits: []*tscEdit{
+ noChange,
+ {
+ caption: "clean build",
+ commandLineArgs: []string{"-b", "project", "--clean"},
+ },
+ },
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "clean")
+ }
+}
+
+func TestBuildConfigFileErrors(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "when tsconfig extends the missing file",
+ files: FileMap{
+ "/home/src/workspaces/project/tsconfig.first.json": stringtestutil.Dedent(`
+ {
+ "extends": "./foobar.json",
+ "compilerOptions": {
+ "composite": true
+ }
+ }`),
+ "/home/src/workspaces/project/tsconfig.second.json": stringtestutil.Dedent(`
+ {
+ "extends": "./foobar.json",
+ "compilerOptions": {
+ "composite": true
+ }
+ }`),
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "./tsconfig.first.json" },
+ { "path": "./tsconfig.second.json" }
+ ]
+ }`),
+ },
+ commandLineArgs: []string{"--b"},
+ },
+ {
+ subScenario: "reports syntax errors in config file",
+ files: FileMap{
+ "/home/src/workspaces/project/a.ts": "export function foo() { }",
+ "/home/src/workspaces/project/b.ts": "export function bar() { }",
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ },
+ "files": [
+ "a.ts"
+ "b.ts"
+ ]
+ }`),
+ },
+ commandLineArgs: []string{"--b"},
+ edits: []*tscEdit{
+ {
+ caption: "reports syntax errors after change to config file",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/tsconfig.json", ",", `, "declaration": true`)
+ },
+ },
+ {
+ caption: "reports syntax errors after change to ts file",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/project/a.ts", "export function fooBar() { }")
+ },
+ },
+ noChange,
+ {
+ caption: "builds after fixing config file errors",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/workspaces/project/tsconfig.json", stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true, "declaration": true
+ },
+ "files": [
+ "a.ts",
+ "b.ts"
+ ]
+ }`), false)
+ },
+ },
+ },
+ },
+ {
+ subScenario: "missing config file",
+ files: FileMap{},
+ commandLineArgs: []string{"--b", "bogus.json"},
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "configFileErrors")
+ }
+}
+
+func TestBuildEmitDeclarationOnly(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ getBuildEmitDeclarationOnlyTestCase(false),
+ getBuildEmitDeclarationOnlyTestCase(true),
+ {
+ subScenario: `only dts output in non circular imports project with emitDeclarationOnly`,
+ files: getBuildEmitDeclarationOnlyImportFileMap(true, false),
+ commandLineArgs: []string{"--b", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "incremental-declaration-doesnt-change",
+ edit: func(sys *testSys) {
+ sys.replaceFileText(
+ "/home/src/workspaces/project/src/a.ts",
+ "export interface A {",
+ stringtestutil.Dedent(`
+ class C { }
+ export interface A {`),
+ )
+ },
+ },
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/src/a.ts", "b: B;", "b: B; foo: any;")
+ },
+ },
+ },
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "emitDeclarationOnly")
+ }
+}
+
+func TestBuildFileDelete(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "detects deleted file",
+ files: FileMap{
+ "/home/src/workspaces/solution/child/child.ts": stringtestutil.Dedent(`
+ import { child2 } from "../child/child2";
+ export function child() {
+ child2();
+ }
+ `),
+ "/home/src/workspaces/solution/child/child2.ts": stringtestutil.Dedent(`
+ export function child2() {
+ }
+ `),
+ "/home/src/workspaces/solution/child/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true }
+ }
+ `),
+ "/home/src/workspaces/solution/main/main.ts": stringtestutil.Dedent(`
+ import { child } from "../child/child";
+ export function main() {
+ child();
+ }
+ `),
+ "/home/src/workspaces/solution/main/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true },
+ "references": [{ "path": "../child" }],
+ }
+ `),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "main/tsconfig.json", "-v", "--traceResolution", "--explainFiles"},
+ edits: []*tscEdit{
+ {
+ caption: "delete child2 file",
+ edit: func(sys *testSys) {
+ sys.removeNoError("/home/src/workspaces/solution/child/child2.ts")
+ sys.removeNoError("/home/src/workspaces/solution/child/child2.js")
+ sys.removeNoError("/home/src/workspaces/solution/child/child2.d.ts")
+ },
+ },
+ },
+ },
+ {
+ subScenario: "deleted file without composite",
+ files: FileMap{
+ "/home/src/workspaces/solution/child/child.ts": stringtestutil.Dedent(`
+ import { child2 } from "../child/child2";
+ export function child() {
+ child2();
+ }
+ `),
+ "/home/src/workspaces/solution/child/child2.ts": stringtestutil.Dedent(`
+ export function child2() {
+ }
+ `),
+ "/home/src/workspaces/solution/child/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { }
+ }
+ `),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "child/tsconfig.json", "-v", "--traceResolution", "--explainFiles"},
+ edits: []*tscEdit{
+ {
+ caption: "delete child2 file",
+ edit: func(sys *testSys) {
+ sys.removeNoError("/home/src/workspaces/solution/child/child2.ts")
+ sys.removeNoError("/home/src/workspaces/solution/child/child2.js")
+ },
+ },
+ },
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "fileDelete")
+ }
+}
+
+func TestBuildInferredTypeFromTransitiveModule(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "inferred type from transitive module",
+ files: getBuildInferredTypeFromTransitiveModuleMap(false, ""),
+ commandLineArgs: []string{"--b", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/bar.ts", "param: string", "")
+ },
+ },
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/bar.ts", "foobar()", "foobar(param: string)")
+ },
+ },
+ },
+ },
+ {
+ subScenario: "inferred type from transitive module with isolatedModules",
+ files: getBuildInferredTypeFromTransitiveModuleMap(true, ""),
+ commandLineArgs: []string{"--b", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/bar.ts", "param: string", "")
+ },
+ },
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/bar.ts", "foobar()", "foobar(param: string)")
+ },
+ },
+ },
+ },
+ {
+ subScenario: "reports errors in files affected by change in signature with isolatedModules",
+ files: getBuildInferredTypeFromTransitiveModuleMap(true, stringtestutil.Dedent(`
+ import { default as bar } from './bar';
+ bar("hello");
+ `)),
+ commandLineArgs: []string{"--b", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/bar.ts", "param: string", "")
+ },
+ },
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/bar.ts", "foobar()", "foobar(param: string)")
+ },
+ },
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/bar.ts", "param: string", "")
+ },
+ },
+ {
+ caption: "Fix Error",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/lazyIndex.ts", `bar("hello")`, "bar()")
+ },
+ },
+ },
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "inferredTypeFromTransitiveModule")
+ }
+}
+
+func TestBuildJavascriptProjectEmit(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ // !!! sheetal errors seem different
+ subScenario: "loads js-based projects and emits them correctly",
+ files: FileMap{
+ "/home/src/workspaces/solution/common/nominal.js": stringtestutil.Dedent(`
+ /**
+ * @template T, Name
+ * @typedef {T & {[Symbol.species]: Name}} Nominal
+ */
+ module.exports = {};
+ `),
+ "/home/src/workspaces/solution/common/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ },
+ "include": ["nominal.js"],
+ }
+ `),
+ "/home/src/workspaces/solution/sub-project/index.js": stringtestutil.Dedent(`
+ import { Nominal } from '../common/nominal';
+
+ /**
+ * @typedef {Nominal} MyNominal
+ */
+ `),
+ "/home/src/workspaces/solution/sub-project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "../common" },
+ ],
+ "include": ["./index.js"],
+ }`),
+ "/home/src/workspaces/solution/sub-project-2/index.js": stringtestutil.Dedent(`
+ import { MyNominal } from '../sub-project/index';
+
+ const variable = {
+ key: /** @type {MyNominal} */('value'),
+ };
+
+ /**
+ * @return {keyof typeof variable}
+ */
+ export function getVar() {
+ return 'key';
+ }
+ `),
+ "/home/src/workspaces/solution/sub-project-2/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "../sub-project" },
+ ],
+ "include": ["./index.js"],
+ }`),
+ "/home/src/workspaces/solution/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "./sub-project" },
+ { "path": "./sub-project-2" },
+ ],
+ "include": [],
+ }`),
+ "/home/src/workspaces/solution/tsconfig.base.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "skipLibCheck": true,
+ "rootDir": "./",
+ "outDir": "../lib",
+ "allowJs": true,
+ "checkJs": true,
+ "declaration": true,
+ },
+ }`),
+ tscLibPath + "/lib.d.ts": strings.Replace(tscDefaultLibContent, "interface SymbolConstructor {", "interface SymbolConstructor {\n readonly species: symbol;", 1),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b"},
+ },
+ {
+ subScenario: `loads js-based projects with non-moved json files and emits them correctly`,
+ files: FileMap{
+ "/home/src/workspaces/solution/common/obj.json": stringtestutil.Dedent(`
+ {
+ "val": 42,
+ }`),
+ "/home/src/workspaces/solution/common/index.ts": stringtestutil.Dedent(`
+ import x = require("./obj.json");
+ export = x;
+ `),
+ "/home/src/workspaces/solution/common/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": null,
+ "composite": true,
+ },
+ "include": ["index.ts", "obj.json"],
+ }`),
+ "/home/src/workspaces/solution/sub-project/index.js": stringtestutil.Dedent(`
+ import mod from '../common';
+
+ export const m = mod;
+ `),
+ "/home/src/workspaces/solution/sub-project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "../common" },
+ ],
+ "include": ["./index.js"],
+ }`),
+ "/home/src/workspaces/solution/sub-project-2/index.js": stringtestutil.Dedent(`
+ import { m } from '../sub-project/index';
+
+ const variable = {
+ key: m,
+ };
+
+ export function getVar() {
+ return variable;
+ }
+ `),
+ "/home/src/workspaces/solution/sub-project-2/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "../sub-project" },
+ ],
+ "include": ["./index.js"],
+ }`),
+ "/home/src/workspaces/solution/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "./sub-project" },
+ { "path": "./sub-project-2" },
+ ],
+ "include": [],
+ }`),
+ "/home/src/workspaces/solution/tsconfig.base.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "skipLibCheck": true,
+ "rootDir": "./",
+ "outDir": "../out",
+ "allowJs": true,
+ "checkJs": true,
+ "resolveJsonModule": true,
+ "esModuleInterop": true,
+ "declaration": true,
+ },
+ }`),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"-b"},
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "javascriptProjectEmit")
+ }
+}
+
+func TestBuildLateBoundSymbol(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "interface is merged and contains late bound member",
+ files: FileMap{
+ "/home/src/workspaces/project/src/globals.d.ts": stringtestutil.Dedent(`
+ interface SymbolConstructor {
+ (description?: string | number): symbol;
+ }
+ declare var Symbol: SymbolConstructor;
+ `),
+ "/home/src/workspaces/project/src/hkt.ts": `export interface HKT { }`,
+ "/home/src/workspaces/project/src/main.ts": stringtestutil.Dedent(`
+ import { HKT } from "./hkt";
+
+ const sym = Symbol();
+
+ declare module "./hkt" {
+ interface HKT {
+ [sym]: { a: T }
+ }
+ }
+ const x = 10;
+ type A = HKT[typeof sym];
+ `),
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "rootDir": "src",
+ "incremental": true,
+ },
+ }`),
+ },
+ commandLineArgs: []string{"--b", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "incremental-declaration-doesnt-change",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/src/main.ts", "const x = 10;", "")
+ },
+ },
+ {
+ caption: "incremental-declaration-doesnt-change",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/project/src/main.ts", "const x = 10;")
+ },
+ },
+ },
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "lateBoundSymbol")
+ }
+}
+
+func TestBuildModuleSpecifiers(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: `synthesized module specifiers resolve correctly`,
+ files: FileMap{
+ "/home/src/workspaces/packages/solution/common/nominal.ts": stringtestutil.Dedent(`
+ export declare type Nominal = T & {
+ [Symbol.species]: Name;
+ };
+ `),
+ "/home/src/workspaces/packages/solution/common/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true
+ },
+ "include": ["nominal.ts"]
+ }
+ `),
+ "/home/src/workspaces/packages/solution/sub-project/index.ts": stringtestutil.Dedent(`
+ import { Nominal } from '../common/nominal';
+
+ export type MyNominal = Nominal;
+ `),
+ "/home/src/workspaces/packages/solution/sub-project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "../common" }
+ ],
+ "include": ["./index.ts"]
+ }
+ `),
+ "/home/src/workspaces/packages/solution/sub-project-2/index.ts": stringtestutil.Dedent(`
+ import { MyNominal } from '../sub-project/index';
+
+ const variable = {
+ key: 'value' as MyNominal,
+ };
+
+ export function getVar(): keyof typeof variable {
+ return 'key';
+ }
+ `),
+ "/home/src/workspaces/packages/solution/sub-project-2/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "../sub-project" }
+ ],
+ "include": ["./index.ts"]
+ }
+ `),
+ "/home/src/workspaces/packages/solution/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "./sub-project" },
+ { "path": "./sub-project-2" }
+ ],
+ "include": []
+ }
+ `),
+ "/home/src/workspaces/packages/tsconfig.base.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "skipLibCheck": true,
+ "rootDir": "./",
+ "outDir": "lib"
+ }
+ }
+ `),
+ "/home/src/workspaces/packages/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "./solution" },
+ ],
+ "include": [],
+ }
+ `),
+ tscLibPath + "/lib.d.ts": strings.Replace(tscDefaultLibContent, "interface SymbolConstructor {", "interface SymbolConstructor {\n readonly species: symbol;", 1),
+ },
+ cwd: "/home/src/workspaces/packages",
+ commandLineArgs: []string{"-b", "--verbose"},
+ },
+ {
+ subScenario: `synthesized module specifiers across projects resolve correctly`,
+ files: FileMap{
+ "/home/src/workspaces/packages/src-types/index.ts": stringtestutil.Dedent(`
+ export * from './dogconfig.js';`),
+ "/home/src/workspaces/packages/src-types/dogconfig.ts": stringtestutil.Dedent(`
+ export interface DogConfig {
+ name: string;
+ }
+ `),
+ "/home/src/workspaces/packages/src-dogs/index.ts": stringtestutil.Dedent(`
+ export * from 'src-types';
+ export * from './lassie/lassiedog.js';
+ `),
+ "/home/src/workspaces/packages/src-dogs/dogconfig.ts": stringtestutil.Dedent(`
+ import { DogConfig } from 'src-types';
+
+ export const DOG_CONFIG: DogConfig = {
+ name: 'Default dog',
+ };
+ `),
+ "/home/src/workspaces/packages/src-dogs/dog.ts": stringtestutil.Dedent(`
+ import { DogConfig } from 'src-types';
+ import { DOG_CONFIG } from './dogconfig.js';
+
+ export abstract class Dog {
+
+ public static getCapabilities(): DogConfig {
+ return DOG_CONFIG;
+ }
+ }
+ `),
+ "/home/src/workspaces/packages/src-dogs/lassie/lassiedog.ts": stringtestutil.Dedent(`
+ import { Dog } from '../dog.js';
+ import { LASSIE_CONFIG } from './lassieconfig.js';
+
+ export class LassieDog extends Dog {
+ protected static getDogConfig = () => LASSIE_CONFIG;
+ }
+ `),
+ "/home/src/workspaces/packages/src-dogs/lassie/lassieconfig.ts": stringtestutil.Dedent(`
+ import { DogConfig } from 'src-types';
+
+ export const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };
+ `),
+ "/home/src/workspaces/packages/tsconfig-base.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "declaration": true,
+ "module": "node16",
+ },
+ }
+ `),
+ "/home/src/workspaces/packages/src-types/package.json": stringtestutil.Dedent(`
+ {
+ "type": "module",
+ "exports": "./index.js"
+ }`),
+ "/home/src/workspaces/packages/src-dogs/package.json": stringtestutil.Dedent(`
+ {
+ "type": "module",
+ "exports": "./index.js"
+ }`),
+ "/home/src/workspaces/packages/src-types/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig-base.json",
+ "compilerOptions": {
+ "composite": true,
+ },
+ "include": [
+ "**/*",
+ ],
+ }`),
+ "/home/src/workspaces/packages/src-dogs/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig-base.json",
+ "compilerOptions": {
+ "composite": true,
+ },
+ "references": [
+ { "path": "../src-types" },
+ ],
+ "include": [
+ "**/*",
+ ],
+ }`),
+ "/home/src/workspaces/packages/src-types/node_modules": vfstest.Symlink("/home/src/workspaces/packages"),
+ "/home/src/workspaces/packages/src-dogs/node_modules": vfstest.Symlink("/home/src/workspaces/packages"),
+ },
+ cwd: "/home/src/workspaces/packages",
+ commandLineArgs: []string{"-b", "src-types", "src-dogs", "--verbose"},
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "moduleSpecifiers")
+ }
+}
+
+func TestBuildSolutionProject(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "verify that subsequent builds after initial build doesnt build anything",
+ files: FileMap{
+ "/home/src/workspaces/solution/src/folder/index.ts": `export const x = 10;`,
+ "/home/src/workspaces/solution/src/folder/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "files": ["index.ts"],
+ "compilerOptions": {
+ "composite": true
+ }
+ }
+ `),
+ "/home/src/workspaces/solution/src/folder2/index.ts": `export const x = 10;`,
+ "/home/src/workspaces/solution/src/folder2/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "files": ["index.ts"],
+ "compilerOptions": {
+ "composite": true
+ }
+ }
+ `),
+ "/home/src/workspaces/solution/src/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "files": [],
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "./folder" },
+ { "path": "./folder2" },
+ ]
+ }`),
+ "/home/src/workspaces/solution/tests/index.ts": `export const x = 10;`,
+ "/home/src/workspaces/solution/tests/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "files": ["index.ts"],
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "../src" }
+ ]
+ }
+ `),
+ "/home/src/workspaces/solution/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "files": [],
+ "compilerOptions": {
+ "composite": true
+ },
+ "references": [
+ { "path": "./src" },
+ { "path": "./tests" }
+ ]
+ }
+ `),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "--v"},
+ edits: noChangeOnlyEdit,
+ },
+ {
+ subScenario: "when solution is referenced indirectly",
+ files: FileMap{
+ "/home/src/workspaces/solution/project1/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true },
+ "references": []
+ }
+ `),
+ "/home/src/workspaces/solution/project2/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true },
+ "references": []
+ }
+ `),
+ "/home/src/workspaces/solution/project2/src/b.ts": "export const b = 10;",
+ "/home/src/workspaces/solution/project3/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true },
+ "references": [
+ { "path": "../project1" },
+ { "path": "../project2" }
+ ]
+ }
+ `),
+ "/home/src/workspaces/solution/project3/src/c.ts": "export const c = 10;",
+ "/home/src/workspaces/solution/project4/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true },
+ "references": [{ "path": "../project3" }]
+ }
+ `),
+ "/home/src/workspaces/solution/project4/src/d.ts": "export const d = 10;",
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "project4", "--verbose", "--explainFiles"},
+ edits: []*tscEdit{
+ {
+ caption: "modify project3 file",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/solution/project3/src/c.ts", "c = ", "cc = ")
+ },
+ },
+ },
+ },
+ {
+ subScenario: "has empty files diagnostic when files is empty and no references are provided",
+ files: FileMap{
+ "/home/src/workspaces/solution/no-references/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "references": [],
+ "files": [],
+ "compilerOptions": {
+ "composite": true,
+ "declaration": true,
+ "forceConsistentCasingInFileNames": true,
+ "skipDefaultLibCheck": true,
+ },
+ }`),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "no-references"},
+ },
+ {
+ subScenario: "does not have empty files diagnostic when files is empty and references are provided",
+ files: FileMap{
+ "/home/src/workspaces/solution/core/index.ts": "export function multiply(a: number, b: number) { return a * b; }",
+ "/home/src/workspaces/solution/core/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "declaration": true,
+ "declarationMap": true,
+ "skipDefaultLibCheck": true,
+ },
+ }`),
+ "/home/src/workspaces/solution/with-references/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "references": [
+ { "path": "../core" },
+ ],
+ "files": [],
+ "compilerOptions": {
+ "composite": true,
+ "declaration": true,
+ "forceConsistentCasingInFileNames": true,
+ "skipDefaultLibCheck": true,
+ },
+ }`),
+ },
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "with-references"},
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "solution")
+ }
+}
+
+func getBuildCommandLineDifferentOptionsMap(optionName string) FileMap {
+ return FileMap{
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "%s": true
+ }
+ }`, optionName)),
+ "/home/src/workspaces/project/a.ts": `export const a = 10;const aLocal = 10;`,
+ "/home/src/workspaces/project/b.ts": `export const b = 10;const bLocal = 10;`,
+ "/home/src/workspaces/project/c.ts": `import { a } from "./a";export const c = a;`,
+ "/home/src/workspaces/project/d.ts": `import { b } from "./b";export const d = b;`,
+ }
+}
+
+func getBuildCommandLineEmitDeclarationOnlyMap(options []string) FileMap {
+ compilerOptionsStr := strings.Join(core.Map(options, func(opt string) string {
+ return fmt.Sprintf(`"%s": true`, opt)
+ }), ", ")
+ return FileMap{
+ "/home/src/workspaces/solution/project1/src/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": { %s }
+ }`, compilerOptionsStr)),
+ "/home/src/workspaces/solution/project1/src/a.ts": `export const a = 10;const aLocal = 10;`,
+ "/home/src/workspaces/solution/project1/src/b.ts": `export const b = 10;const bLocal = 10;`,
+ "/home/src/workspaces/solution/project1/src/c.ts": `import { a } from "./a";export const c = a;`,
+ "/home/src/workspaces/solution/project1/src/d.ts": `import { b } from "./b";export const d = b;`,
+ "/home/src/workspaces/solution/project2/src/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": { %s },
+ "references": [{ "path": "../../project1/src" }]
+ }`, compilerOptionsStr)),
+ "/home/src/workspaces/solution/project2/src/e.ts": `export const e = 10;`,
+ "/home/src/workspaces/solution/project2/src/f.ts": `import { a } from "../../project1/src/a"; export const f = a;`,
+ "/home/src/workspaces/solution/project2/src/g.ts": `import { b } from "../../project1/src/b"; export const g = b;`,
+ }
+}
+
+func getBuildCommandLineEmitDeclarationOnlyTestCases(options []string, suffix string) []*tscInput {
+ return []*tscInput{
+ {
+ subScenario: "emitDeclarationOnly on commandline" + suffix,
+ files: getBuildCommandLineEmitDeclarationOnlyMap(options),
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "project2/src", "--verbose", "--emitDeclarationOnly"},
+ edits: []*tscEdit{
+ noChange,
+ {
+ caption: "local change",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/a.ts", "const aa = 10;")
+ },
+ },
+ {
+ caption: "non local change",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/a.ts", "export const aaa = 10;")
+ },
+ },
+ {
+ caption: "emit js files",
+ commandLineArgs: []string{"--b", "project2/src", "--verbose"},
+ },
+ noChange,
+ {
+ caption: "js emit with change without emitDeclarationOnly",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/b.ts", "const alocal = 10;")
+ },
+ commandLineArgs: []string{"--b", "project2/src", "--verbose"},
+ },
+ {
+ caption: "local change",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/b.ts", "const aaaa = 10;")
+ },
+ },
+ {
+ caption: "non local change",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/b.ts", "export const aaaaa = 10;")
+ },
+ },
+ {
+ caption: "js emit with change without emitDeclarationOnly",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/b.ts", "export const a2 = 10;")
+ },
+ commandLineArgs: []string{"--b", "project2/src", "--verbose"},
+ },
+ },
+ },
+ {
+ subScenario: "emitDeclarationOnly false on commandline" + suffix,
+ files: getBuildCommandLineEmitDeclarationOnlyMap(slices.Concat(options, []string{"emitDeclarationOnly"})),
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "project2/src", "--verbose"},
+ edits: []*tscEdit{
+ noChange,
+ {
+ caption: "change",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/a.ts", "const aa = 10;")
+ },
+ },
+ {
+ caption: "emit js files",
+ commandLineArgs: []string{"--b", "project2/src", "--verbose", "--emitDeclarationOnly", "false"},
+ },
+ noChange,
+ {
+ caption: "no change run with js emit",
+ commandLineArgs: []string{"--b", "project2/src", "--verbose", "--emitDeclarationOnly", "false"},
+ },
+ {
+ caption: "js emit with change",
+ edit: func(sys *testSys) {
+ sys.appendFile("/home/src/workspaces/solution/project1/src/b.ts", "const blocal = 10;")
+ },
+ commandLineArgs: []string{"--b", "project2/src", "--verbose", "--emitDeclarationOnly", "false"},
+ },
+ },
+ },
+ }
+}
+
+func getBuildEmitDeclarationOnlyImportFileMap(declarationMap bool, circularRef bool) FileMap {
+ files := FileMap{
+ "/home/src/workspaces/project/src/a.ts": stringtestutil.Dedent(`
+ import { B } from "./b";
+
+ export interface A {
+ b: B;
+ }
+ `),
+ "/home/src/workspaces/project/src/b.ts": stringtestutil.Dedent(`
+ import { C } from "./c";
+
+ export interface B {
+ b: C;
+ }
+ `),
+ "/home/src/workspaces/project/src/c.ts": stringtestutil.Dedent(`
+ import { A } from "./a";
+
+ export interface C {
+ a: A;
+ }
+ `),
+ "/home/src/workspaces/project/src/index.ts": stringtestutil.Dedent(`
+ export { A } from "./a";
+ export { B } from "./b";
+ export { C } from "./c";
+ `),
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "incremental": true,
+ "target": "es5",
+ "module": "commonjs",
+ "declaration": true,
+ "declarationMap": %t,
+ "sourceMap": true,
+ "outDir": "./lib",
+ "composite": true,
+ "strict": true,
+ "esModuleInterop": true,
+ "alwaysStrict": true,
+ "rootDir": "src",
+ "emitDeclarationOnly": true,
+ },
+ }`, declarationMap)),
+ }
+ if !circularRef {
+ delete(files, "/home/src/workspaces/project/src/index.ts")
+ files["/home/src/workspaces/project/src/a.ts"] = stringtestutil.Dedent(`
+ export class B { prop = "hello"; }
+
+ export interface A {
+ b: B;
+ }
+ `)
+ }
+ return files
+}
+
+func getBuildEmitDeclarationOnlyTestCase(declarationMap bool) *tscInput {
+ return &tscInput{
+ subScenario: `only dts output in circular import project with emitDeclarationOnly` + core.IfElse(declarationMap, " and declarationMap", ""),
+ files: getBuildEmitDeclarationOnlyImportFileMap(declarationMap, true),
+ commandLineArgs: []string{"--b", "--verbose"},
+ edits: []*tscEdit{
+ {
+ caption: "incremental-declaration-changes",
+ edit: func(sys *testSys) {
+ sys.replaceFileText("/home/src/workspaces/project/src/a.ts", "b: B;", "b: B; foo: any;")
+ },
+ },
+ },
+ }
+}
+
+func getBuildInferredTypeFromTransitiveModuleMap(isolatedModules bool, lazyExtraContents string) FileMap {
+ return FileMap{
+ "/home/src/workspaces/project/bar.ts": stringtestutil.Dedent(`
+ interface RawAction {
+ (...args: any[]): Promise | void;
+ }
+ interface ActionFactory {
+ (target: T): T;
+ }
+ declare function foo(): ActionFactory;
+ export default foo()(function foobar(param: string): void {
+ });
+ `),
+ "/home/src/workspaces/project/bundling.ts": stringtestutil.Dedent(`
+ export class LazyModule {
+ constructor(private importCallback: () => Promise) {}
+ }
+
+ export class LazyAction<
+ TAction extends (...args: any[]) => any,
+ TModule
+ > {
+ constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {
+ }
+ }
+ `),
+ "/home/src/workspaces/project/global.d.ts": stringtestutil.Dedent(`
+ interface PromiseConstructor {
+ new (): Promise;
+ }
+ declare var Promise: PromiseConstructor;
+ interface Promise {
+ }
+ `),
+ "/home/src/workspaces/project/index.ts": stringtestutil.Dedent(`
+ import { LazyAction, LazyModule } from './bundling';
+ const lazyModule = new LazyModule(() =>
+ import('./lazyIndex')
+ );
+ export const lazyBar = new LazyAction(lazyModule, m => m.bar);
+ `),
+ "/home/src/workspaces/project/lazyIndex.ts": stringtestutil.Dedent(`
+ export { default as bar } from './bar';
+ `) + lazyExtraContents,
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "target": "es5",
+ "declaration": true,
+ "outDir": "obj",
+ "incremental": true,
+ "isolatedModules": %t,
+ },
+ }`, isolatedModules)),
+ }
+}
diff --git a/internal/execute/tscbuilddemo_test.go b/internal/execute/tscbuilddemo_test.go
new file mode 100644
index 0000000000..a4e32cc1b4
--- /dev/null
+++ b/internal/execute/tscbuilddemo_test.go
@@ -0,0 +1,189 @@
+package execute_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/testutil/stringtestutil"
+)
+
+func TestBuildDemoProject(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "in master branch with everything setup correctly and reports no error",
+ files: getBuildDemoFileMap(demoBranchMain),
+ cwd: "/user/username/projects/demo",
+ commandLineArgs: []string{"--b", "--verbose"},
+ edits: noChangeOnlyEdit,
+ },
+ {
+ subScenario: "in circular branch reports the error about it by stopping build",
+ files: getBuildDemoFileMap(demoBranchCircularRef),
+ cwd: "/user/username/projects/demo",
+ commandLineArgs: []string{"--b", "--verbose"},
+ },
+ {
+ // !!! sheetal - this has missing errors from strada about files not in rootDir (3) and value is declared but not used (1)
+ subScenario: "in bad-ref branch reports the error about files not in rootDir at the import location",
+ files: getBuildDemoFileMap(demoBranchBadRef),
+ cwd: "/user/username/projects/demo",
+ commandLineArgs: []string{"--b", "--verbose"},
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "demo")
+ }
+}
+
+type demoBranch uint
+
+const (
+ demoBranchMain = iota
+ demoBranchCircularRef
+ demoBranchBadRef
+)
+
+func getBuildDemoFileMap(demoType demoBranch) FileMap {
+ files := FileMap{
+ "/user/username/projects/demo/animals/animal.ts": stringtestutil.Dedent(`
+ export type Size = "small" | "medium" | "large";
+ export default interface Animal {
+ size: Size;
+ }
+ `),
+ "/user/username/projects/demo/animals/dog.ts": stringtestutil.Dedent(`
+ import Animal from '.';
+ import { makeRandomName } from '../core/utilities';
+
+ export interface Dog extends Animal {
+ woof(): void;
+ name: string;
+ }
+
+ export function createDog(): Dog {
+ return ({
+ size: "medium",
+ woof: function(this: Dog) {
+ console.log(` + "`" + `${ this.name } says "Woof"!` + "`" + `);
+ },
+ name: makeRandomName()
+ });
+ }
+ `),
+ "/user/username/projects/demo/animals/index.ts": stringtestutil.Dedent(`
+ import Animal from './animal';
+
+ export default Animal;
+ import { createDog, Dog } from './dog';
+ export { createDog, Dog };
+ `),
+ "/user/username/projects/demo/animals/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig-base.json",
+ "compilerOptions": {
+ "outDir": "../lib/animals",
+ "rootDir": "."
+ },
+ "references": [
+ { "path": "../core" }
+ ]
+ }
+ `),
+ "/user/username/projects/demo/core/utilities.ts": stringtestutil.Dedent(`
+
+ export function makeRandomName() {
+ return "Bob!?! ";
+ }
+
+ export function lastElementOf(arr: T[]): T | undefined {
+ if (arr.length === 0) return undefined;
+ return arr[arr.length - 1];
+ }
+ `),
+ "/user/username/projects/demo/core/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig-base.json",
+ "compilerOptions": {
+ "outDir": "../lib/core",
+ "rootDir": "."
+ },
+ }
+ `),
+ "/user/username/projects/demo/zoo/zoo.ts": stringtestutil.Dedent(`
+ import { Dog, createDog } from '../animals/index';
+
+ export function createZoo(): Array {
+ return [
+ createDog()
+ ];
+ }
+ `),
+ "/user/username/projects/demo/zoo/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig-base.json",
+ "compilerOptions": {
+ "outDir": "../lib/zoo",
+ "rootDir": "."
+ },
+ "references": [
+ {
+ "path": "../animals"
+ }
+ ]
+ }
+ `),
+ "/user/username/projects/demo/tsconfig-base.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "declaration": true,
+ "target": "es5",
+ "module": "commonjs",
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noImplicitReturns": true,
+ "noFallthroughCasesInSwitch": true,
+ "composite": true,
+ },
+ }
+ `),
+ "/user/username/projects/demo/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "files": [],
+ "references": [
+ {
+ "path": "./core"
+ },
+ {
+ "path": "./animals",
+ },
+ {
+ "path": "./zoo",
+ },
+ ],
+ }
+ `),
+ }
+ switch demoType {
+ case demoBranchCircularRef:
+ files["/user/username/projects/demo/core/tsconfig.json"] = stringtestutil.Dedent(`
+ {
+ "extends": "../tsconfig-base.json",
+ "compilerOptions": {
+ "outDir": "../lib/core",
+ "rootDir": "."
+ },
+ "references": [
+ {
+ "path": "../zoo",
+ }
+ ]
+ }
+ `)
+ case demoBranchBadRef:
+ files["/user/username/projects/demo/core/utilities.ts"] = `import * as A from '../animals'
+` + files["/user/username/projects/demo/core/utilities.ts"].(string)
+ }
+ return files
+}
diff --git a/internal/execute/tscdeclarationemit_test.go b/internal/execute/tscdeclarationemit_test.go
new file mode 100644
index 0000000000..4291927a41
--- /dev/null
+++ b/internal/execute/tscdeclarationemit_test.go
@@ -0,0 +1,443 @@
+package execute_test
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/testutil/stringtestutil"
+ "github.com/microsoft/typescript-go/internal/vfs/vfstest"
+)
+
+func TestTscDeclarationEmit(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "when declaration file is referenced through triple slash",
+ files: getBuildDeclarationEmitDtsReferenceAsTrippleSlashMap(false),
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "--verbose"},
+ },
+ {
+ subScenario: "when declaration file is referenced through triple slash but uses no references",
+ files: getBuildDeclarationEmitDtsReferenceAsTrippleSlashMap(true),
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "--verbose"},
+ },
+ {
+ subScenario: "when declaration file used inferred type from referenced project",
+ files: FileMap{
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "paths": { "@fluentui/*": ["./packages/*/src"] },
+ },
+ }`),
+ "/home/src/workspaces/project/packages/pkg1/src/index.ts": stringtestutil.Dedent(`
+ export interface IThing {
+ a: string;
+ }
+ export interface IThings {
+ thing1: IThing;
+ }
+ `),
+ "/home/src/workspaces/project/packages/pkg1/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig",
+ "compilerOptions": { "outDir": "lib" },
+ "include": ["src"],
+ }
+ `),
+ "/home/src/workspaces/project/packages/pkg2/src/index.ts": stringtestutil.Dedent(`
+ import { IThings } from '@fluentui/pkg1';
+ export function fn4() {
+ const a: IThings = { thing1: { a: 'b' } };
+ return a.thing1;
+ }
+ `),
+ "/home/src/workspaces/project/packages/pkg2/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig",
+ "compilerOptions": { "outDir": "lib" },
+ "include": ["src"],
+ "references": [{ "path": "../pkg1" }],
+ }
+ `),
+ },
+ commandLineArgs: []string{"--b", "packages/pkg2/tsconfig.json", "--verbose"},
+ },
+ {
+ subScenario: "reports dts generation errors",
+ files: getTscDeclarationEmitDtsErrorsFileMap(false, false),
+ commandLineArgs: []string{"-b", "--explainFiles", "--listEmittedFiles", "--v"},
+ edits: noChangeOnlyEdit,
+ },
+ {
+ subScenario: "reports dts generation errors with incremental",
+ files: getTscDeclarationEmitDtsErrorsFileMap(false, true),
+ commandLineArgs: []string{"-b", "--explainFiles", "--listEmittedFiles", "--v"},
+ edits: noChangeOnlyEdit,
+ },
+ {
+ subScenario: "reports dts generation errors",
+ files: getTscDeclarationEmitDtsErrorsFileMap(false, false),
+ commandLineArgs: []string{"--explainFiles", "--listEmittedFiles"},
+ edits: []*tscEdit{
+ noChange,
+ {
+ caption: "build -b",
+ commandLineArgs: []string{"-b", "--explainFiles", "--listEmittedFiles", "--v"},
+ },
+ },
+ },
+ {
+ subScenario: "reports dts generation errors with incremental",
+ files: getTscDeclarationEmitDtsErrorsFileMap(true, true),
+ commandLineArgs: []string{"--explainFiles", "--listEmittedFiles"},
+ edits: []*tscEdit{
+ noChange,
+ {
+ caption: "build -b",
+ commandLineArgs: []string{"-b", "--explainFiles", "--listEmittedFiles", "--v"},
+ },
+ },
+ },
+ {
+ subScenario: "when using Windows paths and uppercase letters",
+ files: FileMap{
+ "D:/Work/pkg1/package.json": stringtestutil.Dedent(`
+ {
+ "name": "ts-specifier-bug",
+ "version": "1.0.0",
+ "main": "index.js"
+ }`),
+ "D:/Work/pkg1/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "declaration": true,
+ "target": "es2017",
+ "outDir": "./dist",
+ },
+ "include": ["src"],
+ }`),
+ "D:/Work/pkg1/src/main.ts": stringtestutil.Dedent(`
+ import { PartialType } from './utils';
+
+ class Common {}
+
+ export class Sub extends PartialType(Common) {
+ id: string;
+ }
+ `),
+ "D:/Work/pkg1/src/utils/index.ts": stringtestutil.Dedent(`
+ import { MyType, MyReturnType } from './type-helpers';
+
+ export function PartialType(classRef: MyType) {
+ abstract class PartialClassType {
+ constructor() {}
+ }
+
+ return PartialClassType as MyReturnType;
+ }
+ `),
+ "D:/Work/pkg1/src/utils/type-helpers.ts": stringtestutil.Dedent(`
+ export type MyReturnType = {
+ new (...args: any[]): any;
+ };
+
+ export interface MyType extends Function {
+ new (...args: any[]): T;
+ }
+ `),
+ },
+ cwd: "D:/Work/pkg1",
+ windowsStyleRoot: "D:/",
+ ignoreCase: true,
+ commandLineArgs: []string{"-p", "D:\\Work\\pkg1", "--explainFiles"},
+ },
+ {
+ // !!! sheetal redirected files not yet implemented
+ subScenario: "when same version is referenced through source and another symlinked package",
+ files: FileMap{
+ `/user/username/projects/myproject/plugin-two/index.d.ts`: pluginTwoDts(),
+ `/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json`: fsaPackageJson(),
+ `/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts`: fsaIndex(),
+ `/user/username/projects/myproject/plugin-one/tsconfig.json`: pluginOneConfig(),
+ `/user/username/projects/myproject/plugin-one/index.ts`: pluginOneIndex(),
+ `/user/username/projects/myproject/plugin-one/action.ts`: pluginOneAction(),
+ `/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json`: fsaPackageJson(),
+ `/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts`: fsaIndex(),
+ `/user/username/projects/myproject/plugin-one/node_modules/plugin-two`: vfstest.Symlink(`/user/username/projects/myproject/plugin-two`),
+ },
+ cwd: "/user/username/projects/myproject",
+ commandLineArgs: []string{"-p", "plugin-one", "--explainFiles"},
+ },
+ {
+ // !!! sheetal redirected files not yet implemented
+ subScenario: "when same version is referenced through source and another symlinked package with indirect link",
+ files: FileMap{
+ `/user/username/projects/myproject/plugin-two/package.json`: stringtestutil.Dedent(`
+ {
+ "name": "plugin-two",
+ "version": "0.1.3",
+ "main": "dist/commonjs/index.js"
+ }`),
+ `/user/username/projects/myproject/plugin-two/dist/commonjs/index.d.ts`: pluginTwoDts(),
+ `/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json`: fsaPackageJson(),
+ `/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts`: fsaIndex(),
+ `/user/username/projects/myproject/plugin-one/tsconfig.json`: pluginOneConfig(),
+ `/user/username/projects/myproject/plugin-one/index.ts`: pluginOneIndex() + "\n" + pluginOneAction(),
+ `/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json`: fsaPackageJson(),
+ `/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts`: fsaIndex(),
+ `/temp/yarn/data/link/plugin-two`: vfstest.Symlink(`/user/username/projects/myproject/plugin-two`),
+ `/user/username/projects/myproject/plugin-one/node_modules/plugin-two`: vfstest.Symlink(`/temp/yarn/data/link/plugin-two`),
+ },
+ cwd: "/user/username/projects/myproject",
+ commandLineArgs: []string{"-p", "plugin-one", "--explainFiles"},
+ },
+ {
+ // !!! sheetal strada has error for d.ts generation in pkg3/src/keys.ts but corsa doesnt have that
+ subScenario: "when pkg references sibling package through indirect symlink",
+ files: FileMap{
+ `/user/username/projects/myproject/pkg1/dist/index.d.ts`: `export * from './types';`,
+ `/user/username/projects/myproject/pkg1/dist/types.d.ts`: stringtestutil.Dedent(`
+ export declare type A = {
+ id: string;
+ };
+ export declare type B = {
+ id: number;
+ };
+ export declare type IdType = A | B;
+ export declare class MetadataAccessor {
+ readonly key: string;
+ private constructor();
+ toString(): string;
+ static create(key: string): MetadataAccessor;
+ }`),
+ `/user/username/projects/myproject/pkg1/package.json`: stringtestutil.Dedent(`
+ {
+ "name": "@raymondfeng/pkg1",
+ "version": "1.0.0",
+ "main": "dist/index.js",
+ "typings": "dist/index.d.ts"
+ }`),
+ `/user/username/projects/myproject/pkg2/dist/index.d.ts`: `export * from './types';`,
+ `/user/username/projects/myproject/pkg2/dist/types.d.ts`: `export {MetadataAccessor} from '@raymondfeng/pkg1';`,
+ `/user/username/projects/myproject/pkg2/package.json`: stringtestutil.Dedent(`
+ {
+ "name": "@raymondfeng/pkg2",
+ "version": "1.0.0",
+ "main": "dist/index.js",
+ "typings": "dist/index.d.ts"
+ }`),
+ `/user/username/projects/myproject/pkg3/src/index.ts`: `export * from './keys';`,
+ `/user/username/projects/myproject/pkg3/src/keys.ts`: stringtestutil.Dedent(`
+ import {MetadataAccessor} from "@raymondfeng/pkg2";
+ export const ADMIN = MetadataAccessor.create('1');`),
+ `/user/username/projects/myproject/pkg3/tsconfig.json`: stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "outDir": "dist",
+ "rootDir": "src",
+ "target": "es5",
+ "module": "commonjs",
+ "strict": true,
+ "esModuleInterop": true,
+ "declaration": true,
+ },
+ }`),
+ `/user/username/projects/myproject/pkg2/node_modules/@raymondfeng/pkg1`: vfstest.Symlink(`/user/username/projects/myproject/pkg1`),
+ `/user/username/projects/myproject/pkg3/node_modules/@raymondfeng/pkg2`: vfstest.Symlink(`/user/username/projects/myproject/pkg2`),
+ },
+ cwd: "/user/username/projects/myproject",
+ commandLineArgs: []string{"-p", "pkg3", "--explainFiles"},
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "declarationEmit")
+ }
+}
+
+func getBuildDeclarationEmitDtsReferenceAsTrippleSlashMap(useNoRef bool) FileMap {
+ files := FileMap{
+ "/home/src/workspaces/solution/tsconfig.base.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "lib",
+ },
+ }`),
+ "/home/src/workspaces/solution/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true },
+ "references": [{ "path": "./src" }],
+ "include": [],
+ }`),
+ "/home/src/workspaces/solution/src/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true },
+ "references": [{ "path": "./subProject" }, { "path": "./subProject2" }],
+ "include": [],
+ }`),
+ "/home/src/workspaces/solution/src/subProject/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": { "composite": true },
+ "references": [{ "path": "../common" }],
+ "include": ["./index.ts"],
+ }`),
+ "/home/src/workspaces/solution/src/subProject/index.ts": stringtestutil.Dedent(`
+ import { Nominal } from '../common/nominal';
+ export type MyNominal = Nominal;`),
+ "/home/src/workspaces/solution/src/subProject2/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": { "composite": true },
+ "references": [{ "path": "../subProject" }],
+ "include": ["./index.ts"],
+ }`),
+ "/home/src/workspaces/solution/src/subProject2/index.ts": stringtestutil.Dedent(`
+ import { MyNominal } from '../subProject/index';
+ const variable = {
+ key: 'value' as MyNominal,
+ };
+ export function getVar(): keyof typeof variable {
+ return 'key';
+ }`),
+ "/home/src/workspaces/solution/src/common/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": { "composite": true },
+ "include": ["./nominal.ts"],
+ }`),
+ "/home/src/workspaces/solution/src/common/nominal.ts": stringtestutil.Dedent(`
+ ///
+ export declare type Nominal = MyNominal;`),
+ "/home/src/workspaces/solution/src/common/types.d.ts": stringtestutil.Dedent(`
+ declare type MyNominal = T & {
+ specialKey: Name;
+ };`),
+ }
+ if useNoRef {
+ files["/home/src/workspaces/solution/tsconfig.json"] = stringtestutil.Dedent(`
+ {
+ "extends": "./tsconfig.base.json",
+ "compilerOptions": { "composite": true },
+ "include": ["./src/**/*.ts"],
+ }`)
+ }
+ return files
+}
+
+func getTscDeclarationEmitDtsErrorsFileMap(composite bool, incremental bool) FileMap {
+ return FileMap{
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "composite": %t,
+ "incremental": %t,
+ "declaration": true,
+ "skipLibCheck": true,
+ "skipDefaultLibCheck": true,
+ },
+ }`, composite, incremental)),
+ "/home/src/workspaces/project/index.ts": stringtestutil.Dedent(`
+ import ky from 'ky';
+ export const api = ky.extend({});
+ `),
+ "/home/src/workspaces/project/package.json": stringtestutil.Dedent(`
+ {
+ "type": "module"
+ }`),
+ "/home/src/workspaces/project/node_modules/ky/distribution/index.d.ts": stringtestutil.Dedent(`
+ type KyInstance = {
+ extend(options: Record): KyInstance;
+ }
+ declare const ky: KyInstance;
+ export default ky;
+ `),
+ "/home/src/workspaces/project/node_modules/ky/package.json": stringtestutil.Dedent(`
+ {
+ "name": "ky",
+ "type": "module",
+ "main": "./distribution/index.js"
+ }
+ `),
+ }
+}
+
+func pluginOneConfig() string {
+ return stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "target": "es5",
+ "declaration": true,
+ "traceResolution": true,
+ },
+ }`)
+}
+
+func pluginOneIndex() string {
+ return `import pluginTwo from "plugin-two"; // include this to add reference to symlink`
+}
+
+func pluginOneAction() string {
+ return stringtestutil.Dedent(`
+ import { actionCreatorFactory } from "typescript-fsa"; // Include version of shared lib
+ const action = actionCreatorFactory("somekey");
+ const featureOne = action<{ route: string }>("feature-one");
+ export const actions = { featureOne };`)
+}
+
+func pluginTwoDts() string {
+ return stringtestutil.Dedent(`
+ declare const _default: {
+ features: {
+ featureOne: {
+ actions: {
+ featureOne: {
+ (payload: {
+ name: string;
+ order: number;
+ }, meta?: {
+ [key: string]: any;
+ }): import("typescript-fsa").Action<{
+ name: string;
+ order: number;
+ }>;
+ };
+ };
+ path: string;
+ };
+ };
+ };
+ export default _default;`)
+}
+
+func fsaPackageJson() string {
+ return stringtestutil.Dedent(`
+ {
+ "name": "typescript-fsa",
+ "version": "3.0.0-beta-2"
+ }`)
+}
+
+func fsaIndex() string {
+ return stringtestutil.Dedent(`
+ export interface Action {
+ type: string;
+ payload: Payload;
+ }
+ export declare type ActionCreator = {
+ type: string;
+ (payload: Payload): Action;
+ }
+ export interface ActionCreatorFactory {
+ (type: string): ActionCreator;
+ }
+ export declare function actionCreatorFactory(prefix?: string | null): ActionCreatorFactory;
+ export default actionCreatorFactory;`)
+}
diff --git a/internal/execute/tscextends_test.go b/internal/execute/tscextends_test.go
new file mode 100644
index 0000000000..7edaf73754
--- /dev/null
+++ b/internal/execute/tscextends_test.go
@@ -0,0 +1,158 @@
+package execute_test
+
+import (
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/testutil/stringtestutil"
+ "github.com/microsoft/typescript-go/internal/vfs/vfstest"
+)
+
+func TestTscExtends(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ {
+ subScenario: "when building solution with projects extends config with include",
+ files: getBuildConfigFileExtendsFileMap(),
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "--v", "--listFiles"},
+ },
+ {
+ subScenario: "when building project uses reference and both extend config with include",
+ files: getBuildConfigFileExtendsFileMap(),
+ cwd: "/home/src/workspaces/solution",
+ commandLineArgs: []string{"--b", "webpack/tsconfig.json", "--v", "--listFiles"},
+ },
+ getTscExtendsWithSymlinkTestCase("-p"),
+ getTscExtendsWithSymlinkTestCase("-b"),
+ getTscExtendsConfigDirTestCase("", []string{"--explainFiles"}),
+ getTscExtendsConfigDirTestCase(" showConfig", []string{"--showConfig"}),
+ getTscExtendsConfigDirTestCase(" with commandline", []string{"--explainFiles", "--outDir", "${configDir}/outDir"}),
+ getTscExtendsConfigDirTestCase("", []string{"--b", "--explainFiles", "--v"}),
+ }
+
+ for _, test := range testCases {
+ test.run(t, "extends")
+ }
+}
+
+func getBuildConfigFileExtendsFileMap() FileMap {
+ return FileMap{
+ "/home/src/workspaces/solution/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "references": [
+ { "path": "./shared/tsconfig.json" },
+ { "path": "./webpack/tsconfig.json" },
+ ],
+ "files": [],
+ }`),
+ "/home/src/workspaces/solution/shared/tsconfig-base.json": stringtestutil.Dedent(`
+ {
+ "include": ["./typings-base/"],
+ }`),
+ "/home/src/workspaces/solution/shared/typings-base/globals.d.ts": `type Unrestricted = any;`,
+ "/home/src/workspaces/solution/shared/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "./tsconfig-base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "../target-tsc-build/",
+ "rootDir": "..",
+ },
+ "files": ["./index.ts"],
+ }`),
+ "/home/src/workspaces/solution/shared/index.ts": `export const a: Unrestricted = 1;`,
+ "/home/src/workspaces/solution/webpack/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../shared/tsconfig-base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "../target-tsc-build/",
+ "rootDir": "..",
+ },
+ "files": ["./index.ts"],
+ "references": [{ "path": "../shared/tsconfig.json" }],
+ }`),
+ "/home/src/workspaces/solution/webpack/index.ts": `export const b: Unrestricted = 1;`,
+ }
+}
+
+func getTscExtendsWithSymlinkTestCase(builtType string) *tscInput {
+ return &tscInput{
+ subScenario: "resolves the symlink path",
+ files: FileMap{
+ "/users/user/projects/myconfigs/node_modules/@something/tsconfig-node/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "@something/tsconfig-base/tsconfig.json",
+ "compilerOptions": {
+ "removeComments": true
+ }
+ }
+ `),
+ "/users/user/projects/myconfigs/node_modules/@something/tsconfig-base/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": { "composite": true }
+ }
+ `),
+ "/users/user/projects/myproject/src/index.ts": stringtestutil.Dedent(`
+ // some comment
+ export const x = 10;
+ `),
+ "/users/user/projects/myproject/src/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "@something/tsconfig-node/tsconfig.json"
+ }`),
+ "/users/user/projects/myproject/node_modules/@something/tsconfig-node": vfstest.Symlink("/users/user/projects/myconfigs/node_modules/@something/tsconfig-node"),
+ },
+ cwd: "/users/user/projects/myproject",
+ commandLineArgs: []string{builtType, "src", "--extendedDiagnostics"},
+ }
+}
+
+func getTscExtendsConfigDirTestCase(subScenarioSufix string, commandLineArgs []string) *tscInput {
+ return &tscInput{
+ subScenario: "configDir template" + subScenarioSufix,
+ files: FileMap{
+ "/home/src/projects/configs/first/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../second/tsconfig.json",
+ "include": ["${configDir}/src"],
+ "compilerOptions": {
+ "typeRoots": ["root1", "${configDir}/root2", "root3"],
+ "types": [],
+ },
+ }`),
+ "/home/src/projects/configs/second/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "files": ["${configDir}/main.ts"],
+ "compilerOptions": {
+ "declarationDir": "${configDir}/decls",
+ "paths": {
+ "@myscope/*": ["${configDir}/types/*"],
+ },
+ },
+ "watchOptions": {
+ "excludeFiles": ["${configDir}/main.ts"],
+ },
+ }`),
+ "/home/src/projects/myproject/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "extends": "../configs/first/tsconfig.json",
+ "compilerOptions": {
+ "declaration": true,
+ "outDir": "outDir",
+ "traceResolution": true,
+ },
+ }`),
+ "/home/src/projects/myproject/main.ts": stringtestutil.Dedent(`
+ // some comment
+ export const y = 10;
+ import { x } from "@myscope/sometype";
+ `),
+ "/home/src/projects/myproject/types/sometype.ts": stringtestutil.Dedent(`
+ export const x = 10;
+ `),
+ },
+ cwd: "/home/src/projects/myproject",
+ commandLineArgs: commandLineArgs,
+ }
+}
diff --git a/internal/execute/tscincremental_test.go b/internal/execute/tscincremental_test.go
index 76fe263bbc..7b6b81c864 100644
--- a/internal/execute/tscincremental_test.go
+++ b/internal/execute/tscincremental_test.go
@@ -415,10 +415,7 @@ func TestIncremental(t *testing.T) {
{
caption: "delete file with imports",
edit: func(sys *testSys) {
- err := sys.fsFromFileMap().Remove("/home/src/workspaces/project/file2.ts")
- if err != nil {
- panic(err)
- }
+ sys.removeNoError("/home/src/workspaces/project/file2.ts")
},
},
},
diff --git a/internal/execute/tsclibraryresolution_test.go b/internal/execute/tsclibraryresolution_test.go
new file mode 100644
index 0000000000..c180fb3259
--- /dev/null
+++ b/internal/execute/tsclibraryresolution_test.go
@@ -0,0 +1,166 @@
+package execute_test
+
+import (
+ "fmt"
+ "slices"
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/testutil/stringtestutil"
+)
+
+func TestTscLibraryResolution(t *testing.T) {
+ t.Parallel()
+ testCases := slices.Concat(
+ getTscLibResolutionTestCases([]string{"-b", "project1", "project2", "project3", "project4", "--verbose", "--explainFiles"}),
+ getTscLibResolutionTestCases([]string{"-p", "project1", "--explainFiles"}),
+ []*tscInput{
+ {
+ subScenario: "unknown lib",
+ files: getTscLibraryResolutionUnknown(),
+ cwd: "/home/src/workspace/projects",
+ commandLineArgs: []string{"-p", "project1", "--explainFiles"},
+ },
+ {
+ subScenario: "when noLib toggles",
+ files: FileMap{
+ "/home/src/workspaces/project/a.d.ts": `declare const a = "hello";`,
+ "/home/src/workspaces/project/b.ts": `const b = 10;`,
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "declaration": true,
+ "incremental": true,
+ "lib": ["es6"],
+ },
+ }
+ `),
+ },
+ edits: []*tscEdit{
+ {
+ caption: "with --noLib",
+ commandLineArgs: []string{"--noLib"},
+ },
+ },
+ },
+ },
+ )
+
+ for _, test := range testCases {
+ test.run(t, "libraryResolution")
+ }
+}
+
+func getTscLibraryResolutionFileMap(libReplacement bool) FileMap {
+ files := FileMap{
+ "/home/src/workspace/projects/project1/utils.d.ts": `export const y = 10;`,
+ "/home/src/workspace/projects/project1/file.ts": `export const file = 10;`,
+ "/home/src/workspace/projects/project1/core.d.ts": `export const core = 10;`,
+ "/home/src/workspace/projects/project1/index.ts": `export const x = "type1";`,
+ "/home/src/workspace/projects/project1/file2.ts": stringtestutil.Dedent(`
+ ///
+ ///
+ ///
+ `),
+ "/home/src/workspace/projects/project1/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "typeRoots": ["./typeroot1"],
+ "lib": ["es5", "dom"],
+ "traceResolution": true,
+ "libReplacement": %t
+ }
+ }
+ `, libReplacement)),
+ "/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts": `export type TheNum = "type1";`,
+ "/home/src/workspace/projects/project2/utils.d.ts": `export const y = 10;`,
+ "/home/src/workspace/projects/project2/index.ts": `export const y = 10`,
+ "/home/src/workspace/projects/project2/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "lib": ["es5", "dom"],
+ "traceResolution": true,
+ "libReplacement": %t
+ }
+ }
+ `, libReplacement)),
+ "/home/src/workspace/projects/project3/utils.d.ts": `export const y = 10;`,
+ "/home/src/workspace/projects/project3/index.ts": `export const z = 10`,
+ "/home/src/workspace/projects/project3/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "lib": ["es5", "dom"],
+ "traceResolution": true,
+ "libReplacement": %t
+ }
+ }
+ `, libReplacement)),
+ "/home/src/workspace/projects/project4/utils.d.ts": `export const y = 10;`,
+ "/home/src/workspace/projects/project4/index.ts": `export const z = 10`,
+ "/home/src/workspace/projects/project4/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "lib": ["esnext", "dom", "webworker"],
+ "traceResolution": true,
+ "libReplacement": %t
+ }
+ }
+ `, libReplacement)),
+ getTestLibPathFor("dom"): "interface DOMInterface { }",
+ getTestLibPathFor("webworker"): "interface WebWorkerInterface { }",
+ getTestLibPathFor("scripthost"): "interface ScriptHostInterface { }",
+ "/home/src/workspace/projects/node_modules/@typescript/unlreated/index.d.ts": "export const unrelated = 10;",
+ }
+ if libReplacement {
+ files["/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts"] = tscDefaultLibContent
+ files["/home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts"] = tscDefaultLibContent
+ files["/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts"] = "interface DOMInterface { }"
+ files["/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts"] = "interface WebWorkerInterface { }"
+ files["/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts"] = "interface ScriptHostInterface { }"
+ }
+ return files
+}
+
+func getTscLibResolutionTestCases(commandLineArgs []string) []*tscInput {
+ return []*tscInput{
+ {
+ subScenario: "with config",
+ files: getTscLibraryResolutionFileMap(false),
+ cwd: "/home/src/workspace/projects",
+ commandLineArgs: commandLineArgs,
+ },
+ {
+ subScenario: "with config with libReplacement",
+ files: getTscLibraryResolutionFileMap(true),
+ cwd: "/home/src/workspace/projects",
+ commandLineArgs: commandLineArgs,
+ },
+ }
+}
+
+func getTscLibraryResolutionUnknown() FileMap {
+ return FileMap{
+ "/home/src/workspace/projects/project1/utils.d.ts": `export const y = 10;`,
+ "/home/src/workspace/projects/project1/file.ts": `export const file = 10;`,
+ "/home/src/workspace/projects/project1/core.d.ts": `export const core = 10;`,
+ "/home/src/workspace/projects/project1/index.ts": `export const x = "type1";`,
+ "/home/src/workspace/projects/project1/file2.ts": stringtestutil.Dedent(`
+ ///
+ ///
+ ///
+ `),
+ "/home/src/workspace/projects/project1/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "traceResolution": true,
+ "libReplacement": true
+ }
+ }`),
+ getTestLibPathFor("webworker"): "interface WebWorkerInterface { }",
+ getTestLibPathFor("scripthost"): "interface ScriptHostInterface { }",
+ }
+}
diff --git a/internal/execute/tscmoduleresolution_test.go b/internal/execute/tscmoduleresolution_test.go
new file mode 100644
index 0000000000..5a24e791d4
--- /dev/null
+++ b/internal/execute/tscmoduleresolution_test.go
@@ -0,0 +1,571 @@
+package execute_test
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/microsoft/typescript-go/internal/core"
+ "github.com/microsoft/typescript-go/internal/testutil/stringtestutil"
+ "github.com/microsoft/typescript-go/internal/vfs/vfstest"
+)
+
+func TestTscModuleResolution(t *testing.T) {
+ t.Parallel()
+ testCases := []*tscInput{
+ getBuildModuleResolutionInProjectRefTestCase(false),
+ getBuildModuleResolutionInProjectRefTestCase(true),
+ {
+ subScenario: `type reference resolution uses correct options for different resolution options referenced project`,
+ files: FileMap{
+ "/home/src/workspaces/project/packages/pkg1_index.ts": `export const theNum: TheNum = "type1";`,
+ "/home/src/workspaces/project/packages/pkg1.tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "typeRoots": ["./typeroot1"]
+ },
+ "files": ["./pkg1_index.ts"],
+ }
+ `),
+ "/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts": `declare type TheNum = "type1";`,
+ "/home/src/workspaces/project/packages/pkg2_index.ts": `export const theNum: TheNum2 = "type2";`,
+ "/home/src/workspaces/project/packages/pkg2.tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "typeRoots": ["./typeroot2"]
+ },
+ "files": ["./pkg2_index.ts"],
+ }
+ `),
+ "/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts": `declare type TheNum2 = "type2";`,
+ },
+ commandLineArgs: []string{"-b", "packages/pkg1.tsconfig.json", "packages/pkg2.tsconfig.json", "--verbose", "--traceResolution"},
+ },
+ {
+ subScenario: "impliedNodeFormat differs between projects for shared file",
+ files: FileMap{
+ "/home/src/workspaces/project/a/src/index.ts": "",
+ "/home/src/workspaces/project/a/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "strict": true
+ }
+ }
+ `),
+ "/home/src/workspaces/project/b/src/index.ts": stringtestutil.Dedent(`
+ import pg from "pg";
+ pg.foo();
+ `),
+ "/home/src/workspaces/project/b/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "strict": true,
+ "module": "node16"
+ },
+ }`),
+ "/home/src/workspaces/project/b/package.json": stringtestutil.Dedent(`
+ {
+ "name": "b",
+ "type": "module"
+ }`),
+ "/home/src/workspaces/project/node_modules/@types/pg/index.d.ts": "export function foo(): void;",
+ "/home/src/workspaces/project/node_modules/@types/pg/package.json": stringtestutil.Dedent(`
+ {
+ "name": "@types/pg",
+ "types": "index.d.ts"
+ }`),
+ },
+ commandLineArgs: []string{"-b", "a", "b", "--verbose", "--traceResolution", "--explainFiles"},
+ edits: noChangeOnlyEdit,
+ },
+ {
+ subScenario: "shared resolution should not report error",
+ files: getTscModuleResolutionSharingFileMap(),
+ commandLineArgs: []string{"-b", "packages/b", "--verbose", "--traceResolution", "--explainFiles"},
+ },
+ {
+ subScenario: "when resolution is not shared",
+ files: getTscModuleResolutionSharingFileMap(),
+ commandLineArgs: []string{"-b", "packages/a", "--verbose", "--traceResolution", "--explainFiles"},
+ edits: []*tscEdit{
+ {
+ caption: "build b",
+ commandLineArgs: []string{"-b", "packages/b", "--verbose", "--traceResolution", "--explainFiles"},
+ },
+ },
+ },
+ {
+ subScenario: "pnpm style layout",
+ files: FileMap{
+ // button@0.0.1
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button/src/index.ts": stringtestutil.Dedent(`
+ export interface Button {
+ a: number;
+ b: number;
+ }
+ export function createButton(): Button {
+ return {
+ a: 0,
+ b: 1,
+ };
+ }
+ `),
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button/package.json": stringtestutil.Dedent(`
+ {
+ "name": "@component-type-checker/button",
+ "version": "0.0.1",
+ "main": "./src/index.ts"
+ }`),
+
+ // button@0.0.2
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button/src/index.ts": stringtestutil.Dedent(`
+ export interface Button {
+ a: number;
+ c: number;
+ }
+ export function createButton(): Button {
+ return {
+ a: 0,
+ c: 2,
+ };
+ }
+ `),
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button/package.json": stringtestutil.Dedent(`
+ {
+ "name": "@component-type-checker/button",
+ "version": "0.0.2",
+ "main": "./src/index.ts"
+ }`),
+
+ // @component-type-checker+components@0.0.1_@component-type-checker+button@0.0.1
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button": vfstest.Symlink(
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button",
+ ),
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.1/node_modules/@component-type-checker/components/src/index.ts": stringtestutil.Dedent(`
+ export { createButton, Button } from "@component-type-checker/button";
+ `),
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.1/node_modules/@component-type-checker/components/package.json": stringtestutil.Dedent(`
+ {
+ "name": "@component-type-checker/components",
+ "version": "0.0.1",
+ "main": "./src/index.ts",
+ "peerDependencies": {
+ "@component-type-checker/button": "*"
+ },
+ "devDependencies": {
+ "@component-type-checker/button": "0.0.2"
+ }
+ }`),
+
+ // @component-type-checker+components@0.0.1_@component-type-checker+button@0.0.2
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button": vfstest.Symlink(
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button",
+ ),
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.2/node_modules/@component-type-checker/components/src/index.ts": stringtestutil.Dedent(`
+ export { createButton, Button } from "@component-type-checker/button";
+ `),
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.2/node_modules/@component-type-checker/components/package.json": stringtestutil.Dedent(`
+ {
+ "name": "@component-type-checker/components",
+ "version": "0.0.1",
+ "main": "./src/index.ts",
+ "peerDependencies": {
+ "@component-type-checker/button": "*"
+ },
+ "devDependencies": {
+ "@component-type-checker/button": "0.0.2"
+ }
+ }`),
+
+ // sdk => @component-type-checker+components@0.0.1_@component-type-checker+button@0.0.1
+ "/home/src/projects/component-type-checker/packages/sdk/src/index.ts": stringtestutil.Dedent(`
+ export { Button, createButton } from "@component-type-checker/components";
+ export const VERSION = "0.0.2";
+ `),
+ "/home/src/projects/component-type-checker/packages/sdk/package.json": stringtestutil.Dedent(`
+ {
+ "name": "@component-type-checker/sdk1",
+ "version": "0.0.2",
+ "main": "./src/index.ts",
+ "dependencies": {
+ "@component-type-checker/components": "0.0.1",
+ "@component-type-checker/button": "0.0.1"
+ }
+ }`),
+ "/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/button": vfstest.Symlink(
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button",
+ ),
+ "/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components": vfstest.Symlink(
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.1/node_modules/@component-type-checker/components",
+ ),
+
+ // app => @component-type-checker+components@0.0.1_@component-type-checker+button@0.0.2
+ "/home/src/projects/component-type-checker/packages/app/src/app.tsx": stringtestutil.Dedent(`
+ import { VERSION } from "@component-type-checker/sdk";
+ import { Button } from "@component-type-checker/components";
+ import { createButton } from "@component-type-checker/button";
+ const button: Button = createButton();
+ `),
+ "/home/src/projects/component-type-checker/packages/app/package.json": stringtestutil.Dedent(`
+ {
+ "name": "app",
+ "version": "1.0.0",
+ "dependencies": {
+ "@component-type-checker/button": "0.0.2",
+ "@component-type-checker/components": "0.0.1",
+ "@component-type-checker/sdk": "0.0.2"
+ }
+ }`),
+ "/home/src/projects/component-type-checker/packages/app/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "target": "es5",
+ "module": "esnext",
+ "lib": ["ES5"],
+ "moduleResolution": "node",
+ "outDir": "dist",
+ },
+ "include": ["src"],
+ }`),
+ "/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button": vfstest.Symlink(
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button",
+ ),
+ "/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components": vfstest.Symlink(
+ "/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+components@0.0.1_@component-type-checker+button@0.0.2/node_modules/@component-type-checker/components",
+ ),
+ "/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk": vfstest.Symlink(
+ "/home/src/projects/component-type-checker/packages/sdk",
+ ),
+ },
+ cwd: "/home/src/projects/component-type-checker/packages/app",
+ commandLineArgs: []string{"--traceResolution", "--explainFiles"},
+ },
+ {
+ subScenario: "package json scope",
+ files: FileMap{
+ "/home/src/workspaces/project/src/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "target": "ES2016",
+ "composite": true,
+ "module": "Node16",
+ "traceResolution": true,
+ },
+ "files": [
+ "main.ts",
+ "fileA.ts",
+ "fileB.mts",
+ ],
+ }`),
+ "/home/src/workspaces/project/src/main.ts": "export const x = 10;",
+ "/home/src/workspaces/project/src/fileA.ts": stringtestutil.Dedent(`
+ import { foo } from "./fileB.mjs";
+ foo();
+ `),
+ "/home/src/workspaces/project/src/fileB.mts": "export function foo() {}",
+ "/home/src/workspaces/project/package.json": stringtestutil.Dedent(`
+ {
+ "name": "app",
+ "version": "1.0.0"
+ }
+ `),
+ },
+ commandLineArgs: []string{"-p", "src", "--explainFiles", "--extendedDiagnostics"},
+ edits: []*tscEdit{
+ {
+ caption: "Delete package.json",
+ edit: func(sys *testSys) {
+ sys.removeNoError("/home/src/workspaces/project/package.json")
+ },
+ // !!! repopulateInfo on diagnostics not yet implemented
+ expectedDiff: "Currently we arent repopulating error chain so errors will be different",
+ },
+ },
+ },
+ {
+ subScenario: "alternateResult",
+ files: FileMap{
+ "/home/src/projects/project/node_modules/@types/bar/package.json": getTscModuleResolutionAlternateResultAtTypesPackageJson("bar" /*addTypesCondition*/, false),
+ "/home/src/projects/project/node_modules/@types/bar/index.d.ts": getTscModuleResolutionAlternateResultDts("bar"),
+ "/home/src/projects/project/node_modules/bar/package.json": getTscModuleResolutionAlternateResultPackageJson("bar" /*addTypes*/, false /*addTypesCondition*/, false),
+ "/home/src/projects/project/node_modules/bar/index.js": getTscModuleResolutionAlternateResultJs("bar"),
+ "/home/src/projects/project/node_modules/bar/index.mjs": getTscModuleResolutionAlternateResultMjs("bar"),
+ "/home/src/projects/project/node_modules/foo/package.json": getTscModuleResolutionAlternateResultPackageJson("foo" /*addTypes*/, true /*addTypesCondition*/, false),
+ "/home/src/projects/project/node_modules/foo/index.js": getTscModuleResolutionAlternateResultJs("foo"),
+ "/home/src/projects/project/node_modules/foo/index.mjs": getTscModuleResolutionAlternateResultMjs("foo"),
+ "/home/src/projects/project/node_modules/foo/index.d.ts": getTscModuleResolutionAlternateResultDts("foo"),
+ "/home/src/projects/project/node_modules/@types/bar2/package.json": getTscModuleResolutionAlternateResultAtTypesPackageJson("bar2" /*addTypesCondition*/, true),
+ "/home/src/projects/project/node_modules/@types/bar2/index.d.ts": getTscModuleResolutionAlternateResultDts("bar2"),
+ "/home/src/projects/project/node_modules/bar2/package.json": getTscModuleResolutionAlternateResultPackageJson("bar2" /*addTypes*/, false /*addTypesCondition*/, false),
+ "/home/src/projects/project/node_modules/bar2/index.js": getTscModuleResolutionAlternateResultJs("bar2"),
+ "/home/src/projects/project/node_modules/bar2/index.mjs": getTscModuleResolutionAlternateResultMjs("bar2"),
+ "/home/src/projects/project/node_modules/foo2/package.json": getTscModuleResolutionAlternateResultPackageJson("foo2" /*addTypes*/, true /*addTypesCondition*/, true),
+ "/home/src/projects/project/node_modules/foo2/index.js": getTscModuleResolutionAlternateResultJs("foo2"),
+ "/home/src/projects/project/node_modules/foo2/index.mjs": getTscModuleResolutionAlternateResultMjs("foo2"),
+ "/home/src/projects/project/node_modules/foo2/index.d.ts": getTscModuleResolutionAlternateResultDts("foo2"),
+ "/home/src/projects/project/index.mts": stringtestutil.Dedent(`
+ import { foo } from "foo";
+ import { bar } from "bar";
+ import { foo2 } from "foo2";
+ import { bar2 } from "bar2";
+ `),
+ "/home/src/projects/project/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "module": "node16",
+ "moduleResolution": "node16",
+ "traceResolution": true,
+ "incremental": true,
+ "strict": true,
+ "types": [],
+ },
+ "files": ["index.mts"],
+ }`),
+ },
+ cwd: "/home/src/projects/project",
+ edits: []*tscEdit{
+ {
+ caption: "delete the alternateResult in @types",
+ edit: func(sys *testSys) {
+ sys.removeNoError("/home/src/projects/project/node_modules/@types/bar/index.d.ts")
+ },
+ // !!! repopulateInfo on diagnostics not yet implemented
+ expectedDiff: "Currently we arent repopulating error chain so errors will be different",
+ },
+ {
+ caption: "delete the node10Result in package/types",
+ edit: func(sys *testSys) {
+ sys.removeNoError("/home/src/projects/project/node_modules/foo/index.d.ts")
+ },
+ // !!! repopulateInfo on diagnostics not yet implemented
+ expectedDiff: "Currently we arent repopulating error chain so errors will be different",
+ },
+ {
+ caption: "add the alternateResult in @types",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/@types/bar/index.d.ts", getTscModuleResolutionAlternateResultDts("bar"), false)
+ },
+ // !!! repopulateInfo on diagnostics not yet implemented
+ expectedDiff: "Currently we arent repopulating error chain so errors will be different",
+ },
+ {
+ caption: "add the alternateResult in package/types",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/foo/index.d.ts", getTscModuleResolutionAlternateResultDts("foo"), false)
+ },
+ },
+ {
+ caption: "update package.json from @types so error is fixed",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/@types/bar/package.json", getTscModuleResolutionAlternateResultAtTypesPackageJson("bar" /*addTypesCondition*/, true), false)
+ },
+ },
+ {
+ caption: "update package.json so error is fixed",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/foo/package.json", getTscModuleResolutionAlternateResultPackageJson("foo" /*addTypes*/, true /*addTypesCondition*/, true), false)
+ },
+ },
+ {
+ caption: "update package.json from @types so error is introduced",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/@types/bar2/package.json", getTscModuleResolutionAlternateResultAtTypesPackageJson("bar2" /*addTypesCondition*/, false), false)
+ },
+ },
+ {
+ caption: "update package.json so error is introduced",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/foo2/package.json", getTscModuleResolutionAlternateResultPackageJson("foo2" /*addTypes*/, true /*addTypesCondition*/, false), false)
+ },
+ },
+ {
+ caption: "delete the alternateResult in @types",
+ edit: func(sys *testSys) {
+ sys.removeNoError("/home/src/projects/project/node_modules/@types/bar2/index.d.ts")
+ },
+ // !!! repopulateInfo on diagnostics not yet implemented
+ expectedDiff: "Currently we arent repopulating error chain so errors will be different",
+ },
+ {
+ caption: "delete the node10Result in package/types",
+ edit: func(sys *testSys) {
+ sys.removeNoError("/home/src/projects/project/node_modules/foo2/index.d.ts")
+ },
+ // !!! repopulateInfo on diagnostics not yet implemented
+ expectedDiff: "Currently we arent repopulating error chain so errors will be different",
+ },
+ {
+ caption: "add the alternateResult in @types",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/@types/bar2/index.d.ts", getTscModuleResolutionAlternateResultDts("bar2"), false)
+ },
+ // !!! repopulateInfo on diagnostics not yet implemented
+ expectedDiff: "Currently we arent repopulating error chain so errors will be different",
+ },
+ {
+ caption: "add the ndoe10Result in package/types",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/projects/project/node_modules/foo2/index.d.ts", getTscModuleResolutionAlternateResultDts("foo2"), false)
+ },
+ },
+ },
+ },
+ }
+
+ for _, test := range testCases {
+ test.run(t, "moduleResolution")
+ }
+}
+
+func getBuildModuleResolutionInProjectRefTestCase(preserveSymlinks bool) *tscInput {
+ return &tscInput{
+ subScenario: `resolves specifier in output declaration file from referenced project correctly` + core.IfElse(preserveSymlinks, " with preserveSymlinks", ""),
+ files: FileMap{
+ `/user/username/projects/myproject/packages/pkg1/index.ts`: stringtestutil.Dedent(`
+ import type { TheNum } from 'pkg2'
+ export const theNum: TheNum = 42;`),
+ `/user/username/projects/myproject/packages/pkg1/tsconfig.json`: stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "outDir": "build",
+ "preserveSymlinks": %t
+ },
+ "references": [{ "path": "../pkg2" }]
+ }
+ `, preserveSymlinks)),
+ `/user/username/projects/myproject/packages/pkg2/const.ts`: stringtestutil.Dedent(`
+ export type TheNum = 42;
+ `),
+ `/user/username/projects/myproject/packages/pkg2/index.ts`: stringtestutil.Dedent(`
+ export type { TheNum } from 'const';
+ `),
+ `/user/username/projects/myproject/packages/pkg2/tsconfig.json`: stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "build",
+ "paths": {
+ "const": ["./const"]
+ },
+ "preserveSymlinks": %t,
+ },
+ }
+ `, preserveSymlinks)),
+ `/user/username/projects/myproject/packages/pkg2/package.json`: stringtestutil.Dedent(`
+ {
+ "name": "pkg2",
+ "version": "1.0.0",
+ "main": "build/index.js"
+ }
+ `),
+ `/user/username/projects/myproject/node_modules/pkg2`: vfstest.Symlink(`/user/username/projects/myproject/packages/pkg2`),
+ },
+ cwd: "/user/username/projects/myproject",
+ commandLineArgs: []string{"-b", "packages/pkg1", "--verbose", "--traceResolution"},
+ }
+}
+
+func getTscModuleResolutionSharingFileMap() FileMap {
+ return FileMap{
+ "/home/src/workspaces/project/packages/a/index.js": `export const a = 'a';`,
+ "/home/src/workspaces/project/packages/a/test/index.js": `import 'a';`,
+ "/home/src/workspaces/project/packages/a/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "compilerOptions": {
+ "checkJs": true,
+ "composite": true,
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "module": "nodenext",
+ "outDir": "types",
+ },
+ }`),
+ "/home/src/workspaces/project/packages/a/package.json": stringtestutil.Dedent(`
+ {
+ "name": "a",
+ "version": "0.0.0",
+ "type": "module",
+ "exports": {
+ ".": {
+ "types": "./types/index.d.ts",
+ "default": "./index.js"
+ }
+ }
+ }`),
+ "/home/src/workspaces/project/packages/b/index.js": `export { a } from 'a';`,
+ "/home/src/workspaces/project/packages/b/tsconfig.json": stringtestutil.Dedent(`
+ {
+ "references": [{ "path": "../a" }],
+ "compilerOptions": {
+ "checkJs": true,
+ "module": "nodenext",
+ "noEmit": true,
+ "noImplicitAny": true,
+ },
+ }`),
+ "/home/src/workspaces/project/packages/b/package.json": stringtestutil.Dedent(`
+ {
+ "name": "b",
+ "version": "0.0.0",
+ "type": "module"
+ }`),
+ "/home/src/workspaces/project/node_modules/a": vfstest.Symlink("/home/src/workspaces/project/packages/a"),
+ }
+}
+
+func getTscModuleResolutionAlternateResultAtTypesPackageJson(packageName string, addTypesCondition bool) string {
+ var typesString string
+ if addTypesCondition {
+ typesString = `"types": "./index.d.ts",`
+ }
+ return stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "name": "@types/%s",
+ "version": "1.0.0",
+ "types": "index.d.ts",
+ "exports": {
+ ".": {
+ %s
+ "require": "./index.d.ts"
+ }
+ }
+ }`, packageName, typesString))
+}
+
+func getTscModuleResolutionAlternateResultPackageJson(packageName string, addTypes bool, addTypesCondition bool) string {
+ var types string
+ if addTypes {
+ types = `"types": "index.d.ts",`
+ }
+ var typesString string
+ if addTypesCondition {
+ typesString = `"types": "./index.d.ts",`
+ }
+ return stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "name": "%s",
+ "version": "1.0.0",
+ "main": "index.js",
+ %s
+ "exports": {
+ ".": {
+ %s
+ "import": "./index.mjs",
+ "require": "./index.js"
+ }
+ }
+ }`, packageName, types, typesString))
+}
+
+func getTscModuleResolutionAlternateResultDts(packageName string) string {
+ return fmt.Sprintf(`export declare const %s: number;`, packageName)
+}
+
+func getTscModuleResolutionAlternateResultJs(packageName string) string {
+ return fmt.Sprintf(`module.exports = { %s: 1 };`, packageName)
+}
+
+func getTscModuleResolutionAlternateResultMjs(packageName string) string {
+ return fmt.Sprintf(`export const %s = 1;`, packageName)
+}
diff --git a/internal/execute/tscnocheck_test.go b/internal/execute/tscnocheck_test.go
index 45d4846d84..1251c05ce0 100644
--- a/internal/execute/tscnocheck_test.go
+++ b/internal/execute/tscnocheck_test.go
@@ -1,38 +1,94 @@
package execute_test
import (
+ "fmt"
+ "slices"
"testing"
+ "github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/testutil/stringtestutil"
)
type noCheckScenario struct {
- subscenario string
+ subScenario string
aText string
}
-func TestNoCheck(t *testing.T) {
+func TestTscNoCheck(t *testing.T) {
t.Parallel()
cases := []noCheckScenario{
{"syntax errors", `export const a = "hello`},
{"semantic errors", `export const a: number = "hello";`},
{"dts errors", `export const a = class { private p = 10; };`},
}
- for _, c := range cases {
- (&tscInput{
- subScenario: c.subscenario,
- files: FileMap{
- "/home/src/workspaces/project/a.ts": c.aText,
- "/home/src/workspaces/project/b.ts": `export const b = 10;`,
- "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
- {
- "compilerOptions": {
- "declaration": true,
- }
- }`),
- // incremental: undefined, true
+ testCases := core.FlatMap(cases, func(c noCheckScenario) []*tscInput {
+ return []*tscInput{
+ getTscNoCheckTestCase(&c, false, []string{}),
+ getTscNoCheckTestCase(&c, true, []string{}),
+ getTscNoCheckTestCase(&c, false, []string{"-b", "-v"}),
+ getTscNoCheckTestCase(&c, true, []string{"-b", "-v"}),
+ }
+ })
+ for _, test := range testCases {
+ test.run(t, "noCheck")
+ }
+}
+
+func getTscNoCheckTestCase(scenario *noCheckScenario, incremental bool, commandLineArgs []string) *tscInput {
+ noChangeWithCheck := &tscEdit{
+ caption: "No Change run with checking",
+ commandLineArgs: commandLineArgs,
+ }
+ fixErrorNoCheck := &tscEdit{
+ caption: "Fix `a` error with noCheck",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/workspaces/project/a.ts", `export const a = "hello";`, false)
+ },
+ }
+ addErrorNoCheck := &tscEdit{
+ caption: "Introduce error with noCheck",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/workspaces/project/a.ts", scenario.aText, false)
+ },
+ }
+ return &tscInput{
+ subScenario: scenario.subScenario + core.IfElse(incremental, " with incremental", ""),
+ files: FileMap{
+ "/home/src/workspaces/project/a.ts": scenario.aText,
+ "/home/src/workspaces/project/b.ts": `export const b = 10;`,
+ "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(`
+ {
+ "compilerOptions": {
+ "declaration": true,
+ "incremental": %t
+ }
+ }`, incremental)),
+ },
+ commandLineArgs: slices.Concat(commandLineArgs, []string{"--noCheck"}),
+ edits: []*tscEdit{
+ noChange,
+ fixErrorNoCheck, // Fix error with noCheck
+ noChange, // Should be no op
+ noChangeWithCheck, // Check errors - should not report any errors - update buildInfo
+ noChangeWithCheck, // Should be no op
+ noChange, // Should be no op
+ addErrorNoCheck,
+ noChange, // Should be no op
+ noChangeWithCheck, // Should check errors and update buildInfo
+ fixErrorNoCheck, // Fix error with noCheck
+ noChangeWithCheck, // Should check errors and update buildInfo
+ {
+ caption: "Add file with error",
+ edit: func(sys *testSys) {
+ sys.writeFileNoError("/home/src/workspaces/project/c.ts", `export const c: number = "hello";`, false)
+ },
+ commandLineArgs: commandLineArgs,
},
- commandLineArgs: []string{"--noCheck"},
- }).run(t, "noCheck")
+ addErrorNoCheck,
+ fixErrorNoCheck,
+ noChangeWithCheck,
+ noChange, // Should be no op
+ noChangeWithCheck, // Should be no op
+ },
}
}
diff --git a/internal/execute/tsctestrunner_test.go b/internal/execute/tsctestrunner_test.go
index d6546c7e06..177cf16355 100644
--- a/internal/execute/tsctestrunner_test.go
+++ b/internal/execute/tsctestrunner_test.go
@@ -63,7 +63,7 @@ func (test *tscInput) executeCommand(sys *testSys, baselineBuilder *strings.Buil
func (test *tscInput) run(t *testing.T, scenario string) {
t.Helper()
- t.Run(test.subScenario, func(t *testing.T) {
+ t.Run(test.getBaselineSubFolder()+"/"+test.subScenario, func(t *testing.T) {
t.Parallel()
// initial test tsc compile
baselineBuilder := &strings.Builder{}
@@ -79,7 +79,7 @@ func (test *tscInput) run(t *testing.T, scenario string) {
sys.baselineFSwithDiff(baselineBuilder)
result := test.executeCommand(sys, baselineBuilder, test.commandLineArgs)
sys.serializeState(baselineBuilder)
- sys.baselineProgram(baselineBuilder, result.IncrementalProgram, result.Watcher)
+ sys.baselinePrograms(baselineBuilder, result.IncrementalProgram, result.Watcher)
var unexpectedDiff string
for index, do := range test.edits {
@@ -101,7 +101,7 @@ func (test *tscInput) run(t *testing.T, scenario string) {
result.Watcher.DoCycle()
}
sys.serializeState(baselineBuilder)
- sys.baselineProgram(baselineBuilder, editResult.IncrementalProgram, result.Watcher)
+ sys.baselinePrograms(baselineBuilder, editResult.IncrementalProgram, result.Watcher)
})
wg.Queue(func() {
// Compute build with all the edits
diff --git a/internal/execute/watcher.go b/internal/execute/watcher.go
index 738c24ae17..5861046dda 100644
--- a/internal/execute/watcher.go
+++ b/internal/execute/watcher.go
@@ -15,11 +15,12 @@ import (
)
type Watcher struct {
- sys System
- configFileName string
- options *tsoptions.ParsedCommandLine
- reportDiagnostic diagnosticReporter
- testing CommandLineTesting
+ sys System
+ configFileName string
+ options *tsoptions.ParsedCommandLine
+ reportDiagnostic diagnosticReporter
+ reportErrorSummary diagnosticsReporter
+ testing CommandLineTesting
host compiler.CompilerHost
program *incremental.Program
@@ -27,12 +28,13 @@ type Watcher struct {
configModified bool
}
-func createWatcher(sys System, configParseResult *tsoptions.ParsedCommandLine, reportDiagnostic diagnosticReporter, testing CommandLineTesting) *Watcher {
+func createWatcher(sys System, configParseResult *tsoptions.ParsedCommandLine, reportDiagnostic diagnosticReporter, reportErrorSummary diagnosticsReporter, testing CommandLineTesting) *Watcher {
w := &Watcher{
- sys: sys,
- options: configParseResult,
- reportDiagnostic: reportDiagnostic,
- testing: testing,
+ sys: sys,
+ options: configParseResult,
+ reportDiagnostic: reportDiagnostic,
+ reportErrorSummary: reportErrorSummary,
+ testing: testing,
// reportWatchStatus: createWatchStatusReporter(sys, configParseResult.CompilerOptions().Pretty),
}
if configParseResult.ConfigFile != nil {
@@ -75,10 +77,10 @@ func (w *Watcher) DoCycle() {
}), w.program, w.testing != nil)
if w.hasBeenModified(w.program.GetProgram()) {
- fmt.Fprintln(w.sys.Writer(), "build starting at ", w.sys.Now())
+ fmt.Fprintln(w.sys.Writer(), "build starting at", w.sys.Now().Format("03:04:05 PM"))
timeStart := w.sys.Now()
w.compileAndEmit()
- fmt.Fprintln(w.sys.Writer(), "build finished in ", w.sys.Now().Sub(timeStart))
+ fmt.Fprintf(w.sys.Writer(), "build finished in %.3fs\n", w.sys.Now().Sub(timeStart).Seconds())
} else {
// print something???
// fmt.Fprintln(w.sys.Writer(), "no changes detected at ", w.sys.Now())
@@ -88,7 +90,7 @@ func (w *Watcher) DoCycle() {
func (w *Watcher) compileAndEmit() {
// !!! output/error reporting is currently the same as non-watch mode
// diagnostics, emitResult, exitStatus :=
- emitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.testing)
+ emitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.reportErrorSummary, w.sys.Writer(), compileTimes{}, w.testing)
}
func (w *Watcher) hasErrorsInTsConfig() bool {
diff --git a/internal/incremental/buildInfo.go b/internal/incremental/buildInfo.go
index bf537e0084..9c6739127d 100644
--- a/internal/incremental/buildInfo.go
+++ b/internal/incremental/buildInfo.go
@@ -2,6 +2,8 @@ package incremental
import (
"fmt"
+ "iter"
+ "maps"
"github.com/go-json-experiment/json"
"github.com/go-json-experiment/json/jsontext"
@@ -17,52 +19,56 @@ type (
BuildInfoFileIdListId int
)
-// /**
-// * buildInfoRoot is
-// * for incremental program buildinfo
-// * - start and end of FileId for consecutive fileIds to be included as root
-// * - single fileId that is root
-// * for non incremental program buildinfo
-// * - string that is the root file name
-// */
-// type BuildInfoRoot struct {
-// StartEnd *[2]BuildInfoFileId
-// Single BuildInfoFileId
-// nonIncremental string
-// }
-
-// func (o BuildInfoRoot) MarshalJSON() ([]byte, error) {
-// if o.StartEnd != nil {
-// return json.Marshal(o.StartEnd)
-// }
-// if o.Single != 0 {
-// return json.Marshal(o.Single)
-// }
-// if o.nonIncremental != "" {
-// return json.Marshal(o.nonIncremental)
-// }
-// panic("unknown BuildInfoRoot type")
-// }
-
-// func (o *BuildInfoRoot) UnmarshalJSON(data []byte) error {
-// *o = BuildInfoRoot{}
-// var vStartEnd [2]BuildInfoFileId
-// if err := json.Unmarshal(data, &vStartEnd); err == nil {
-// o.StartEnd = &vStartEnd
-// return nil
-// }
-// var vSingle BuildInfoFileId
-// if err := json.Unmarshal(data, &vSingle); err == nil {
-// o.Single = vSingle
-// return nil
-// }
-// var vNonIncremental string
-// if err := json.Unmarshal(data, &vNonIncremental); err == nil {
-// o.nonIncremental = vNonIncremental
-// return nil
-// }
-// return fmt.Errorf("invalid BuildInfoRoot: %s", data)
-// }
+// buildInfoRoot is
+// - for incremental program buildinfo
+// - start and end of FileId for consecutive fileIds to be included as root
+// - start - single fileId that is root
+//
+// - for non incremental program buildinfo
+// - string that is the root file name
+type BuildInfoRoot struct {
+ Start BuildInfoFileId
+ End BuildInfoFileId
+ NonIncremental string // Root of a non incremental program
+}
+
+func (b *BuildInfoRoot) MarshalJSON() ([]byte, error) {
+ if b.Start != 0 {
+ if b.End != 0 {
+ return json.Marshal([2]BuildInfoFileId{b.Start, b.End})
+ } else {
+ return json.Marshal(b.Start)
+ }
+ } else {
+ return json.Marshal(b.NonIncremental)
+ }
+}
+
+func (b *BuildInfoRoot) UnmarshalJSON(data []byte) error {
+ var startAndEnd *[2]int
+ if err := json.Unmarshal(data, &startAndEnd); err == nil {
+ *b = BuildInfoRoot{
+ Start: BuildInfoFileId(startAndEnd[0]),
+ End: BuildInfoFileId(startAndEnd[1]),
+ }
+ return nil
+ }
+ var start int
+ if err := json.Unmarshal(data, &start); err == nil {
+ *b = BuildInfoRoot{
+ Start: BuildInfoFileId(start),
+ }
+ return nil
+ }
+ var name string
+ if err := json.Unmarshal(data, &name); err == nil {
+ *b = BuildInfoRoot{
+ NonIncremental: name,
+ }
+ return nil
+ }
+ return fmt.Errorf("invalid BuildInfoRoot: %s", data)
+}
type buildInfoFileInfoNoSignature struct {
Version string `json:"version,omitzero"`
@@ -109,6 +115,9 @@ func newBuildInfoFileInfo(fileInfo *fileInfo) *BuildInfoFileInfo {
}
func (b *BuildInfoFileInfo) GetFileInfo() *fileInfo {
+ if b == nil {
+ return nil
+ }
if b.signature != "" {
return &fileInfo{
version: b.signature,
@@ -413,13 +422,34 @@ func (b *BuildInfoEmitSignature) UnmarshalJSON(data []byte) error {
return fmt.Errorf("invalid BuildInfoEmitSignature: %s", data)
}
+type BuildInfoResolvedRoot struct {
+ Resolved BuildInfoFileId
+ Root BuildInfoFileId
+}
+
+func (b *BuildInfoResolvedRoot) MarshalJSON() ([]byte, error) {
+ return json.Marshal([2]BuildInfoFileId{b.Resolved, b.Root})
+}
+
+func (b *BuildInfoResolvedRoot) UnmarshalJSON(data []byte) error {
+ var resolvedAndRoot *[2]int
+ if err := json.Unmarshal(data, &resolvedAndRoot); err == nil {
+ *b = BuildInfoResolvedRoot{
+ Resolved: BuildInfoFileId(resolvedAndRoot[0]),
+ Root: BuildInfoFileId(resolvedAndRoot[1]),
+ }
+ return nil
+ }
+ return fmt.Errorf("invalid BuildInfoResolvedRoot: %s", data)
+}
+
type BuildInfo struct {
Version string `json:"version,omitzero"`
// Common between incremental and tsc -b buildinfo for non incremental programs
- Errors bool `json:"errors,omitzero"`
- CheckPending bool `json:"checkPending,omitzero"`
- // Root []BuildInfoRoot `json:"root,omitzero"`
+ Errors bool `json:"errors,omitzero"`
+ CheckPending bool `json:"checkPending,omitzero"`
+ Root []*BuildInfoRoot `json:"root,omitzero"`
// IncrementalProgram info
FileNames []string `json:"fileNames,omitzero"`
@@ -433,7 +463,10 @@ type BuildInfo struct {
AffectedFilesPendingEmit []*BuildInfoFilePendingEmit `json:"affectedFilesPendingEmit,omitzero"`
LatestChangedDtsFile string `json:"latestChangedDtsFile,omitzero"` // Because this is only output file in the program, we dont need fileId to deduplicate name
EmitSignatures []*BuildInfoEmitSignature `json:"emitSignatures,omitzero"`
- // resolvedRoot: readonly BuildInfoResolvedRoot[] | undefined;
+ ResolvedRoot []*BuildInfoResolvedRoot `json:"resolvedRoot,omitzero"`
+
+ // NonIncrementalProgram info
+ SemanticErrors bool `json:"semanticErrors,omitzero"`
}
func (b *BuildInfo) IsValidVersion() bool {
@@ -444,6 +477,14 @@ func (b *BuildInfo) IsIncremental() bool {
return b != nil && len(b.FileNames) != 0
}
+func (b *BuildInfo) fileName(fileId BuildInfoFileId) string {
+ return b.FileNames[fileId-1]
+}
+
+func (b *BuildInfo) fileInfo(fileId BuildInfoFileId) *BuildInfoFileInfo {
+ return b.FileInfos[fileId-1]
+}
+
func (b *BuildInfo) GetCompilerOptions(buildInfoDirectory string) *core.CompilerOptions {
options := &core.CompilerOptions{}
for option, value := range b.Options.Entries() {
@@ -459,3 +500,66 @@ func (b *BuildInfo) GetCompilerOptions(buildInfoDirectory string) *core.Compiler
}
return options
}
+
+func (b *BuildInfo) IsEmitPending(resolved *tsoptions.ParsedCommandLine, buildInfoDirectory string) bool {
+ // Some of the emit files like source map or dts etc are not yet done
+ if !resolved.CompilerOptions().NoEmit.IsTrue() || resolved.CompilerOptions().GetEmitDeclarations() {
+ pendingEmit := getPendingEmitKindWithOptions(resolved.CompilerOptions(), b.GetCompilerOptions(buildInfoDirectory))
+ if resolved.CompilerOptions().NoEmit.IsTrue() {
+ pendingEmit |= FileEmitKindDtsErrors
+ }
+ return pendingEmit != 0
+ }
+ return false
+}
+
+func (b *BuildInfo) GetBuildInfoRootInfoReader(buildInfoDirectory string, comparePathOptions tspath.ComparePathsOptions) *BuildInfoRootInfoReader {
+ roots := make(map[tspath.Path]*BuildInfoFileInfo)
+ rootToResolved := make(map[tspath.Path]tspath.Path)
+
+ addRoot := func(root string, fileInfo *BuildInfoFileInfo) {
+ rootPath := tspath.ToPath(root, buildInfoDirectory, comparePathOptions.UseCaseSensitiveFileNames)
+ rootToResolved[rootPath] = rootPath
+ if fileInfo != nil {
+ roots[rootPath] = fileInfo
+ }
+ }
+
+ for _, root := range b.Root {
+ if root.NonIncremental != "" {
+ addRoot(root.NonIncremental, nil)
+ } else if root.End == 0 {
+ addRoot(b.fileName(root.Start), b.fileInfo(root.Start))
+ } else {
+ for i := root.Start; i <= root.End; i++ {
+ addRoot(b.fileName(i), b.fileInfo(i))
+ }
+ }
+ }
+ for _, resolved := range b.ResolvedRoot {
+ rootToResolved[tspath.ToPath(b.fileName(resolved.Root), buildInfoDirectory, comparePathOptions.UseCaseSensitiveFileNames)] = tspath.ToPath(b.fileName(resolved.Resolved), buildInfoDirectory, comparePathOptions.UseCaseSensitiveFileNames)
+ }
+ return &BuildInfoRootInfoReader{
+ rootFileInfos: roots,
+ rootToResolved: rootToResolved,
+ }
+}
+
+type BuildInfoRootInfoReader struct {
+ rootFileInfos map[tspath.Path]*BuildInfoFileInfo
+ rootToResolved map[tspath.Path]tspath.Path
+}
+
+func (b *BuildInfoRootInfoReader) GetBuildInfoFileInfo(inputFilePath tspath.Path) (*BuildInfoFileInfo, tspath.Path) {
+ if info, ok := b.rootFileInfos[inputFilePath]; ok {
+ return info, inputFilePath
+ }
+ if resolved, ok := b.rootToResolved[inputFilePath]; ok {
+ return b.rootFileInfos[resolved], resolved
+ }
+ return nil, ""
+}
+
+func (b *BuildInfoRootInfoReader) Roots() iter.Seq[tspath.Path] {
+ return maps.Keys(b.rootToResolved)
+}
diff --git a/internal/incremental/buildinfotosnapshot.go b/internal/incremental/buildinfotosnapshot.go
index 9ae57324ac..03d4d94c99 100644
--- a/internal/incremental/buildinfotosnapshot.go
+++ b/internal/incremental/buildinfotosnapshot.go
@@ -41,6 +41,7 @@ func buildInfoToSnapshot(buildInfo *BuildInfo, buildInfoFileName string, config
to.snapshot.latestChangedDtsFile = to.toAbsolutePath(buildInfo.LatestChangedDtsFile)
}
to.snapshot.hasErrors = core.IfElse(buildInfo.Errors, core.TSTrue, core.TSFalse)
+ to.snapshot.hasSemanticErrors = buildInfo.SemanticErrors
to.snapshot.checkPending = buildInfo.CheckPending
return &to.snapshot
}
diff --git a/internal/incremental/emitfileshandler.go b/internal/incremental/emitfileshandler.go
index 6f2937815b..287da46fe6 100644
--- a/internal/incremental/emitfileshandler.go
+++ b/internal/incremental/emitfileshandler.go
@@ -2,7 +2,6 @@ package incremental
import (
"context"
- "slices"
"github.com/microsoft/typescript-go/internal/ast"
"github.com/microsoft/typescript-go/internal/collections"
@@ -22,7 +21,7 @@ type emitFilesHandler struct {
isForDtsErrors bool
signatures collections.SyncMap[tspath.Path, string]
emitSignatures collections.SyncMap[tspath.Path, *emitSignature]
- latestChangedDtsFiles collections.SyncSet[string]
+ latestChangedDtsFiles collections.SyncMap[tspath.Path, string]
deletedPendingKinds collections.Set[tspath.Path]
emitUpdates collections.SyncMap[tspath.Path, *emitUpdate]
}
@@ -207,7 +206,7 @@ func (h *emitFilesHandler) skipDtsOutputOfComposite(file *ast.SourceFile, output
data.DiffersOnlyInMap = true
}
} else {
- h.latestChangedDtsFiles.Add(outputFileName)
+ h.latestChangedDtsFiles.Store(file.Path(), outputFileName)
}
h.emitSignatures.Store(file.Path(), &emitSignature{signature: newSignature})
return false
@@ -228,32 +227,32 @@ func (h *emitFilesHandler) updateSnapshot() []*compiler.EmitResult {
h.program.snapshot.buildInfoEmitPending.Store(true)
return true
})
- latestChangedDtsFiles := h.latestChangedDtsFiles.ToSlice()
- slices.Sort(latestChangedDtsFiles)
- if latestChangedDtsFile := core.LastOrNil(latestChangedDtsFiles); latestChangedDtsFile != "" {
- h.program.snapshot.latestChangedDtsFile = latestChangedDtsFile
- h.program.snapshot.buildInfoEmitPending.Store(true)
- }
for file := range h.deletedPendingKinds.Keys() {
h.program.snapshot.affectedFilesPendingEmit.Delete(file)
h.program.snapshot.buildInfoEmitPending.Store(true)
}
+ // Always use correct order when to collect the result
var results []*compiler.EmitResult
- h.emitUpdates.Range(func(file tspath.Path, update *emitUpdate) bool {
- if update.pendingKind == 0 {
- h.program.snapshot.affectedFilesPendingEmit.Delete(file)
- } else {
- h.program.snapshot.affectedFilesPendingEmit.Store(file, update.pendingKind)
+ for _, file := range h.program.GetSourceFiles() {
+ if latestChangedDtsFile, ok := h.latestChangedDtsFiles.Load(file.Path()); ok {
+ h.program.snapshot.latestChangedDtsFile = latestChangedDtsFile
+ h.program.snapshot.buildInfoEmitPending.Store(true)
}
- if update.result != nil {
- results = append(results, update.result)
- if len(update.result.Diagnostics) != 0 {
- h.program.snapshot.emitDiagnosticsPerFile.Store(file, &diagnosticsOrBuildInfoDiagnosticsWithFileName{diagnostics: update.result.Diagnostics})
+ if update, ok := h.emitUpdates.Load(file.Path()); ok {
+ if update.pendingKind == 0 {
+ h.program.snapshot.affectedFilesPendingEmit.Delete(file.Path())
+ } else {
+ h.program.snapshot.affectedFilesPendingEmit.Store(file.Path(), update.pendingKind)
+ }
+ if update.result != nil {
+ results = append(results, update.result)
+ if len(update.result.Diagnostics) != 0 {
+ h.program.snapshot.emitDiagnosticsPerFile.Store(file.Path(), &diagnosticsOrBuildInfoDiagnosticsWithFileName{diagnostics: update.result.Diagnostics})
+ }
}
+ h.program.snapshot.buildInfoEmitPending.Store(true)
}
- h.program.snapshot.buildInfoEmitPending.Store(true)
- return true
- })
+ }
return results
}
diff --git a/internal/incremental/program.go b/internal/incremental/program.go
index 362cea8a3c..5b2d05440c 100644
--- a/internal/incremental/program.go
+++ b/internal/incremental/program.go
@@ -186,7 +186,7 @@ func (p *Program) Emit(ctx context.Context, options compiler.EmitOptions) *compi
// Emit buildInfo and combine result
buildInfoResult := p.emitBuildInfo(ctx, options)
- if buildInfoResult != nil && buildInfoResult.EmittedFiles != nil {
+ if buildInfoResult != nil {
result.Diagnostics = append(result.Diagnostics, buildInfoResult.Diagnostics...)
result.EmittedFiles = append(result.EmittedFiles, buildInfoResult.EmittedFiles...)
}
@@ -249,8 +249,8 @@ func (p *Program) emitBuildInfo(ctx context.Context, options compiler.EmitOption
return nil
}
if p.snapshot.hasErrors == core.TSUnknown {
- p.snapshot.hasErrors = p.ensureHasErrorsForState(ctx, p.program)
- if p.snapshot.hasErrors != p.snapshot.hasErrorsFromOldState {
+ p.ensureHasErrorsForState(ctx, p.program)
+ if p.snapshot.hasErrors != p.snapshot.hasErrorsFromOldState || p.snapshot.hasSemanticErrors != p.snapshot.hasSemanticErrorsFromOldState {
p.snapshot.buildInfoEmitPending.Store(true)
}
}
@@ -281,18 +281,39 @@ func (p *Program) emitBuildInfo(ctx context.Context, options compiler.EmitOption
}
}
p.snapshot.buildInfoEmitPending.Store(false)
-
- var emittedFiles []string
- if p.snapshot.options.ListEmittedFiles.IsTrue() {
- emittedFiles = []string{buildInfoFileName}
- }
return &compiler.EmitResult{
EmitSkipped: false,
- EmittedFiles: emittedFiles,
+ EmittedFiles: []string{buildInfoFileName},
}
}
-func (p *Program) ensureHasErrorsForState(ctx context.Context, program *compiler.Program) core.Tristate {
+func (p *Program) ensureHasErrorsForState(ctx context.Context, program *compiler.Program) {
+ if slices.ContainsFunc(program.GetSourceFiles(), func(file *ast.SourceFile) bool {
+ if _, ok := p.snapshot.emitDiagnosticsPerFile.Load(file.Path()); ok {
+ // emit diagnostics will be encoded in buildInfo;
+ return true
+ }
+ return false
+ }) {
+ // Record this for only non incremental build info
+ p.snapshot.hasErrors = core.IfElse(p.snapshot.options.IsIncremental(), core.TSFalse, core.TSTrue)
+ // Dont need to encode semantic errors state!!
+ p.snapshot.hasSemanticErrors = false
+ return
+ }
+ if len(program.GetConfigFileParsingDiagnostics()) > 0 ||
+ len(program.GetSyntacticDiagnostics(ctx, nil)) > 0 ||
+ len(program.GetProgramDiagnostics()) > 0 ||
+ len(program.GetBindDiagnostics(ctx, nil)) > 0 ||
+ len(program.GetOptionsDiagnostics(ctx)) > 0 ||
+ len(program.GetGlobalDiagnostics(ctx)) > 0 {
+ p.snapshot.hasErrors = core.TSTrue
+ // Dont need to encode semantic errors state!!
+ p.snapshot.hasSemanticErrors = false
+ return
+ }
+
+ p.snapshot.hasErrors = core.TSFalse
// Check semantic and emit diagnostics first as we dont need to ask program about it
if slices.ContainsFunc(program.GetSourceFiles(), func(file *ast.SourceFile) bool {
semanticDiagnostics, ok := p.snapshot.semanticDiagnosticsPerFile.Load(file.Path())
@@ -304,22 +325,10 @@ func (p *Program) ensureHasErrorsForState(ctx context.Context, program *compiler
// cached semantic diagnostics will be encoded in buildInfo
return true
}
- if _, ok := p.snapshot.emitDiagnosticsPerFile.Load(file.Path()); ok {
- // emit diagnostics will be encoded in buildInfo;
- return true
- }
return false
}) {
// Because semantic diagnostics are recorded in buildInfo, we dont need to encode hasErrors in incremental buildInfo
// But encode as errors in non incremental buildInfo
- return core.IfElse(p.snapshot.options.IsIncremental(), core.TSFalse, core.TSTrue)
- }
- if len(program.GetConfigFileParsingDiagnostics()) > 0 ||
- len(program.GetSyntacticDiagnostics(ctx, nil)) > 0 ||
- len(program.GetBindDiagnostics(ctx, nil)) > 0 ||
- len(program.GetOptionsDiagnostics(ctx)) > 0 {
- return core.TSTrue
- } else {
- return core.TSFalse
+ p.snapshot.hasSemanticErrors = !p.snapshot.options.IsIncremental()
}
}
diff --git a/internal/incremental/programtosnapshot.go b/internal/incremental/programtosnapshot.go
index 9c4f78d8f6..6c7c3fc34f 100644
--- a/internal/incremental/programtosnapshot.go
+++ b/internal/incremental/programtosnapshot.go
@@ -61,6 +61,7 @@ func (t *toProgramSnapshot) reuseFromOldProgram() {
})
t.snapshot.buildInfoEmitPending.Store(t.oldProgram.snapshot.buildInfoEmitPending.Load())
t.snapshot.hasErrorsFromOldState = t.oldProgram.snapshot.hasErrors
+ t.snapshot.hasSemanticErrorsFromOldState = t.oldProgram.snapshot.hasSemanticErrors
} else {
t.snapshot.buildInfoEmitPending.Store(t.snapshot.options.IsIncremental())
}
diff --git a/internal/incremental/snapshot.go b/internal/incremental/snapshot.go
index f0808597fc..3db51a7b2c 100644
--- a/internal/incremental/snapshot.go
+++ b/internal/incremental/snapshot.go
@@ -28,6 +28,15 @@ func (f *fileInfo) Signature() string { return f.signature
func (f *fileInfo) AffectsGlobalScope() bool { return f.affectsGlobalScope }
func (f *fileInfo) ImpliedNodeFormat() core.ResolutionMode { return f.impliedNodeFormat }
+func ComputeHash(text string, hashWithText bool) string {
+ hashBytes := xxh3.Hash128([]byte(text)).Bytes()
+ hash := hex.EncodeToString(hashBytes[:])
+ if hashWithText {
+ hash += "-" + text
+ }
+ return hash
+}
+
type FileEmitKind uint32
const (
@@ -201,9 +210,11 @@ type snapshot struct {
latestChangedDtsFile string
// Hash of d.ts emitted for the file, use to track when emit of d.ts changes
emitSignatures collections.SyncMap[tspath.Path, *emitSignature]
- // Recorded if program had errors
+ // Recorded if program had errors that need to be reported even with --noCheck
hasErrors core.Tristate
- // If semantic diagnsotic check is pending
+ // Recorded if program had semantic errors only for non incremental build
+ hasSemanticErrors bool
+ // If semantic diagnostic check is pending
checkPending bool
// Additional fields that are not serialized but needed to track state
@@ -211,6 +222,7 @@ type snapshot struct {
// true if build info emit is pending
buildInfoEmitPending atomic.Bool
hasErrorsFromOldState core.Tristate
+ hasSemanticErrorsFromOldState bool
allFilesExcludingDefaultLibraryFileOnce sync.Once
// Cache of all files excluding default library file for the current program
allFilesExcludingDefaultLibraryFile []*ast.SourceFile
@@ -295,10 +307,5 @@ func diagnosticToStringBuilder(diagnostic *ast.Diagnostic, file *ast.SourceFile,
}
func (s *snapshot) computeHash(text string) string {
- hashBytes := xxh3.Hash128([]byte(text)).Bytes()
- hash := hex.EncodeToString(hashBytes[:])
- if s.hashWithText {
- hash += "-" + text
- }
- return hash
+ return ComputeHash(text, s.hashWithText)
}
diff --git a/internal/incremental/snapshottobuildinfo.go b/internal/incremental/snapshottobuildinfo.go
index dc9ff7eabe..7655a84fc5 100644
--- a/internal/incremental/snapshottobuildinfo.go
+++ b/internal/incremental/snapshottobuildinfo.go
@@ -26,10 +26,14 @@ func snapshotToBuildInfo(snapshot *snapshot, program *compiler.Program, buildInf
},
fileNameToFileId: make(map[string]BuildInfoFileId),
fileNamesToFileIdListId: make(map[string]BuildInfoFileIdListId),
+ roots: make(map[*ast.SourceFile]tspath.Path),
}
+
to.buildInfo.Version = core.Version()
if snapshot.options.IsIncremental() {
+ to.collectRootFiles()
to.setFileInfoAndEmitSignatures()
+ to.setRootOfIncrementalProgram()
to.setCompilerOptions()
to.setReferencedMap()
to.setChangeFileSet()
@@ -39,13 +43,11 @@ func snapshotToBuildInfo(snapshot *snapshot, program *compiler.Program, buildInf
if snapshot.latestChangedDtsFile != "" {
to.buildInfo.LatestChangedDtsFile = to.relativeToBuildInfo(snapshot.latestChangedDtsFile)
}
+ } else {
+ to.setRootOfNonIncrementalProgram()
}
- // else {
- // const buildInfo: NonIncrementalBuildInfo = {
- // root: arrayFrom(rootFileNames, r => relativeToBuildInfo(r)),
- // };
- // }
to.buildInfo.Errors = snapshot.hasErrors.IsTrue()
+ to.buildInfo.SemanticErrors = snapshot.hasSemanticErrors
to.buildInfo.CheckPending = snapshot.checkPending
return &to.buildInfo
}
@@ -58,6 +60,7 @@ type toBuildInfo struct {
comparePathsOptions tspath.ComparePathsOptions
fileNameToFileId map[string]BuildInfoFileId
fileNamesToFileIdListId map[string]BuildInfoFileIdListId
+ roots map[*ast.SourceFile]tspath.Path
}
func (t *toBuildInfo) relativeToBuildInfo(path string) string {
@@ -174,6 +177,20 @@ func (t *toBuildInfo) toBuildInfoDiagnosticsOfFile(filePath tspath.Path, diags *
return nil
}
+func (t *toBuildInfo) collectRootFiles() {
+ for _, fileName := range t.program.GetRootFileNames() {
+ var file *ast.SourceFile
+ if redirect := t.program.GetParseFileRedirect(fileName); redirect != "" {
+ file = t.program.GetSourceFile(redirect)
+ } else {
+ file = t.program.GetSourceFile(fileName)
+ }
+ if file != nil {
+ t.roots[file] = tspath.ToPath(fileName, t.comparePathsOptions.CurrentDirectory, t.comparePathsOptions.UseCaseSensitiveFileNames)
+ }
+ }
+}
+
func (t *toBuildInfo) setFileInfoAndEmitSignatures() {
t.buildInfo.FileInfos = core.Map(t.program.GetSourceFiles(), func(file *ast.SourceFile) *BuildInfoFileInfo {
info, _ := t.snapshot.fileInfos.Load(file.Path())
@@ -210,6 +227,38 @@ func (t *toBuildInfo) setFileInfoAndEmitSignatures() {
})
}
+func (t *toBuildInfo) setRootOfIncrementalProgram() {
+ keys := slices.Collect(maps.Keys(t.roots))
+ slices.SortFunc(keys, func(a, b *ast.SourceFile) int {
+ return int(t.toFileId(a.Path())) - int(t.toFileId(b.Path()))
+ })
+ for _, file := range keys {
+ root := t.toFileId(t.roots[file])
+ resolved := t.toFileId(file.Path())
+ if t.buildInfo.Root == nil {
+ // First fileId as is
+ t.buildInfo.Root = append(t.buildInfo.Root, &BuildInfoRoot{Start: resolved})
+ } else {
+ last := t.buildInfo.Root[len(t.buildInfo.Root)-1]
+ if last.End == resolved-1 {
+ // If its [..., last = [start, end = fileId - 1]], update last to [start, fileId]
+ last.End = resolved
+ } else if last.End == 0 && last.Start == resolved-1 {
+ // If its [..., last = start = fileId - 1 ], update last to [start, fileId]
+ last.End = resolved
+ } else {
+ t.buildInfo.Root = append(t.buildInfo.Root, &BuildInfoRoot{Start: resolved})
+ }
+ }
+ if root != resolved {
+ t.buildInfo.ResolvedRoot = append(t.buildInfo.ResolvedRoot, &BuildInfoResolvedRoot{
+ Resolved: resolved,
+ Root: root,
+ })
+ }
+ }
+}
+
func (t *toBuildInfo) setCompilerOptions() {
tsoptions.ForEachCompilerOptionValue(
t.snapshot.options,
@@ -293,3 +342,11 @@ func (t *toBuildInfo) setAffectedFilesPendingEmit() {
})
}
}
+
+func (t *toBuildInfo) setRootOfNonIncrementalProgram() {
+ t.buildInfo.Root = core.Map(t.program.GetRootFileNames(), func(fileName string) *BuildInfoRoot {
+ return &BuildInfoRoot{
+ NonIncremental: t.relativeToBuildInfo(string(tspath.ToPath(fileName, t.comparePathsOptions.CurrentDirectory, t.comparePathsOptions.UseCaseSensitiveFileNames))),
+ }
+ })
+}
diff --git a/internal/module/resolver.go b/internal/module/resolver.go
index 815c3ad62b..780f0deb67 100644
--- a/internal/module/resolver.go
+++ b/internal/module/resolver.go
@@ -4,6 +4,7 @@ import (
"fmt"
"slices"
"strings"
+ "sync"
"github.com/microsoft/typescript-go/internal/ast"
"github.com/microsoft/typescript-go/internal/collections"
@@ -77,6 +78,12 @@ type resolutionState struct {
failedLookupLocations []string
affectingLocations []string
diagnostics []*ast.Diagnostic
+
+ // Similar to whats on resolver but only done if compilerOptions are for project reference redirect
+ // Cached representation for `core.CompilerOptions.paths`.
+ // Doesn't handle other path patterns like in `typesVersions`.
+ parsedPatternsForPathsOnce sync.Once
+ parsedPatternsForPaths *ParsedPatterns
}
func newResolutionState(
@@ -1117,6 +1124,16 @@ func (r *resolutionState) tryLoadModuleUsingOptionalResolutionSettings() *resolv
}
}
+func (r *resolutionState) getParsedPatternsForPaths() *ParsedPatterns {
+ if r.compilerOptions == r.resolver.compilerOptions {
+ return r.resolver.getParsedPatternsForPaths()
+ }
+ r.parsedPatternsForPathsOnce.Do(func() {
+ r.parsedPatternsForPaths = TryParsePatterns(r.compilerOptions.Paths)
+ })
+ return r.parsedPatternsForPaths
+}
+
func (r *resolutionState) tryLoadModuleUsingPathsIfEligible() *resolved {
if r.compilerOptions.Paths.Size() > 0 && !tspath.PathIsRelative(r.name) {
if r.tracer != nil {
@@ -1126,7 +1143,7 @@ func (r *resolutionState) tryLoadModuleUsingPathsIfEligible() *resolved {
return continueSearching()
}
baseDirectory := r.compilerOptions.GetPathsBasePath(r.resolver.host.GetCurrentDirectory())
- pathPatterns := r.resolver.getParsedPatternsForPaths()
+ pathPatterns := r.getParsedPatternsForPaths()
return r.tryLoadModuleUsingPaths(
r.extensions,
r.name,
diff --git a/internal/outputpaths/outputpaths.go b/internal/outputpaths/outputpaths.go
index a075cd481d..097a7ccc2c 100644
--- a/internal/outputpaths/outputpaths.go
+++ b/internal/outputpaths/outputpaths.go
@@ -53,7 +53,7 @@ func GetOutputPathsFor(sourceFile *ast.SourceFile, options *core.CompilerOptions
if options.EmitDeclarationOnly != core.TSTrue && !isJsonEmittedToSameLocation {
paths.jsFilePath = ownOutputFilePath
if !ast.IsJsonSourceFile(sourceFile) {
- paths.sourceMapFilePath = getSourceMapFilePath(paths.jsFilePath, options)
+ paths.sourceMapFilePath = GetSourceMapFilePath(paths.jsFilePath, options)
}
}
if forceDtsEmit || options.GetEmitDeclarations() && !isJsonFile {
@@ -74,6 +74,21 @@ func ForEachEmittedFile(host OutputPathsHost, options *core.CompilerOptions, act
return false
}
+func GetOutputJSFileName(inputFileName string, options *core.CompilerOptions, host OutputPathsHost) string {
+ if options.EmitDeclarationOnly.IsTrue() {
+ return ""
+ }
+ outputFileName := GetOutputJSFileNameWorker(inputFileName, options, host)
+ if !tspath.FileExtensionIs(outputFileName, tspath.ExtensionJson) ||
+ tspath.ComparePaths(inputFileName, outputFileName, tspath.ComparePathsOptions{
+ CurrentDirectory: host.GetCurrentDirectory(),
+ UseCaseSensitiveFileNames: host.UseCaseSensitiveFileNames(),
+ }) != 0 {
+ return outputFileName
+ }
+ return ""
+}
+
func GetOutputJSFileNameWorker(inputFileName string, options *core.CompilerOptions, host OutputPathsHost) string {
return tspath.ChangeExtension(
getOutputPathWithoutChangingExtension(inputFileName, options.OutDir, host),
@@ -176,7 +191,7 @@ func getOwnEmitOutputFilePath(fileName string, options *core.CompilerOptions, ho
return emitOutputFilePathWithoutExtension + extension
}
-func getSourceMapFilePath(jsFilePath string, options *core.CompilerOptions) string {
+func GetSourceMapFilePath(jsFilePath string, options *core.CompilerOptions) string {
if options.SourceMap.IsTrue() && !options.InlineSourceMap.IsTrue() {
return jsFilePath + ".map"
}
@@ -195,7 +210,7 @@ func getDeclarationEmitExtensionForPath(fileName string) string {
}
func GetBuildInfoFileName(options *core.CompilerOptions, opts tspath.ComparePathsOptions) string {
- if !options.IsIncremental() && !options.TscBuild.IsTrue() {
+ if !options.IsIncremental() && !options.Build.IsTrue() {
return ""
}
if options.TsBuildInfoFile != "" {
diff --git a/internal/parser/parser.go b/internal/parser/parser.go
index 9ff64a05a8..1bf58ad3fb 100644
--- a/internal/parser/parser.go
+++ b/internal/parser/parser.go
@@ -6379,7 +6379,7 @@ func (p *Parser) processPragmasIntoFields(context *ast.SourceFile) {
case typesOk:
var parsed core.ResolutionMode
if resolutionModeOk {
- parsed = parseResolutionMode(resolutionMode.Value, types.Pos(), types.End() /*, reportDiagnostic*/)
+ parsed = parseResolutionMode(resolutionMode.Value, resolutionMode.Pos(), resolutionMode.End() /*, reportDiagnostic*/)
}
context.TypeReferenceDirectives = append(context.TypeReferenceDirectives, &ast.FileReference{
TextRange: types.TextRange,
@@ -6389,13 +6389,13 @@ func (p *Parser) processPragmasIntoFields(context *ast.SourceFile) {
})
case libOk:
context.LibReferenceDirectives = append(context.LibReferenceDirectives, &ast.FileReference{
- TextRange: types.TextRange,
+ TextRange: lib.TextRange,
FileName: lib.Value,
Preserve: preserveOk && preserve.Value == "true",
})
case pathOk:
context.ReferencedFiles = append(context.ReferencedFiles, &ast.FileReference{
- TextRange: types.TextRange,
+ TextRange: path.TextRange,
FileName: path.Value,
Preserve: preserveOk && preserve.Value == "true",
})
diff --git a/internal/testutil/harnessutil/harnessutil.go b/internal/testutil/harnessutil/harnessutil.go
index b885996dea..772eb169c0 100644
--- a/internal/testutil/harnessutil/harnessutil.go
+++ b/internal/testutil/harnessutil/harnessutil.go
@@ -3,6 +3,7 @@ package harnessutil
import (
"context"
"fmt"
+ "io"
"io/fs"
"maps"
"os"
@@ -530,10 +531,14 @@ func NewTracerForBaselining(opts tspath.ComparePathsOptions, builder *strings.Bu
}
func (t *TracerForBaselining) Trace(msg string) {
- fmt.Fprintln(t.builder, t.sanitizeTrace(msg))
+ t.TraceWithWriter(t.builder, msg, true)
}
-func (t *TracerForBaselining) sanitizeTrace(msg string) string {
+func (t *TracerForBaselining) TraceWithWriter(w io.Writer, msg string, usePackageJsonCache bool) {
+ fmt.Fprintln(w, t.sanitizeTrace(msg, usePackageJsonCache))
+}
+
+func (t *TracerForBaselining) sanitizeTrace(msg string, usePackageJsonCache bool) string {
// Version
if str := strings.Replace(msg, "'"+core.Version()+"'", "'"+FakeTSVersion+"'", 1); str != msg {
return str
@@ -541,42 +546,48 @@ func (t *TracerForBaselining) sanitizeTrace(msg string) string {
// caching of fs in trace to be replaces with non caching version
if str := strings.TrimSuffix(msg, "' does not exist according to earlier cached lookups."); str != msg {
file := strings.TrimPrefix(str, "File '")
- filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
- if _, has := t.packageJsonCache[filePath]; has {
- return msg
- } else {
- t.packageJsonCache[filePath] = false
- return fmt.Sprintf("File '%s' does not exist.", file)
- }
- }
- if str := strings.TrimSuffix(msg, "' does not exist."); str != msg {
- file := strings.TrimPrefix(str, "File '")
- filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
- if _, has := t.packageJsonCache[filePath]; !has {
- t.packageJsonCache[filePath] = false
- return msg
- } else {
- return fmt.Sprintf("File '%s' does not exist according to earlier cached lookups.", file)
+ if usePackageJsonCache {
+ filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
+ if _, has := t.packageJsonCache[filePath]; has {
+ return msg
+ } else {
+ t.packageJsonCache[filePath] = false
+ }
}
+ return fmt.Sprintf("File '%s' does not exist.", file)
}
if str := strings.TrimSuffix(msg, "' exists according to earlier cached lookups."); str != msg {
file := strings.TrimPrefix(str, "File '")
- filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
- if _, has := t.packageJsonCache[filePath]; has {
- return msg
- } else {
- t.packageJsonCache[filePath] = true
- return fmt.Sprintf("Found 'package.json' at '%s'.", file)
+ if usePackageJsonCache {
+ filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
+ if _, has := t.packageJsonCache[filePath]; has {
+ return msg
+ } else {
+ t.packageJsonCache[filePath] = true
+ }
}
- }
- if str := strings.TrimPrefix(msg, "Found 'package.json' at '"); str != msg {
- file := strings.TrimSuffix(str, "'.")
- filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
- if _, has := t.packageJsonCache[filePath]; !has {
- t.packageJsonCache[filePath] = true
- return msg
- } else {
- return fmt.Sprintf("File '%s' exists according to earlier cached lookups.", file)
+ return fmt.Sprintf("Found 'package.json' at '%s'.", file)
+ }
+ if usePackageJsonCache {
+ if str := strings.TrimSuffix(msg, "' does not exist."); str != msg {
+ file := strings.TrimPrefix(str, "File '")
+ filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
+ if _, has := t.packageJsonCache[filePath]; !has {
+ t.packageJsonCache[filePath] = false
+ return msg
+ } else {
+ return fmt.Sprintf("File '%s' does not exist according to earlier cached lookups.", file)
+ }
+ }
+ if str := strings.TrimPrefix(msg, "Found 'package.json' at '"); str != msg {
+ file := strings.TrimSuffix(str, "'.")
+ filePath := tspath.ToPath(file, t.opts.CurrentDirectory, t.opts.UseCaseSensitiveFileNames)
+ if _, has := t.packageJsonCache[filePath]; !has {
+ t.packageJsonCache[filePath] = true
+ return msg
+ } else {
+ return fmt.Sprintf("File '%s' exists according to earlier cached lookups.", file)
+ }
}
}
return msg
diff --git a/internal/testutil/incrementaltestutil/readablebuildinfo.go b/internal/testutil/incrementaltestutil/readablebuildinfo.go
index dbfa965087..199b81068a 100644
--- a/internal/testutil/incrementaltestutil/readablebuildinfo.go
+++ b/internal/testutil/incrementaltestutil/readablebuildinfo.go
@@ -17,9 +17,9 @@ type readableBuildInfo struct {
Version string `json:"version,omitzero"`
// Common between incremental and tsc -b buildinfo for non incremental programs
- Errors bool `json:"errors,omitzero"`
- CheckPending bool `json:"checkPending,omitzero"`
- // Root []BuildInfoRoot `json:"root,omitzero"`
+ Errors bool `json:"errors,omitzero"`
+ CheckPending bool `json:"checkPending,omitzero"`
+ Root []*readableBuildInfoRoot `json:"root,omitzero"`
// IncrementalProgram info
FileNames []string `json:"fileNames,omitzero"`
@@ -33,8 +33,16 @@ type readableBuildInfo struct {
AffectedFilesPendingEmit []*readableBuildInfoFilePendingEmit `json:"affectedFilesPendingEmit,omitzero"`
LatestChangedDtsFile string `json:"latestChangedDtsFile,omitzero"` // Because this is only output file in the program, we dont need fileId to deduplicate name
EmitSignatures []*readableBuildInfoEmitSignature `json:"emitSignatures,omitzero"`
- // resolvedRoot: readonly IncrementalBuildInfoResolvedRoot[] | undefined;
- Size int `json:"size,omitzero"` // Size of the build info file
+ ResolvedRoot []*readableBuildInfoResolvedRoot `json:"resolvedRoot,omitzero"`
+ Size int `json:"size,omitzero"` // Size of the build info file
+
+ // NonIncrementalProgram info
+ SemanticErrors bool `json:"semanticErrors,omitzero"`
+}
+
+type readableBuildInfoRoot struct {
+ Files []string `json:"files,omitzero"`
+ Original *incremental.BuildInfoRoot `json:"original,omitzero"`
}
type readableBuildInfoFileInfo struct {
@@ -174,6 +182,27 @@ type readableBuildInfoEmitSignature struct {
Original *incremental.BuildInfoEmitSignature `json:"original,omitzero"`
}
+type readableBuildInfoResolvedRoot struct {
+ Resolved string
+ Root string
+}
+
+func (b *readableBuildInfoResolvedRoot) MarshalJSON() ([]byte, error) {
+ return json.Marshal([2]string{b.Resolved, b.Root})
+}
+
+func (b *readableBuildInfoResolvedRoot) UnmarshalJSON(data []byte) error {
+ var resolvedAndRoot *[2]string
+ if err := json.Unmarshal(data, &resolvedAndRoot); err == nil {
+ *b = readableBuildInfoResolvedRoot{
+ Resolved: resolvedAndRoot[0],
+ Root: resolvedAndRoot[1],
+ }
+ return nil
+ }
+ return fmt.Errorf("invalid BuildInfoResolvedRoot: %s", data)
+}
+
func toReadableBuildInfo(buildInfo *incremental.BuildInfo, buildInfoText string) string {
readable := readableBuildInfo{
buildInfo: buildInfo,
@@ -183,9 +212,11 @@ func toReadableBuildInfo(buildInfo *incremental.BuildInfo, buildInfoText string)
FileNames: buildInfo.FileNames,
Options: buildInfo.Options,
LatestChangedDtsFile: buildInfo.LatestChangedDtsFile,
+ SemanticErrors: buildInfo.SemanticErrors,
Size: len(buildInfoText),
}
readable.setFileInfos()
+ readable.setRoot()
readable.setFileIdsList()
readable.setReferencedMap()
readable.setChangeFileSet()
@@ -193,6 +224,7 @@ func toReadableBuildInfo(buildInfo *incremental.BuildInfo, buildInfoText string)
readable.setEmitDiagnostics()
readable.setAffectedFilesPendingEmit()
readable.setEmitSignatures()
+ readable.setResolvedRoot()
contents, err := jsonutil.MarshalIndent(&readable, "", " ")
if err != nil {
panic("readableBuildInfo: failed to marshal readable build info: " + err.Error())
@@ -256,6 +288,26 @@ func (r *readableBuildInfo) setFileInfos() {
})
}
+func (r *readableBuildInfo) setRoot() {
+ r.Root = core.Map(r.buildInfo.Root, func(original *incremental.BuildInfoRoot) *readableBuildInfoRoot {
+ var files []string
+ if original.NonIncremental != "" {
+ files = []string{original.NonIncremental}
+ } else if original.End == 0 {
+ files = []string{r.toFilePath(original.Start)}
+ } else {
+ files = make([]string, 0, original.End-original.Start+1)
+ for i := original.Start; i <= original.End; i++ {
+ files = append(files, r.toFilePath(i))
+ }
+ }
+ return &readableBuildInfoRoot{
+ Files: files,
+ Original: original,
+ }
+ })
+}
+
func (r *readableBuildInfo) setFileIdsList() {
r.FileIdsList = core.Map(r.buildInfo.FileIdsList, func(ids []incremental.BuildInfoFileId) []string {
return core.Map(ids, r.toFilePath)
@@ -358,3 +410,12 @@ func (r *readableBuildInfo) setEmitSignatures() {
}
})
}
+
+func (r *readableBuildInfo) setResolvedRoot() {
+ r.ResolvedRoot = core.Map(r.buildInfo.ResolvedRoot, func(original *incremental.BuildInfoResolvedRoot) *readableBuildInfoResolvedRoot {
+ return &readableBuildInfoResolvedRoot{
+ Resolved: r.toFilePath(original.Resolved),
+ Root: r.toFilePath(original.Root),
+ }
+ })
+}
diff --git a/internal/tsoptions/commandlineoption.go b/internal/tsoptions/commandlineoption.go
index 35b7541031..6377c316c3 100644
--- a/internal/tsoptions/commandlineoption.go
+++ b/internal/tsoptions/commandlineoption.go
@@ -166,7 +166,7 @@ var commandLineOptionElements = map[string]*CommandLineOption{
// CommandLineOption.EnumMap()
var commandLineOptionEnumMap = map[string]*collections.OrderedMap[string, any]{
- "lib": libMap,
+ "lib": LibMap,
"moduleResolution": moduleResolutionOptionMap,
"module": moduleOptionMap,
"target": targetOptionMap,
diff --git a/internal/tsoptions/commandlineparser.go b/internal/tsoptions/commandlineparser.go
index 0d8d237f55..1eb2691a08 100644
--- a/internal/tsoptions/commandlineparser.go
+++ b/internal/tsoptions/commandlineparser.go
@@ -67,6 +67,56 @@ func ParseCommandLine(
}
}
+func ParseBuildCommandLine(
+ commandLine []string,
+ host ParseConfigHost,
+) *ParsedBuildCommandLine {
+ if commandLine == nil {
+ commandLine = []string{}
+ }
+ parser := parseCommandLineWorker(buildOptionsDidYouMeanDiagnostics, commandLine, host.FS())
+ compilerOptions := &core.CompilerOptions{}
+ for key, value := range parser.options.Entries() {
+ buildOption := BuildNameMap.Get(key)
+ if buildOption == &TscBuildOption || buildOption == CompilerNameMap.Get(key) {
+ ParseCompilerOptions(key, value, compilerOptions)
+ }
+ }
+ result := &ParsedBuildCommandLine{
+ BuildOptions: convertMapToOptions(parser.options, &buildOptionsParser{&core.BuildOptions{}}).BuildOptions,
+ CompilerOptions: compilerOptions,
+ WatchOptions: convertMapToOptions(parser.options, &watchOptionsParser{&core.WatchOptions{}}).WatchOptions,
+ Projects: parser.fileNames,
+ Errors: parser.errors,
+
+ comparePathsOptions: tspath.ComparePathsOptions{
+ UseCaseSensitiveFileNames: host.FS().UseCaseSensitiveFileNames(),
+ CurrentDirectory: host.GetCurrentDirectory(),
+ },
+ }
+
+ if len(result.Projects) == 0 {
+ // tsc -b invoked with no extra arguments; act as if invoked with "tsc -b ."
+ result.Projects = append(result.Projects, ".")
+ }
+
+ // Nonsensical combinations
+ if result.BuildOptions.Clean.IsTrue() && result.BuildOptions.Force.IsTrue() {
+ result.Errors = append(result.Errors, ast.NewCompilerDiagnostic(diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force"))
+ }
+ if result.BuildOptions.Clean.IsTrue() && result.BuildOptions.Verbose.IsTrue() {
+ result.Errors = append(result.Errors, ast.NewCompilerDiagnostic(diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose"))
+ }
+ if result.BuildOptions.Clean.IsTrue() && result.CompilerOptions.Watch.IsTrue() {
+ result.Errors = append(result.Errors, ast.NewCompilerDiagnostic(diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch"))
+ }
+ if result.CompilerOptions.Watch.IsTrue() && result.BuildOptions.Dry.IsTrue() {
+ result.Errors = append(result.Errors, ast.NewCompilerDiagnostic(diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry"))
+ }
+
+ return result
+}
+
func parseCommandLineWorker(
parseCommandLineWithDiagnostics *ParseCommandLineWorkerDiagnostics,
commandLine []string,
@@ -116,7 +166,7 @@ func (p *commandLineParser) parseStrings(args []string) {
func getInputOptionName(input string) string {
// removes at most two leading '-' from the input string
- return strings.ToLower(strings.TrimPrefix(strings.TrimPrefix(input, "-"), "-"))
+ return strings.TrimPrefix(strings.TrimPrefix(input, "-"), "-")
}
func (p *commandLineParser) parseResponseFile(fileName string) {
diff --git a/internal/tsoptions/commandlineparser_test.go b/internal/tsoptions/commandlineparser_test.go
index fcd1e780c3..9caf562d17 100644
--- a/internal/tsoptions/commandlineparser_test.go
+++ b/internal/tsoptions/commandlineparser_test.go
@@ -15,6 +15,8 @@ import (
"github.com/microsoft/typescript-go/internal/testutil/baseline"
"github.com/microsoft/typescript-go/internal/testutil/filefixture"
"github.com/microsoft/typescript-go/internal/tsoptions"
+ "github.com/microsoft/typescript-go/internal/tsoptions/tsoptionstest"
+ "github.com/microsoft/typescript-go/internal/tspath"
"github.com/microsoft/typescript-go/internal/vfs/osvfs"
"gotest.tools/v3/assert"
)
@@ -80,7 +82,7 @@ func TestCommandLineParseResult(t *testing.T) {
}
for _, testCase := range parseCommandLineSubScenarios {
- testCase.createSubScenario().assertParseResult(t)
+ testCase.createSubScenario("parseCommandLine").assertParseResult(t)
}
}
@@ -89,7 +91,7 @@ func TestParseCommandLineVerifyNull(t *testing.T) {
repo.SkipIfNoTypeScriptSubmodule(t)
// run test for boolean
- subScenarioInput{"allows setting option type boolean to false", []string{"--composite", "false", "0.ts"}}.createSubScenario().assertParseResult(t)
+ subScenarioInput{"allows setting option type boolean to false", []string{"--composite", "false", "0.ts"}}.createSubScenario("parseCommandLine").assertParseResult(t)
verifyNullSubScenarios := []verifyNull{
{
@@ -114,6 +116,7 @@ func TestParseCommandLineVerifyNull(t *testing.T) {
for _, verifyNullCase := range verifyNullSubScenarios {
createSubScenario(
+ "parseCommandLine",
verifyNullCase.subScenario+" allows setting it to null",
[]string{"--" + verifyNullCase.optionName, "null", "0.ts"},
verifyNullCase.optDecls,
@@ -121,6 +124,7 @@ func TestParseCommandLineVerifyNull(t *testing.T) {
if verifyNullCase.nonNullValue != "" {
createSubScenario(
+ "parseCommandLine",
verifyNullCase.subScenario+" errors if non null value is passed",
[]string{"--" + verifyNullCase.optionName, verifyNullCase.nonNullValue, "0.ts"},
verifyNullCase.optDecls,
@@ -128,12 +132,14 @@ func TestParseCommandLineVerifyNull(t *testing.T) {
}
createSubScenario(
+ "parseCommandLine",
verifyNullCase.subScenario+" errors if its followed by another option",
[]string{"0.ts", "--strictNullChecks", "--" + verifyNullCase.optionName},
verifyNullCase.optDecls,
).assertParseResult(t)
createSubScenario(
+ "parseCommandLine",
verifyNullCase.subScenario+" errors if its last option",
[]string{"0.ts", "--" + verifyNullCase.optionName},
verifyNullCase.optDecls,
@@ -195,10 +201,6 @@ func (f commandLineSubScenario) assertParseResult(t *testing.T) {
})
}
-func (f *commandLineSubScenario) getBaselineName() (baseline.Options, string) {
- return baseline.Options{Subfolder: "tsoptions/commandLineParsing"}, f.testName
-}
-
func parseExistingCompilerBaseline(t *testing.T, baseline string) *TestCommandLineParser {
_, rest, _ := strings.Cut(baseline, "CompilerOptions::\n")
compilerOptions, rest, watchFound := strings.Cut(rest, "\nWatchOptions::\n")
@@ -243,27 +245,112 @@ func formatNewBaseline(
return formatted.String()
}
-// todo: --build not implemented
-// func parseExistingBuildBaseline(baseline string) *TestCommandLineParser {
-// _, rest, _ := strings.Cut(baseline, "BuildOptions::\n")
-// buildOptions, rest, _ := strings.Cut(rest, "\nWatchOptions::\n")
-// _, rest, _ = strings.Cut(rest, "\nProjects::\n")
-// fileNames, errors, _ := strings.Cut(rest, "\nErrors::\n")
+func (f commandLineSubScenario) assertBuildParseResult(t *testing.T) {
+ t.Helper()
+ t.Run(f.testName, func(t *testing.T) {
+ t.Parallel()
+ originalBaseline := f.baseline.ReadFile(t)
+ tsBaseline := parseExistingCompilerBaselineBuild(t, originalBaseline)
+
+ // f.workerDiagnostic is either defined or set to default pointer in `createSubScenario`
+ parsed := tsoptions.ParseBuildCommandLine(f.commandLine, &tsoptionstest.VfsParseConfigHost{
+ Vfs: osvfs.FS(),
+ CurrentDirectory: tspath.NormalizeSlashes(repo.TypeScriptSubmodulePath),
+ })
+
+ newBaselineProjects := strings.Join(parsed.Projects, ",")
+ assert.Equal(t, tsBaseline.projects, newBaselineProjects)
+
+ o, _ := json.Marshal(parsed.BuildOptions)
+ newParsedBuildOptions := &core.BuildOptions{}
+ e := json.Unmarshal(o, newParsedBuildOptions)
+ assert.NilError(t, e)
+ assert.DeepEqual(t, tsBaseline.options, newParsedBuildOptions, cmpopts.IgnoreUnexported(core.BuildOptions{}))
+
+ compilerOpts, _ := json.Marshal(parsed.CompilerOptions)
+ newParsedCompilerOptions := &core.CompilerOptions{}
+ e = json.Unmarshal(compilerOpts, newParsedCompilerOptions)
+ assert.NilError(t, e)
+ assert.DeepEqual(t, tsBaseline.compilerOptions, newParsedCompilerOptions, cmpopts.IgnoreUnexported(core.CompilerOptions{}))
+
+ newParsedWatchOptions := core.WatchOptions{}
+ e = json.Unmarshal(o, &newParsedWatchOptions)
+ assert.NilError(t, e)
+
+ // !!! useful for debugging but will not pass due to `none` as enum options
+ // assert.DeepEqual(t, tsBaseline.watchoptions, newParsedWatchOptions)
+
+ var formattedErrors strings.Builder
+ diagnosticwriter.WriteFormatDiagnostics(&formattedErrors, parsed.Errors, &diagnosticwriter.FormattingOptions{NewLine: "\n"})
+ newBaselineErrors := formattedErrors.String()
+
+ // !!!
+ // useful for debugging--compares the new errors with the old errors. currently will NOT pass because of unimplemented options, not completely identical enum options, etc
+ // assert.Equal(t, tsBaseline.errors, newBaselineErrors)
+
+ baseline.Run(t, f.testName+".js", formatNewBaselineBuild(f.commandLine, o, compilerOpts, newBaselineProjects, newBaselineErrors), baseline.Options{Subfolder: "tsoptions/commandLineParsing"})
+ })
+}
+
+func parseExistingCompilerBaselineBuild(t *testing.T, baseline string) *TestCommandLineParserBuild {
+ _, rest, _ := strings.Cut(baseline, "buildOptions::\n")
+ buildOptions, rest, watchFound := strings.Cut(rest, "\nWatchOptions::\n")
+ watchOptions, rest, _ := strings.Cut(rest, "\nProjects::\n")
+ projects, errors, _ := strings.Cut(rest, "\nErrors::\n")
+
+ baselineBuildOptions := &core.BuildOptions{}
+ e := json.Unmarshal([]byte(buildOptions), &baselineBuildOptions)
+ assert.NilError(t, e)
+
+ baselineCompilerOptions := &core.CompilerOptions{}
+ e = json.Unmarshal([]byte(buildOptions), &baselineCompilerOptions)
+ assert.NilError(t, e)
-// // todo: change CompilerOptions to buildoptions
-// baselineOptions := &core.CompilerOptions{}
-// json.Unmarshal([]byte(buildOptions), &baselineOptions)
+ baselineWatchOptions := &core.WatchOptions{}
+ if watchFound && watchOptions != "" {
+ e2 := json.Unmarshal([]byte(watchOptions), &baselineWatchOptions)
+ assert.NilError(t, e2)
+ }
+
+ return &TestCommandLineParserBuild{
+ options: baselineBuildOptions,
+ compilerOptions: baselineCompilerOptions,
+ watchoptions: baselineWatchOptions,
+ projects: projects,
+ errors: errors,
+ }
+}
-// var parser = TestCommandLineParser{
-// options: *baselineOptions,
-// fileNames: fileNames,
-// errors: errors,
-// }
-// return &parser
-// }
+func formatNewBaselineBuild(
+ commandLine []string,
+ opts []byte,
+ compilerOpts []byte,
+ projects string,
+ errors string,
+) string {
+ var formatted strings.Builder
+ formatted.WriteString("Args::\n")
+ if len(commandLine) == 0 {
+ formatted.WriteString("[]")
+ } else {
+ formatted.WriteString("[\"" + strings.Join(commandLine, "\", \"") + "\"]")
+ }
+ formatted.WriteString("\n\nbuildOptions::\n")
+ formatted.Write(opts)
+ formatted.WriteString("\n\ncompilerOptions::\n")
+ formatted.Write(compilerOpts)
+ // todo: watch options not implemented
+ // formatted.WriteString("WatchOptions::\n")
+ formatted.WriteString("\n\nProjects::\n")
+ formatted.WriteString(projects)
+ formatted.WriteString("\n\nErrors::\n")
+ formatted.WriteString(errors)
+ return formatted.String()
+}
-func createSubScenario(subScenarioName string, commandline []string, opts ...[]*tsoptions.CommandLineOption) *commandLineSubScenario {
- baselineFileName := "tests/baselines/reference/config/commandLineParsing/parseCommandLine/" + subScenarioName + ".js"
+func createSubScenario(scenarioKind string, subScenarioName string, commandline []string, opts ...[]*tsoptions.CommandLineOption) *commandLineSubScenario {
+ subScenarioName = scenarioKind + "/" + subScenarioName
+ baselineFileName := "tests/baselines/reference/config/commandLineParsing/" + subScenarioName + ".js"
result := &commandLineSubScenario{
filefixture.FromFile(subScenarioName, filepath.Join(repo.TypeScriptSubmodulePath, baselineFileName)),
@@ -282,8 +369,8 @@ type subScenarioInput struct {
commandLineArgs []string
}
-func (f subScenarioInput) createSubScenario() *commandLineSubScenario {
- return createSubScenario(f.name, f.commandLineArgs)
+func (f subScenarioInput) createSubScenario(scenarioKind string) *commandLineSubScenario {
+ return createSubScenario(scenarioKind, f.name, f.commandLineArgs)
}
type commandLineSubScenario struct {
@@ -306,6 +393,47 @@ type TestCommandLineParser struct {
fileNames, errors string
}
+type TestCommandLineParserBuild struct {
+ options *core.BuildOptions
+ compilerOptions *core.CompilerOptions
+ watchoptions *core.WatchOptions
+ projects, errors string
+}
+
+func TestParseBuildCommandLine(t *testing.T) {
+ t.Parallel()
+ repo.SkipIfNoTypeScriptSubmodule(t)
+
+ parseCommandLineSubScenarios := []*subScenarioInput{
+ {"parse build without any options ", []string{}},
+ {"Parse multiple options", []string{"--verbose", "--force", "tests"}},
+ {"Parse option with invalid option", []string{"--verbose", "--invalidOption"}},
+ {"Parse multiple flags with input projects at the end", []string{"--force", "--verbose", "src", "tests"}},
+ {"Parse multiple flags with input projects in the middle", []string{"--force", "src", "tests", "--verbose"}},
+ {"Parse multiple flags with input projects in the beginning", []string{"src", "tests", "--force", "--verbose"}},
+ {"parse build with --incremental", []string{"--incremental", "tests"}},
+ {"parse build with --locale en-us", []string{"--locale", "en-us", "src"}},
+ {"parse build with --tsBuildInfoFile", []string{"--tsBuildInfoFile", "build.tsbuildinfo", "tests"}},
+ {"reports other common may not be used with --build flags", []string{"--strict"}},
+ {`--clean and --force together is invalid`, []string{"--clean", "--force"}},
+ {`--clean and --verbose together is invalid`, []string{"--clean", "--verbose"}},
+ {`--clean and --watch together is invalid`, []string{"--clean", "--watch"}},
+ {`--watch and --dry together is invalid`, []string{"--watch", "--dry"}},
+ {"parse --watchFile", []string{"--watchFile", "UseFsEvents", "--verbose"}},
+ {"parse --watchDirectory", []string{"--watchDirectory", "FixedPollingInterval", "--verbose"}},
+ {"parse --fallbackPolling", []string{"--fallbackPolling", "PriorityInterval", "--verbose"}},
+ {"parse --synchronousWatchDirectory", []string{"--synchronousWatchDirectory", "--verbose"}},
+ {"errors on missing argument", []string{"--verbose", "--fallbackPolling"}},
+ {"errors on invalid excludeDirectories", []string{"--excludeDirectories", "**/../*"}},
+ {"parse --excludeFiles", []string{"--excludeFiles", "**/temp/*.ts"}},
+ {"errors on invalid excludeFiles", []string{"--excludeFiles", "**/../*"}},
+ }
+
+ for _, testCase := range parseCommandLineSubScenarios {
+ testCase.createSubScenario("parseBuildOptions").assertBuildParseResult(t)
+ }
+}
+
func TestAffectsBuildInfo(t *testing.T) {
t.Parallel()
t.Run("should have affectsBuildInfo true for every option with affectsSemanticDiagnostics", func(t *testing.T) {
diff --git a/internal/tsoptions/decls_test.go b/internal/tsoptions/decls_test.go
index 38ef65a8d3..221cc027ce 100644
--- a/internal/tsoptions/decls_test.go
+++ b/internal/tsoptions/decls_test.go
@@ -26,7 +26,7 @@ func TestCompilerOptionsDeclaration(t *testing.T) {
"noEmitForJsFiles",
"pathsBasePath",
"suppressOutputPathCheck",
- "tscBuild",
+ "build",
}
internalOptionsMap := make(map[string]string)
diff --git a/internal/tsoptions/declscompiler.go b/internal/tsoptions/declscompiler.go
index 11b6335ea1..6480c57079 100644
--- a/internal/tsoptions/declscompiler.go
+++ b/internal/tsoptions/declscompiler.go
@@ -10,7 +10,7 @@ import (
var OptionsDeclarations = slices.Concat(commonOptionsWithBuild, optionsForCompiler)
-var optionsForCompiler = []*CommandLineOption{
+var commonOptionsWithBuild = []*CommandLineOption{
//******* commandOptionsWithoutBuild *******
{
Name: "help",
@@ -235,7 +235,7 @@ var optionsForCompiler = []*CommandLineOption{
},
}
-var commonOptionsWithBuild = []*CommandLineOption{
+var optionsForCompiler = []*CommandLineOption{
//******* commandOptionsWithoutBuild *******
// CommandLine only options
diff --git a/internal/tsoptions/enummaps.go b/internal/tsoptions/enummaps.go
index 297081deaa..89a9ba9bfd 100644
--- a/internal/tsoptions/enummaps.go
+++ b/internal/tsoptions/enummaps.go
@@ -8,7 +8,7 @@ import (
"github.com/microsoft/typescript-go/internal/tspath"
)
-var libMap = collections.NewOrderedMapFromList([]collections.MapEntry[string, any]{
+var LibMap = collections.NewOrderedMapFromList([]collections.MapEntry[string, any]{
// JavaScript only
{Key: "es5", Value: "lib.es5.d.ts"},
{Key: "es6", Value: "lib.es2015.d.ts"},
@@ -113,8 +113,8 @@ var libMap = collections.NewOrderedMapFromList([]collections.MapEntry[string, an
})
var (
- Libs = slices.Collect(libMap.Keys())
- LibFilesSet = collections.NewSetFromItems(core.Map(slices.Collect(libMap.Values()), func(s any) string { return s.(string) })...)
+ Libs = slices.Collect(LibMap.Keys())
+ LibFilesSet = collections.NewSetFromItems(core.Map(slices.Collect(LibMap.Values()), func(s any) string { return s.(string) })...)
)
func GetLibFileName(libName string) (string, bool) {
@@ -123,7 +123,7 @@ func GetLibFileName(libName string) (string, bool) {
if LibFilesSet.Has(libName) {
return libName, true
}
- lib, ok := libMap.Get(libName)
+ lib, ok := LibMap.Get(libName)
if !ok {
return "", false
}
diff --git a/internal/tsoptions/errors.go b/internal/tsoptions/errors.go
index ef56e1ddb3..bca802b649 100644
--- a/internal/tsoptions/errors.go
+++ b/internal/tsoptions/errors.go
@@ -97,6 +97,8 @@ func extraKeyDiagnostics(s string) *diagnostics.Message {
return diagnostics.Unknown_watch_option_0
case "typeAcquisition":
return diagnostics.Unknown_type_acquisition_option_0
+ case "buildOptions":
+ return diagnostics.Unknown_build_option_0
default:
return nil
}
diff --git a/internal/tsoptions/namemap.go b/internal/tsoptions/namemap.go
index e199577f87..31a8b98d48 100644
--- a/internal/tsoptions/namemap.go
+++ b/internal/tsoptions/namemap.go
@@ -46,6 +46,7 @@ func (nm *NameMap) GetFromShort(shortName string) *CommandLineOption {
}
func (nm *NameMap) GetOptionDeclarationFromName(optionName string, allowShort bool) *CommandLineOption {
+ optionName = strings.ToLower(optionName)
// Try to translate short option names to their full equivalents.
if allowShort {
short := nm.shortOptionNames[optionName]
diff --git a/internal/tsoptions/parsedbuildcommandline.go b/internal/tsoptions/parsedbuildcommandline.go
new file mode 100644
index 0000000000..8a777b8c15
--- /dev/null
+++ b/internal/tsoptions/parsedbuildcommandline.go
@@ -0,0 +1,33 @@
+package tsoptions
+
+import (
+ "sync"
+
+ "github.com/microsoft/typescript-go/internal/ast"
+ "github.com/microsoft/typescript-go/internal/core"
+ "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"`
+
+ comparePathsOptions tspath.ComparePathsOptions
+
+ resolvedProjectPaths []string
+ resolvedProjectPathsOnce 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
+}
diff --git a/internal/tsoptions/parsedcommandline.go b/internal/tsoptions/parsedcommandline.go
index a265f7dc87..e12be2cc9c 100644
--- a/internal/tsoptions/parsedcommandline.go
+++ b/internal/tsoptions/parsedcommandline.go
@@ -135,6 +135,52 @@ func (p *ParsedCommandLine) GetOutputDeclarationFileNames() iter.Seq2[string, st
}
}
+func (p *ParsedCommandLine) GetOutputFileNames() iter.Seq[string] {
+ return func(yield func(outputName string) bool) {
+ for _, fileName := range p.ParsedConfig.FileNames {
+ if tspath.IsDeclarationFileName(fileName) {
+ continue
+ }
+ jsFileName := outputpaths.GetOutputJSFileName(fileName, p.CompilerOptions(), p)
+ isJson := tspath.FileExtensionIs(fileName, tspath.ExtensionJson)
+ if jsFileName != "" {
+ if !yield(jsFileName) {
+ return
+ }
+ if !isJson {
+ sourceMap := outputpaths.GetSourceMapFilePath(jsFileName, p.CompilerOptions())
+ if sourceMap != "" {
+ if !yield(sourceMap) {
+ return
+ }
+ }
+ }
+ }
+ if isJson {
+ continue
+ }
+ if p.CompilerOptions().GetEmitDeclarations() {
+ dtsFileName := outputpaths.GetOutputDeclarationFileNameWorker(fileName, p.CompilerOptions(), p)
+ if dtsFileName != "" {
+ if !yield(dtsFileName) {
+ return
+ }
+ if p.CompilerOptions().GetAreDeclarationMapsEnabled() {
+ declarationMap := dtsFileName + ".map"
+ if !yield(declarationMap) {
+ return
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+func (p *ParsedCommandLine) GetBuildInfoFileName() string {
+ return outputpaths.GetBuildInfoFileName(p.CompilerOptions(), p.comparePathsOptions)
+}
+
// WildcardDirectories returns the cached wildcard directories, initializing them if needed
func (p *ParsedCommandLine) WildcardDirectories() map[string]bool {
if p == nil {
@@ -179,10 +225,6 @@ func (p *ParsedCommandLine) CompilerOptions() *core.CompilerOptions {
return p.ParsedConfig.CompilerOptions
}
-func (p *ParsedCommandLine) GetBuildInfoFileName() string {
- return outputpaths.GetBuildInfoFileName(p.CompilerOptions(), p.comparePathsOptions)
-}
-
func (p *ParsedCommandLine) SetTypeAcquisition(o *core.TypeAcquisition) {
p.ParsedConfig.TypeAcquisition = o
}
@@ -202,14 +244,7 @@ func (p *ParsedCommandLine) ProjectReferences() []*core.ProjectReference {
func (p *ParsedCommandLine) ResolvedProjectReferencePaths() []string {
p.resolvedProjectReferencePathsOnce.Do(func() {
- if p.ParsedConfig.ProjectReferences == nil {
- return
- }
- resolvedProjectReferencePaths := make([]string, 0, len(p.ParsedConfig.ProjectReferences))
- for _, ref := range p.ParsedConfig.ProjectReferences {
- resolvedProjectReferencePaths = append(resolvedProjectReferencePaths, core.ResolveProjectReferencePath(ref))
- }
- p.resolvedProjectReferencePaths = resolvedProjectReferencePaths
+ p.resolvedProjectReferencePaths = core.Map(p.ParsedConfig.ProjectReferences, core.ResolveProjectReferencePath)
})
return p.resolvedProjectReferencePaths
}
diff --git a/internal/tsoptions/parsinghelpers.go b/internal/tsoptions/parsinghelpers.go
index 8ddcf6194d..bf16518be2 100644
--- a/internal/tsoptions/parsinghelpers.go
+++ b/internal/tsoptions/parsinghelpers.go
@@ -156,6 +156,18 @@ func (o *typeAcquisitionParser) UnknownOptionDiagnostic() *diagnostics.Message {
return extraKeyDiagnostics("typeAcquisition")
}
+type buildOptionsParser struct {
+ *core.BuildOptions
+}
+
+func (o *buildOptionsParser) ParseOption(key string, value any) []*ast.Diagnostic {
+ return ParseBuildOptions(key, value, o.BuildOptions)
+}
+
+func (o *buildOptionsParser) UnknownOptionDiagnostic() *diagnostics.Message {
+ return extraKeyDiagnostics("buildOptions")
+}
+
func ParseCompilerOptions(key string, value any, allOptions *core.CompilerOptions) []*ast.Diagnostic {
if value == nil {
return nil
@@ -391,8 +403,6 @@ func parseCompilerOptions(key string, value any, allOptions *core.CompilerOption
allOptions.TsBuildInfoFile = parseString(value)
case "typeRoots":
allOptions.TypeRoots = parseStringArray(value)
- case "tscBuild":
- allOptions.TscBuild = parseTristate(value)
case "types":
allOptions.Types = parseStringArray(value)
case "useDefineForClassFields":
@@ -496,6 +506,32 @@ func ParseTypeAcquisition(key string, value any, allOptions *core.TypeAcquisitio
return nil
}
+func ParseBuildOptions(key string, value any, allOptions *core.BuildOptions) []*ast.Diagnostic {
+ if value == nil {
+ return nil
+ }
+ if allOptions == nil {
+ return nil
+ }
+ option := BuildNameMap.Get(key)
+ if option != nil {
+ key = option.Name
+ }
+ switch key {
+ case "clean":
+ allOptions.Clean = parseTristate(value)
+ case "dry":
+ allOptions.Dry = parseTristate(value)
+ case "force":
+ allOptions.Force = parseTristate(value)
+ case "stopBuildOnErrors":
+ allOptions.StopBuildOnErrors = parseTristate(value)
+ case "verbose":
+ allOptions.Verbose = parseTristate(value)
+ }
+ return nil
+}
+
// mergeCompilerOptions merges the source compiler options into the target compiler options
// with optional awareness of explicitly set null values in the raw JSON.
// Fields in the source options will overwrite the corresponding fields in the target options,
@@ -576,7 +612,9 @@ func ConvertOptionToAbsolutePath(o string, v any, optionMap CommandLineOptionNam
}
}
} else if option.IsFilePath {
- return tspath.GetNormalizedAbsolutePath(v.(string), cwd), true
+ if value, ok := v.(string); ok {
+ return tspath.GetNormalizedAbsolutePath(value, cwd), true
+ }
}
return nil, false
}
diff --git a/internal/tsoptions/tsconfigparsing.go b/internal/tsoptions/tsconfigparsing.go
index ca6757f048..9be7784348 100644
--- a/internal/tsoptions/tsconfigparsing.go
+++ b/internal/tsoptions/tsconfigparsing.go
@@ -1281,9 +1281,10 @@ func parseJsonConfigFileContentWorker(
}
getProjectReferences := func(basePath string) []*core.ProjectReference {
- var projectReferences []*core.ProjectReference = []*core.ProjectReference{}
+ var projectReferences []*core.ProjectReference
newReferencesOfRaw := getPropFromRaw("references", func(element any) bool { return reflect.TypeOf(element) == orderedMapType }, "object")
if newReferencesOfRaw.sliceValue != nil {
+ projectReferences = []*core.ProjectReference{}
for _, reference := range newReferencesOfRaw.sliceValue {
for _, ref := range parseProjectReference(reference) {
if reflect.TypeOf(ref.Path).Kind() != reflect.String {
diff --git a/internal/vfs/cachedvfs/cachedvfs.go b/internal/vfs/cachedvfs/cachedvfs.go
index 0e284fe043..6fcc3d92f4 100644
--- a/internal/vfs/cachedvfs/cachedvfs.go
+++ b/internal/vfs/cachedvfs/cachedvfs.go
@@ -2,6 +2,7 @@ package cachedvfs
import (
"sync/atomic"
+ "time"
"github.com/microsoft/typescript-go/internal/collections"
"github.com/microsoft/typescript-go/internal/vfs"
@@ -116,10 +117,14 @@ func (fsys *FS) Remove(path string) error {
return fsys.fs.Remove(path)
}
+func (fsys *FS) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ return fsys.fs.Chtimes(path, aTime, mTime)
+}
+
func (fsys *FS) Stat(path string) vfs.FileInfo {
if fsys.enabled.Load() {
if ret, ok := fsys.statCache.Load(path); ok {
- return ret.(vfs.FileInfo)
+ return ret
}
}
@@ -141,5 +146,6 @@ func (fsys *FS) WalkDir(root string, walkFn vfs.WalkDirFunc) error {
}
func (fsys *FS) WriteFile(path string, data string, writeByteOrderMark bool) error {
+ // !!! sheetal this needs update to caches or not?
return fsys.fs.WriteFile(path, data, writeByteOrderMark)
}
diff --git a/internal/vfs/iovfs/iofs.go b/internal/vfs/iovfs/iofs.go
index a5289d4f0b..3c3c4bd7c9 100644
--- a/internal/vfs/iovfs/iofs.go
+++ b/internal/vfs/iovfs/iofs.go
@@ -4,6 +4,7 @@ import (
"fmt"
"io/fs"
"strings"
+ "time"
"github.com/microsoft/typescript-go/internal/stringutil"
"github.com/microsoft/typescript-go/internal/tspath"
@@ -22,6 +23,7 @@ type WritableFS interface {
MkdirAll(path string, perm fs.FileMode) error
// Removes `path` and all its contents. Will return the first error it encounters.
Remove(path string) error
+ Chtimes(path string, aTime time.Time, mTime time.Time) error
}
type FsWithSys interface {
@@ -61,6 +63,7 @@ func From(fsys fs.FS, useCaseSensitiveFileNames bool) FsWithSys {
var writeFile func(path string, content string, writeByteOrderMark bool) error
var mkdirAll func(path string) error
var remove func(path string) error
+ var chtimes func(path string, aTime time.Time, mTime time.Time) error
if fsys, ok := fsys.(WritableFS); ok {
writeFile = func(path string, content string, writeByteOrderMark bool) error {
rest, _ := strings.CutPrefix(path, "/")
@@ -80,6 +83,10 @@ func From(fsys fs.FS, useCaseSensitiveFileNames bool) FsWithSys {
rest, _ := strings.CutPrefix(path, "/")
return fsys.Remove(rest)
}
+ chtimes = func(path string, aTime time.Time, mTime time.Time) error {
+ rest, _ := strings.CutPrefix(path, "/")
+ return fsys.Chtimes(rest, aTime, mTime)
+ }
} else {
writeFile = func(string, string, bool) error {
panic("writeFile not supported")
@@ -90,6 +97,9 @@ func From(fsys fs.FS, useCaseSensitiveFileNames bool) FsWithSys {
remove = func(string) error {
panic("remove not supported")
}
+ chtimes = func(string, time.Time, time.Time) error {
+ panic("chtimes not supported")
+ }
}
return &ioFS{
@@ -112,6 +122,7 @@ func From(fsys fs.FS, useCaseSensitiveFileNames bool) FsWithSys {
writeFile: writeFile,
mkdirAll: mkdirAll,
remove: remove,
+ chtimes: chtimes,
fsys: fsys,
}
}
@@ -124,6 +135,7 @@ type ioFS struct {
writeFile func(path string, content string, writeByteOrderMark bool) error
mkdirAll func(path string) error
remove func(path string) error
+ chtimes func(path string, aTime time.Time, mTime time.Time) error
fsys fs.FS
}
@@ -163,6 +175,11 @@ func (vfs *ioFS) Remove(path string) error {
return vfs.remove(path)
}
+func (vfs *ioFS) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ _ = internal.RootLength(path) // Assert path is rooted
+ return vfs.chtimes(path, aTime, mTime)
+}
+
func (vfs *ioFS) Realpath(path string) string {
root, rest := internal.SplitPath(path)
// splitPath normalizes the path into parts (e.g. "c:/foo/bar" -> "c:/", "foo/bar")
diff --git a/internal/vfs/osvfs/os.go b/internal/vfs/osvfs/os.go
index 47439b59d1..d811d6ff71 100644
--- a/internal/vfs/osvfs/os.go
+++ b/internal/vfs/osvfs/os.go
@@ -6,6 +6,7 @@ import (
"path/filepath"
"runtime"
"strings"
+ "time"
"unicode"
"github.com/microsoft/typescript-go/internal/tspath"
@@ -170,3 +171,7 @@ func (vfs *osFS) Remove(path string) error {
// todo: #701 add retry mechanism?
return os.RemoveAll(path)
}
+
+func (vfs *osFS) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ return os.Chtimes(path, aTime, mTime)
+}
diff --git a/internal/vfs/vfs.go b/internal/vfs/vfs.go
index f2e05340e7..f50309b4d4 100644
--- a/internal/vfs/vfs.go
+++ b/internal/vfs/vfs.go
@@ -2,6 +2,7 @@ package vfs
import (
"io/fs"
+ "time"
)
//go:generate go tool github.com/matryer/moq -fmt goimports -out vfsmock/mock_generated.go -pkg vfsmock . FS
@@ -24,6 +25,9 @@ type FS interface {
// Removes `path` and all its contents. Will return the first error it encounters.
Remove(path string) error
+ // Chtimes changes the access and modification times of the named
+ Chtimes(path string, aTime time.Time, mTime time.Time) error
+
// DirectoryExists returns true if the path is a directory.
DirectoryExists(path string) bool
diff --git a/internal/vfs/vfsmock/mock_generated.go b/internal/vfs/vfsmock/mock_generated.go
index f18d46dd4e..88b875abc7 100644
--- a/internal/vfs/vfsmock/mock_generated.go
+++ b/internal/vfs/vfsmock/mock_generated.go
@@ -5,6 +5,7 @@ package vfsmock
import (
"sync"
+ "time"
"github.com/microsoft/typescript-go/internal/vfs"
)
@@ -19,6 +20,9 @@ var _ vfs.FS = &FSMock{}
//
// // make and configure a mocked vfs.FS
// mockedFS := &FSMock{
+// ChtimesFunc: func(path string, aTime time.Time, mTime time.Time) error {
+// panic("mock out the Chtimes method")
+// },
// DirectoryExistsFunc: func(path string) bool {
// panic("mock out the DirectoryExists method")
// },
@@ -56,6 +60,9 @@ var _ vfs.FS = &FSMock{}
//
// }
type FSMock struct {
+ // ChtimesFunc mocks the Chtimes method.
+ ChtimesFunc func(path string, aTime time.Time, mTime time.Time) error
+
// DirectoryExistsFunc mocks the DirectoryExists method.
DirectoryExistsFunc func(path string) bool
@@ -88,6 +95,15 @@ type FSMock struct {
// calls tracks calls to the methods.
calls struct {
+ // Chtimes holds details about calls to the Chtimes method.
+ Chtimes []struct {
+ // Path is the path argument value.
+ Path string
+ // ATime is the aTime argument value.
+ ATime time.Time
+ // MTime is the mTime argument value.
+ MTime time.Time
+ }
// DirectoryExists holds details about calls to the DirectoryExists method.
DirectoryExists []struct {
// Path is the path argument value.
@@ -142,6 +158,7 @@ type FSMock struct {
WriteByteOrderMark bool
}
}
+ lockChtimes sync.RWMutex
lockDirectoryExists sync.RWMutex
lockFileExists sync.RWMutex
lockGetAccessibleEntries sync.RWMutex
@@ -154,6 +171,46 @@ type FSMock struct {
lockWriteFile sync.RWMutex
}
+// Chtimes calls ChtimesFunc.
+func (mock *FSMock) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ if mock.ChtimesFunc == nil {
+ panic("FSMock.ChtimesFunc: method is nil but FS.Chtimes was just called")
+ }
+ callInfo := struct {
+ Path string
+ ATime time.Time
+ MTime time.Time
+ }{
+ Path: path,
+ ATime: aTime,
+ MTime: mTime,
+ }
+ mock.lockChtimes.Lock()
+ mock.calls.Chtimes = append(mock.calls.Chtimes, callInfo)
+ mock.lockChtimes.Unlock()
+ return mock.ChtimesFunc(path, aTime, mTime)
+}
+
+// ChtimesCalls gets all the calls that were made to Chtimes.
+// Check the length with:
+//
+// len(mockedFS.ChtimesCalls())
+func (mock *FSMock) ChtimesCalls() []struct {
+ Path string
+ ATime time.Time
+ MTime time.Time
+} {
+ var calls []struct {
+ Path string
+ ATime time.Time
+ MTime time.Time
+ }
+ mock.lockChtimes.RLock()
+ calls = mock.calls.Chtimes
+ mock.lockChtimes.RUnlock()
+ return calls
+}
+
// DirectoryExists calls DirectoryExistsFunc.
func (mock *FSMock) DirectoryExists(path string) bool {
if mock.DirectoryExistsFunc == nil {
diff --git a/internal/vfs/vfsmock/wrapper.go b/internal/vfs/vfsmock/wrapper.go
index 02ba3acd2f..9ca2fc7a4a 100644
--- a/internal/vfs/vfsmock/wrapper.go
+++ b/internal/vfs/vfsmock/wrapper.go
@@ -11,6 +11,7 @@ func Wrap(fs vfs.FS) *FSMock {
ReadFileFunc: fs.ReadFile,
RealpathFunc: fs.Realpath,
RemoveFunc: fs.Remove,
+ ChtimesFunc: fs.Chtimes,
StatFunc: fs.Stat,
UseCaseSensitiveFileNamesFunc: fs.UseCaseSensitiveFileNames,
WalkDirFunc: fs.WalkDir,
diff --git a/internal/vfs/vfstest/vfstest.go b/internal/vfs/vfstest/vfstest.go
index e051b0c347..4e8a0d7fe1 100644
--- a/internal/vfs/vfstest/vfstest.go
+++ b/internal/vfs/vfstest/vfstest.go
@@ -537,6 +537,20 @@ func (m *MapFS) Remove(path string) error {
return m.remove(path)
}
+func (m *MapFS) Chtimes(path string, aTime time.Time, mTime time.Time) error {
+ m.mu.Lock()
+ defer m.mu.Unlock()
+ canonical := m.getCanonicalPath(path)
+ canonicalString := string(canonical)
+ fileInfo := m.m[canonicalString]
+ if fileInfo == nil {
+ // file does not exist
+ return fs.ErrNotExist
+ }
+ fileInfo.ModTime = mTime
+ return nil
+}
+
func (m *MapFS) GetTargetOfSymlink(path string) (string, bool) {
path, _ = strings.CutPrefix(path, "/")
m.mu.RLock()
diff --git a/testdata/baselines/reference/submodule/compiler/libReplacement(libreplacement=true).trace.json b/testdata/baselines/reference/submodule/compiler/libReplacement(libreplacement=true).trace.json
new file mode 100644
index 0000000000..9f241813e7
--- /dev/null
+++ b/testdata/baselines/reference/submodule/compiler/libReplacement(libreplacement=true).trace.json
@@ -0,0 +1,1326 @@
+======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist.
+File '/package.json' does not exist.
+Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators' was not resolved. ========
+======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/collection' from '/.src/__lib_node_modules_lookup_lib.es2015.collection.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/collection' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/collection'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/collection'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/collection' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/core' from '/.src/__lib_node_modules_lookup_lib.es2015.core.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/core' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/core'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/core'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/core' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015' from '/.src/__lib_node_modules_lookup_lib.es2015.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/generator' from '/.src/__lib_node_modules_lookup_lib.es2015.generator.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/generator' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/generator'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/generator'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/generator' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/iterable' from '/.src/__lib_node_modules_lookup_lib.es2015.iterable.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/iterable' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/iterable'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/iterable'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/iterable' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/promise' from '/.src/__lib_node_modules_lookup_lib.es2015.promise.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/promise' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/promise'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/promise'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/promise' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/proxy' from '/.src/__lib_node_modules_lookup_lib.es2015.proxy.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/proxy' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/proxy'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/proxy'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/proxy' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/reflect' from '/.src/__lib_node_modules_lookup_lib.es2015.reflect.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/reflect' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/reflect'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/reflect'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/reflect' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/symbol' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/symbol' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/symbol'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/symbol'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/symbol' was not resolved. ========
+======== Resolving module '@typescript/lib-es2015/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2015.symbol.wellknown.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2015/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2015/symbol-wellknown'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2015/symbol-wellknown' was not resolved. ========
+======== Resolving module '@typescript/lib-es2016/array-include' from '/.src/__lib_node_modules_lookup_lib.es2016.array.include.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2016/array-include' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2016/array-include'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2016/array-include'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2016/array-include' was not resolved. ========
+======== Resolving module '@typescript/lib-es2016' from '/.src/__lib_node_modules_lookup_lib.es2016.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2016' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2016'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2016'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2016' was not resolved. ========
+======== Resolving module '@typescript/lib-es2016/intl' from '/.src/__lib_node_modules_lookup_lib.es2016.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2016/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2016/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2016/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2016/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017/arraybuffer' from '/.src/__lib_node_modules_lookup_lib.es2017.arraybuffer.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017/arraybuffer' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/arraybuffer'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017/arraybuffer' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017' from '/.src/__lib_node_modules_lookup_lib.es2017.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017/date' from '/.src/__lib_node_modules_lookup_lib.es2017.date.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017/date' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/date'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/date'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017/date' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017/intl' from '/.src/__lib_node_modules_lookup_lib.es2017.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017/object' from '/.src/__lib_node_modules_lookup_lib.es2017.object.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017/object' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/object'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/object'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017/object' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2017.sharedmemory.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017/sharedmemory' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/sharedmemory'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017/sharedmemory' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017/string' from '/.src/__lib_node_modules_lookup_lib.es2017.string.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017/string' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/string'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/string'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017/string' was not resolved. ========
+======== Resolving module '@typescript/lib-es2017/typedarrays' from '/.src/__lib_node_modules_lookup_lib.es2017.typedarrays.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2017/typedarrays' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2017/typedarrays'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2017/typedarrays' was not resolved. ========
+======== Resolving module '@typescript/lib-es2018/asyncgenerator' from '/.src/__lib_node_modules_lookup_lib.es2018.asyncgenerator.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2018/asyncgenerator' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/asyncgenerator'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2018/asyncgenerator' was not resolved. ========
+======== Resolving module '@typescript/lib-es2018/asynciterable' from '/.src/__lib_node_modules_lookup_lib.es2018.asynciterable.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2018/asynciterable' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/asynciterable'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2018/asynciterable' was not resolved. ========
+======== Resolving module '@typescript/lib-es2018' from '/.src/__lib_node_modules_lookup_lib.es2018.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2018' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2018' was not resolved. ========
+======== Resolving module '@typescript/lib-es2018/intl' from '/.src/__lib_node_modules_lookup_lib.es2018.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2018/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2018/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2018/promise' from '/.src/__lib_node_modules_lookup_lib.es2018.promise.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2018/promise' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/promise'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/promise'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2018/promise' was not resolved. ========
+======== Resolving module '@typescript/lib-es2018/regexp' from '/.src/__lib_node_modules_lookup_lib.es2018.regexp.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2018/regexp' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/regexp'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2018/regexp'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2018/regexp' was not resolved. ========
+======== Resolving module '@typescript/lib-es2019/array' from '/.src/__lib_node_modules_lookup_lib.es2019.array.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2019/array' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/array'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/array'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2019/array' was not resolved. ========
+======== Resolving module '@typescript/lib-es2019' from '/.src/__lib_node_modules_lookup_lib.es2019.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2019' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2019' was not resolved. ========
+======== Resolving module '@typescript/lib-es2019/intl' from '/.src/__lib_node_modules_lookup_lib.es2019.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2019/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2019/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2019/object' from '/.src/__lib_node_modules_lookup_lib.es2019.object.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2019/object' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/object'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/object'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2019/object' was not resolved. ========
+======== Resolving module '@typescript/lib-es2019/string' from '/.src/__lib_node_modules_lookup_lib.es2019.string.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2019/string' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/string'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/string'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2019/string' was not resolved. ========
+======== Resolving module '@typescript/lib-es2019/symbol' from '/.src/__lib_node_modules_lookup_lib.es2019.symbol.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2019/symbol' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/symbol'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2019/symbol'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2019/symbol' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/bigint' from '/.src/__lib_node_modules_lookup_lib.es2020.bigint.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/bigint' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/bigint'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/bigint'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/bigint' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020' from '/.src/__lib_node_modules_lookup_lib.es2020.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/date' from '/.src/__lib_node_modules_lookup_lib.es2020.date.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/date' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/date'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/date'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/date' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/intl' from '/.src/__lib_node_modules_lookup_lib.es2020.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/number' from '/.src/__lib_node_modules_lookup_lib.es2020.number.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/number' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/number'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/number'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/number' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/promise' from '/.src/__lib_node_modules_lookup_lib.es2020.promise.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/promise' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/promise'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/promise'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/promise' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2020.sharedmemory.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/sharedmemory' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/sharedmemory'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/sharedmemory' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/string' from '/.src/__lib_node_modules_lookup_lib.es2020.string.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/string' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/string'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/string'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/string' was not resolved. ========
+======== Resolving module '@typescript/lib-es2020/symbol-wellknown' from '/.src/__lib_node_modules_lookup_lib.es2020.symbol.wellknown.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2020/symbol-wellknown' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2020/symbol-wellknown'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2020/symbol-wellknown' was not resolved. ========
+======== Resolving module '@typescript/lib-es2021' from '/.src/__lib_node_modules_lookup_lib.es2021.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2021' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2021' was not resolved. ========
+======== Resolving module '@typescript/lib-es2021/intl' from '/.src/__lib_node_modules_lookup_lib.es2021.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2021/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2021/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2021/promise' from '/.src/__lib_node_modules_lookup_lib.es2021.promise.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2021/promise' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/promise'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/promise'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2021/promise' was not resolved. ========
+======== Resolving module '@typescript/lib-es2021/string' from '/.src/__lib_node_modules_lookup_lib.es2021.string.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2021/string' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/string'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/string'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2021/string' was not resolved. ========
+======== Resolving module '@typescript/lib-es2021/weakref' from '/.src/__lib_node_modules_lookup_lib.es2021.weakref.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2021/weakref' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/weakref'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2021/weakref'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2021/weakref' was not resolved. ========
+======== Resolving module '@typescript/lib-es2022/array' from '/.src/__lib_node_modules_lookup_lib.es2022.array.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2022/array' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/array'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/array'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2022/array' was not resolved. ========
+======== Resolving module '@typescript/lib-es2022' from '/.src/__lib_node_modules_lookup_lib.es2022.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2022' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2022' was not resolved. ========
+======== Resolving module '@typescript/lib-es2022/error' from '/.src/__lib_node_modules_lookup_lib.es2022.error.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2022/error' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/error'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/error'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2022/error' was not resolved. ========
+======== Resolving module '@typescript/lib-es2022/intl' from '/.src/__lib_node_modules_lookup_lib.es2022.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2022/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2022/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2022/object' from '/.src/__lib_node_modules_lookup_lib.es2022.object.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2022/object' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/object'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/object'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2022/object' was not resolved. ========
+======== Resolving module '@typescript/lib-es2022/regexp' from '/.src/__lib_node_modules_lookup_lib.es2022.regexp.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2022/regexp' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/regexp'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/regexp'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2022/regexp' was not resolved. ========
+======== Resolving module '@typescript/lib-es2022/string' from '/.src/__lib_node_modules_lookup_lib.es2022.string.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2022/string' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/string'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2022/string'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2022/string' was not resolved. ========
+======== Resolving module '@typescript/lib-es2023/array' from '/.src/__lib_node_modules_lookup_lib.es2023.array.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2023/array' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023/array'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023/array'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2023/array' was not resolved. ========
+======== Resolving module '@typescript/lib-es2023/collection' from '/.src/__lib_node_modules_lookup_lib.es2023.collection.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2023/collection' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023/collection'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023/collection'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2023/collection' was not resolved. ========
+======== Resolving module '@typescript/lib-es2023' from '/.src/__lib_node_modules_lookup_lib.es2023.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2023' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2023' was not resolved. ========
+======== Resolving module '@typescript/lib-es2023/intl' from '/.src/__lib_node_modules_lookup_lib.es2023.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2023/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2023/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2023/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024/arraybuffer' from '/.src/__lib_node_modules_lookup_lib.es2024.arraybuffer.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024/arraybuffer' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/arraybuffer'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/arraybuffer'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024/arraybuffer' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024/collection' from '/.src/__lib_node_modules_lookup_lib.es2024.collection.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024/collection' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/collection'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/collection'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024/collection' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024' from '/.src/__lib_node_modules_lookup_lib.es2024.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024/object' from '/.src/__lib_node_modules_lookup_lib.es2024.object.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024/object' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/object'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/object'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024/object' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024/promise' from '/.src/__lib_node_modules_lookup_lib.es2024.promise.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024/promise' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/promise'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/promise'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024/promise' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024/regexp' from '/.src/__lib_node_modules_lookup_lib.es2024.regexp.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024/regexp' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/regexp'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/regexp'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024/regexp' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024/sharedmemory' from '/.src/__lib_node_modules_lookup_lib.es2024.sharedmemory.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024/sharedmemory' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/sharedmemory'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/sharedmemory'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024/sharedmemory' was not resolved. ========
+======== Resolving module '@typescript/lib-es2024/string' from '/.src/__lib_node_modules_lookup_lib.es2024.string.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es2024/string' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/string'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es2024/string'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es2024/string' was not resolved. ========
+======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es5' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/array' from '/.src/__lib_node_modules_lookup_lib.esnext.array.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/array' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/array'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/array'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/array' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/collection' from '/.src/__lib_node_modules_lookup_lib.esnext.collection.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/collection' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/collection'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/collection'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/collection' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext' from '/.src/__lib_node_modules_lookup_lib.esnext.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/decorators' from '/.src/__lib_node_modules_lookup_lib.esnext.decorators.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/decorators' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/decorators'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/decorators'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/decorators' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/disposable' from '/.src/__lib_node_modules_lookup_lib.esnext.disposable.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/disposable' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/disposable'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/disposable'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/disposable' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/float16' from '/.src/__lib_node_modules_lookup_lib.esnext.float16.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/float16' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/float16'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/float16'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/float16' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/intl' from '/.src/__lib_node_modules_lookup_lib.esnext.intl.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/intl' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/intl'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/intl'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/intl' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/iterator' from '/.src/__lib_node_modules_lookup_lib.esnext.iterator.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/iterator' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/iterator'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/iterator'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/iterator' was not resolved. ========
+======== Resolving module '@typescript/lib-esnext/promise' from '/.src/__lib_node_modules_lookup_lib.esnext.promise.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-esnext/promise' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/promise'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-esnext/promise'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-esnext/promise' was not resolved. ========
diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimple.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimple.trace.json
index c525870d16..840ce3feab 100644
--- a/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimple.trace.json
+++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimple.trace.json
@@ -1,8 +1,43 @@
-======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========
Module resolution kind is not specified, using 'Bundler'.
Resolving in CJS mode with conditions 'require', 'types'.
File '/.src/package.json' does not exist.
File '/package.json' does not exist.
+Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+File '/node_modules/@typescript/lib-decorators.ts' does not exist.
+File '/node_modules/@typescript/lib-decorators.tsx' does not exist.
+File '/node_modules/@typescript/lib-decorators.d.ts' does not exist.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+File '/node_modules/@typescript/lib-decorators.js' does not exist.
+File '/node_modules/@typescript/lib-decorators.jsx' does not exist.
+======== Module name '@typescript/lib-decorators' was not resolved. ========
+======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========
+======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
Directory '/.src/node_modules' does not exist, skipping all lookups in it.
@@ -17,3 +52,58 @@ File '/node_modules/@typescript/lib-dom/index.tsx' does not exist.
File '/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result.
Resolving real path for '/node_modules/@typescript/lib-dom/index.d.ts', result '/node_modules/@typescript/lib-dom/index.d.ts'.
======== Module name '@typescript/lib-dom' was successfully resolved to '/node_modules/@typescript/lib-dom/index.d.ts'. ========
+======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+File '/node_modules/@typescript/lib-es5.ts' does not exist.
+File '/node_modules/@typescript/lib-es5.tsx' does not exist.
+File '/node_modules/@typescript/lib-es5.d.ts' does not exist.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+File '/node_modules/@typescript/lib-es5.js' does not exist.
+File '/node_modules/@typescript/lib-es5.jsx' does not exist.
+======== Module name '@typescript/lib-es5' was not resolved. ========
+======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+File '/node_modules/@typescript/lib-scripthost.ts' does not exist.
+File '/node_modules/@typescript/lib-scripthost.tsx' does not exist.
+File '/node_modules/@typescript/lib-scripthost.d.ts' does not exist.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+File '/node_modules/@typescript/lib-scripthost.js' does not exist.
+File '/node_modules/@typescript/lib-scripthost.jsx' does not exist.
+======== Module name '@typescript/lib-scripthost' was not resolved. ========
+======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========
diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimpleConfig.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimpleConfig.trace.json
index 5b583846ff..3270dfed41 100644
--- a/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimpleConfig.trace.json
+++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptOverrideSimpleConfig.trace.json
@@ -1,8 +1,43 @@
-======== Resolving module '@typescript/lib-dom' from '/somepath/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+======== Resolving module '@typescript/lib-decorators' from '/somepath/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========
Module resolution kind is not specified, using 'Bundler'.
Resolving in CJS mode with conditions 'require', 'types'.
File '/somepath/package.json' does not exist.
File '/package.json' does not exist.
+Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+File '/somepath/node_modules/@typescript/lib-decorators.ts' does not exist.
+File '/somepath/node_modules/@typescript/lib-decorators.tsx' does not exist.
+File '/somepath/node_modules/@typescript/lib-decorators.d.ts' does not exist.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+File '/somepath/node_modules/@typescript/lib-decorators.js' does not exist.
+File '/somepath/node_modules/@typescript/lib-decorators.jsx' does not exist.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators' was not resolved. ========
+======== Resolving module '@typescript/lib-decorators/legacy' from '/somepath/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========
+======== Resolving module '@typescript/lib-dom' from '/somepath/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
File '/somepath/node_modules/@typescript/lib-dom/package.json' does not exist.
@@ -14,3 +49,58 @@ File '/somepath/node_modules/@typescript/lib-dom/index.tsx' does not exist.
File '/somepath/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result.
Resolving real path for '/somepath/node_modules/@typescript/lib-dom/index.d.ts', result '/somepath/node_modules/@typescript/lib-dom/index.d.ts'.
======== Module name '@typescript/lib-dom' was successfully resolved to '/somepath/node_modules/@typescript/lib-dom/index.d.ts'. ========
+======== Resolving module '@typescript/lib-es5' from '/somepath/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+File '/somepath/node_modules/@typescript/lib-es5.ts' does not exist.
+File '/somepath/node_modules/@typescript/lib-es5.tsx' does not exist.
+File '/somepath/node_modules/@typescript/lib-es5.d.ts' does not exist.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+File '/somepath/node_modules/@typescript/lib-es5.js' does not exist.
+File '/somepath/node_modules/@typescript/lib-es5.jsx' does not exist.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es5' was not resolved. ========
+======== Resolving module '@typescript/lib-scripthost' from '/somepath/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+File '/somepath/node_modules/@typescript/lib-scripthost.ts' does not exist.
+File '/somepath/node_modules/@typescript/lib-scripthost.tsx' does not exist.
+File '/somepath/node_modules/@typescript/lib-scripthost.d.ts' does not exist.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+File '/somepath/node_modules/@typescript/lib-scripthost.js' does not exist.
+File '/somepath/node_modules/@typescript/lib-scripthost.jsx' does not exist.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-scripthost' was not resolved. ========
+======== Resolving module '@typescript/lib-webworker/importscripts' from '/somepath/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========
diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolving.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolving.trace.json
index 3fcfca153f..18f21cbca3 100644
--- a/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolving.trace.json
+++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolving.trace.json
@@ -1,8 +1,43 @@
-======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========
Module resolution kind is not specified, using 'Bundler'.
Resolving in CJS mode with conditions 'require', 'types'.
File '/.src/package.json' does not exist.
File '/package.json' does not exist.
+Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+File '/node_modules/@typescript/lib-decorators.ts' does not exist.
+File '/node_modules/@typescript/lib-decorators.tsx' does not exist.
+File '/node_modules/@typescript/lib-decorators.d.ts' does not exist.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+File '/node_modules/@typescript/lib-decorators.js' does not exist.
+File '/node_modules/@typescript/lib-decorators.jsx' does not exist.
+======== Module name '@typescript/lib-decorators' was not resolved. ========
+======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========
+======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
Directory '/.src/node_modules' does not exist, skipping all lookups in it.
@@ -33,3 +68,58 @@ File '/node_modules/@typescript/lib-dom/iterable.tsx' does not exist.
File '/node_modules/@typescript/lib-dom/iterable.d.ts' exists - use it as a name resolution result.
Resolving real path for '/node_modules/@typescript/lib-dom/iterable.d.ts', result '/node_modules/@typescript/lib-dom/iterable.d.ts'.
======== Module name '@typescript/lib-dom/iterable' was successfully resolved to '/node_modules/@typescript/lib-dom/iterable.d.ts'. ========
+======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+File '/node_modules/@typescript/lib-es5.ts' does not exist.
+File '/node_modules/@typescript/lib-es5.tsx' does not exist.
+File '/node_modules/@typescript/lib-es5.d.ts' does not exist.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+File '/node_modules/@typescript/lib-es5.js' does not exist.
+File '/node_modules/@typescript/lib-es5.jsx' does not exist.
+======== Module name '@typescript/lib-es5' was not resolved. ========
+======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+File '/node_modules/@typescript/lib-scripthost.ts' does not exist.
+File '/node_modules/@typescript/lib-scripthost.tsx' does not exist.
+File '/node_modules/@typescript/lib-scripthost.d.ts' does not exist.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+File '/node_modules/@typescript/lib-scripthost.js' does not exist.
+File '/node_modules/@typescript/lib-scripthost.jsx' does not exist.
+======== Module name '@typescript/lib-scripthost' was not resolved. ========
+======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/.src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/.src/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========
diff --git a/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolvingConfig.trace.json b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolvingConfig.trace.json
index 8f2398edd9..7c699fb67f 100644
--- a/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolvingConfig.trace.json
+++ b/testdata/baselines/reference/submodule/compiler/libTypeScriptSubfileResolvingConfig.trace.json
@@ -1,8 +1,43 @@
-======== Resolving module '@typescript/lib-dom' from '/somepath/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+======== Resolving module '@typescript/lib-decorators' from '/somepath/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========
Module resolution kind is not specified, using 'Bundler'.
Resolving in CJS mode with conditions 'require', 'types'.
File '/somepath/package.json' does not exist.
File '/package.json' does not exist.
+Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+File '/somepath/node_modules/@typescript/lib-decorators.ts' does not exist.
+File '/somepath/node_modules/@typescript/lib-decorators.tsx' does not exist.
+File '/somepath/node_modules/@typescript/lib-decorators.d.ts' does not exist.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+File '/somepath/node_modules/@typescript/lib-decorators.js' does not exist.
+File '/somepath/node_modules/@typescript/lib-decorators.jsx' does not exist.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators' was not resolved. ========
+======== Resolving module '@typescript/lib-decorators/legacy' from '/somepath/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-decorators/legacy'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========
+======== Resolving module '@typescript/lib-dom' from '/somepath/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
File '/somepath/node_modules/@typescript/lib-dom/package.json' does not exist.
@@ -27,3 +62,58 @@ File '/somepath/node_modules/@typescript/lib-dom/iterable.tsx' does not exist.
File '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts' exists - use it as a name resolution result.
Resolving real path for '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts', result '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts'.
======== Module name '@typescript/lib-dom/iterable' was successfully resolved to '/somepath/node_modules/@typescript/lib-dom/iterable.d.ts'. ========
+======== Resolving module '@typescript/lib-es5' from '/somepath/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+File '/somepath/node_modules/@typescript/lib-es5.ts' does not exist.
+File '/somepath/node_modules/@typescript/lib-es5.tsx' does not exist.
+File '/somepath/node_modules/@typescript/lib-es5.d.ts' does not exist.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-es5'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+File '/somepath/node_modules/@typescript/lib-es5.js' does not exist.
+File '/somepath/node_modules/@typescript/lib-es5.jsx' does not exist.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-es5' was not resolved. ========
+======== Resolving module '@typescript/lib-scripthost' from '/somepath/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+File '/somepath/node_modules/@typescript/lib-scripthost.ts' does not exist.
+File '/somepath/node_modules/@typescript/lib-scripthost.tsx' does not exist.
+File '/somepath/node_modules/@typescript/lib-scripthost.d.ts' does not exist.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-scripthost'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+File '/somepath/node_modules/@typescript/lib-scripthost.js' does not exist.
+File '/somepath/node_modules/@typescript/lib-scripthost.jsx' does not exist.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-scripthost' was not resolved. ========
+======== Resolving module '@typescript/lib-webworker/importscripts' from '/somepath/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========
+Module resolution kind is not specified, using 'Bundler'.
+Resolving in CJS mode with conditions 'require', 'types'.
+File '/somepath/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
+Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
+Directory '/somepath/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Directory '/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules/@types' does not exist, skipping all lookups in it.
+Scoped package detected, looking in 'typescript__lib-webworker/importscripts'
+Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========
diff --git a/testdata/baselines/reference/tsbuild/clean/file-name-and-output-name-clashing.js b/testdata/baselines/reference/tsbuild/clean/file-name-and-output-name-clashing.js
new file mode 100644
index 0000000000..1d6c33937a
--- /dev/null
+++ b/testdata/baselines/reference/tsbuild/clean/file-name-and-output-name-clashing.js
@@ -0,0 +1,16 @@
+currentDirectory::/home/src/workspaces/solution
+useCaseSensitiveFileNames::true
+Input::
+//// [/home/src/workspaces/solution/bar.ts] *new*
+
+//// [/home/src/workspaces/solution/index.js] *new*
+
+//// [/home/src/workspaces/solution/tsconfig.json] *new*
+{
+ "compilerOptions": { "allowJs": true }
+}
+
+tsgo --b --clean
+ExitStatus:: Success
+Output::
+
diff --git a/testdata/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js b/testdata/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js
new file mode 100644
index 0000000000..cb0a1849c9
--- /dev/null
+++ b/testdata/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js
@@ -0,0 +1,103 @@
+currentDirectory::/home/src/workspaces/solution
+useCaseSensitiveFileNames::true
+Input::
+//// [/home/src/workspaces/solution/project/src/main.tsx] *new*
+export const x = 10;
+//// [/home/src/workspaces/solution/project/tsconfig.json] *new*
+{
+ "compilerOptions": { "declaration": true },
+ "include": ["src/**/*.tsx", "src/**/*.ts"]
+}
+
+tsgo --b project -v --explainFiles
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * project/tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist
+
+[[90mHH:MM:SS AM[0m] Building project 'project/tsconfig.json'...
+
+../../tslibs/TS/Lib/lib.d.ts
+ Default library for target 'ES5'
+project/src/main.tsx
+ Matched by include pattern 'src/**/*.tsx' in 'project/tsconfig.json'
+//// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib*
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+interface ReadonlyArray {}
+interface SymbolConstructor {
+ (desc?: string | number): symbol;
+ for(name: string): symbol;
+ readonly toStringTag: symbol;
+}
+declare var Symbol: SymbolConstructor;
+interface Symbol {
+ readonly [Symbol.toStringTag]: string;
+}
+declare const console: { log(msg: any): void; };
+//// [/home/src/workspaces/solution/project/src/main.d.ts] *new*
+export declare const x = 10;
+
+//// [/home/src/workspaces/solution/project/src/main.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.x = void 0;
+exports.x = 10;
+
+//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *new*
+{"version":"FakeTSVersion","root":["./src/main.tsx"]}
+//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./src/main.tsx"
+ ],
+ "original": "./src/main.tsx"
+ }
+ ],
+ "size": 53
+}
+
+project/tsconfig.json::
+SemanticDiagnostics::
+*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
+*refresh* /home/src/workspaces/solution/project/src/main.tsx
+Signatures::
+(stored at emit) /home/src/workspaces/solution/project/src/main.tsx
+
+
+Edit [0]:: no change
+
+tsgo --b project -v --explainFiles
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * project/tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'project/tsconfig.json' is up to date because newest input 'project/src/main.tsx' is older than output 'project/src/main.js'
+
+
+
+
+Edit [1]:: clean build
+
+tsgo -b project --clean
+ExitStatus:: Success
+Output::
+//// [/home/src/workspaces/solution/project/src/main.d.ts] *deleted*
+//// [/home/src/workspaces/solution/project/src/main.js] *deleted*
+//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *deleted*
+
diff --git a/testdata/baselines/reference/tsbuild/commandLine/different-options-with-incremental.js b/testdata/baselines/reference/tsbuild/commandLine/different-options-with-incremental.js
new file mode 100644
index 0000000000..7172bf4267
--- /dev/null
+++ b/testdata/baselines/reference/tsbuild/commandLine/different-options-with-incremental.js
@@ -0,0 +1,1609 @@
+currentDirectory::/home/src/workspaces/project
+useCaseSensitiveFileNames::true
+Input::
+//// [/home/src/workspaces/project/a.ts] *new*
+export const a = 10;const aLocal = 10;
+//// [/home/src/workspaces/project/b.ts] *new*
+export const b = 10;const bLocal = 10;
+//// [/home/src/workspaces/project/c.ts] *new*
+import { a } from "./a";export const c = a;
+//// [/home/src/workspaces/project/d.ts] *new*
+import { b } from "./b";export const d = b;
+//// [/home/src/workspaces/project/tsconfig.json] *new*
+{
+ "compilerOptions": {
+ "incremental": true
+ }
+}
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib*
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+interface ReadonlyArray {}
+interface SymbolConstructor {
+ (desc?: string | number): symbol;
+ for(name: string): symbol;
+ readonly toStringTag: symbol;
+}
+declare var Symbol: SymbolConstructor;
+interface Symbol {
+ readonly [Symbol.toStringTag]: string;
+}
+declare const console: { log(msg: any): void; };
+//// [/home/src/workspaces/project/a.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 10;
+
+//// [/home/src/workspaces/project/b.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+
+//// [/home/src/workspaces/project/c.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+
+//// [/home/src/workspaces/project/d.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;"],"fileIdsList":[[2],[3]],"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "impliedNodeFormat": "CommonJS"
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1251
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
+*refresh* /home/src/workspaces/project/a.ts
+*refresh* /home/src/workspaces/project/b.ts
+*refresh* /home/src/workspaces/project/c.ts
+*refresh* /home/src/workspaces/project/d.ts
+Signatures::
+
+
+Edit [0]:: with sourceMap
+
+tsgo --build --verbose --sourceMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 10;
+//# sourceMappingURL=a.js.map
+//// [/home/src/workspaces/project/a.js.map] *new*
+{"version":3,"file":"a.js","sourceRoot":"","sources":["a.ts"],"names":[],"mappings":";;;AAAa,QAAA,CAAC,GAAG,EAAE,CAAC;AAAA,MAAM,MAAM,GAAG,EAAE,CAAC"}
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+//# sourceMappingURL=b.js.map
+//// [/home/src/workspaces/project/b.js.map] *new*
+{"version":3,"file":"b.js","sourceRoot":"","sources":["b.ts"],"names":[],"mappings":";;;AAAa,QAAA,CAAC,GAAG,EAAE,CAAC;AAAA,MAAM,MAAM,GAAG,EAAE,CAAC"}
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+//# sourceMappingURL=c.js.map
+//// [/home/src/workspaces/project/c.js.map] *new*
+{"version":3,"file":"c.js","sourceRoot":"","sources":["c.ts"],"names":[],"mappings":";;;AAAA,2BAAwB;AAAa,QAAA,CAAC,GAAG,KAAC,CAAC"}
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+//# sourceMappingURL=d.js.map
+//// [/home/src/workspaces/project/d.js.map] *new*
+{"version":3,"file":"d.js","sourceRoot":"","sources":["d.ts"],"names":[],"mappings":";;;AAAA,2BAAwB;AAAa,QAAA,CAAC,GAAG,KAAC,CAAC"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;"],"fileIdsList":[[2],[3]],"options":{"sourceMap":true},"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "impliedNodeFormat": "CommonJS"
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "sourceMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1280
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [1]:: should re-emit only js so they dont contain sourcemap
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 10;
+
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;"],"fileIdsList":[[2],[3]],"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "impliedNodeFormat": "CommonJS"
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "impliedNodeFormat": "CommonJS"
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1251
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [2]:: with declaration, emit Dts and should not emit js
+
+tsgo --build --verbose --declaration
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.d.ts] *new*
+export declare const a = 10;
+
+//// [/home/src/workspaces/project/b.d.ts] *new*
+export declare const b = 10;
+
+//// [/home/src/workspaces/project/c.d.ts] *new*
+export declare const c = 10;
+
+//// [/home/src/workspaces/project/d.d.ts] *new*
+export declare const d = 10;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"declaration":true},"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "declaration": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1730
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+(stored at emit) /home/src/workspaces/project/a.ts
+(stored at emit) /home/src/workspaces/project/b.ts
+(stored at emit) /home/src/workspaces/project/c.ts
+(stored at emit) /home/src/workspaces/project/d.ts
+
+
+Edit [3]:: with declaration and declarationMap
+
+tsgo --build --verbose --declaration --declarationMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.d.ts] *modified*
+export declare const a = 10;
+//# sourceMappingURL=a.d.ts.map
+//// [/home/src/workspaces/project/a.d.ts.map] *new*
+{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["a.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,CAAC,KAAK,CAAC"}
+//// [/home/src/workspaces/project/b.d.ts] *modified*
+export declare const b = 10;
+//# sourceMappingURL=b.d.ts.map
+//// [/home/src/workspaces/project/b.d.ts.map] *new*
+{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["b.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,CAAC,KAAK,CAAC"}
+//// [/home/src/workspaces/project/c.d.ts] *modified*
+export declare const c = 10;
+//# sourceMappingURL=c.d.ts.map
+//// [/home/src/workspaces/project/c.d.ts.map] *new*
+{"version":3,"file":"c.d.ts","sourceRoot":"","sources":["c.ts"],"names":[],"mappings":"AAAwB,eAAO,MAAM,CAAC,KAAI,CAAC"}
+//// [/home/src/workspaces/project/d.d.ts] *modified*
+export declare const d = 10;
+//# sourceMappingURL=d.d.ts.map
+//// [/home/src/workspaces/project/d.d.ts.map] *new*
+{"version":3,"file":"d.d.ts","sourceRoot":"","sources":["d.ts"],"names":[],"mappings":"AAAwB,eAAO,MAAM,CAAC,KAAI,CAAC"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"declaration":true,"declarationMap":true},"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "declaration": true,
+ "declarationMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1752
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [4]:: no change
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'd.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
+
+
+Edit [5]:: local change
+//// [/home/src/workspaces/project/a.ts] *modified*
+export const a = 10;const aLocal = 100;
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts'
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 100;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1700
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+*refresh* /home/src/workspaces/project/a.ts
+Signatures::
+(computed .d.ts) /home/src/workspaces/project/a.ts
+
+
+Edit [6]:: with declaration and declarationMap
+
+tsgo --build --verbose --declaration --declarationMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/a.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/b.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/c.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/d.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/d.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"declaration":true,"declarationMap":true},"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "declaration": true,
+ "declarationMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1753
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [7]:: no change
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
+
+
+Edit [8]:: with inlineSourceMap
+
+tsgo --build --verbose --inlineSourceMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 100;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQWEsUUFBQSxDQUFDLEdBQUcsRUFBRSxDQUFDO0FBQUEsTUFBTSxNQUFNLEdBQUcsR0FBRyxDQUFDIn0=
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQWEsUUFBQSxDQUFDLEdBQUcsRUFBRSxDQUFDO0FBQUEsTUFBTSxNQUFNLEdBQUcsRUFBRSxDQUFDIn0=
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMkJBQXdCO0FBQWEsUUFBQSxDQUFDLEdBQUcsS0FBQyxDQUFDIn0=
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMkJBQXdCO0FBQWEsUUFBQSxDQUFDLEdBQUcsS0FBQyxDQUFDIn0=
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"inlineSourceMap":true},"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "inlineSourceMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1735
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [9]:: with sourceMap
+
+tsgo --build --verbose --sourceMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 100;
+//# sourceMappingURL=a.js.map
+//// [/home/src/workspaces/project/a.js.map] *modified*
+{"version":3,"file":"a.js","sourceRoot":"","sources":["a.ts"],"names":[],"mappings":";;;AAAa,QAAA,CAAC,GAAG,EAAE,CAAC;AAAA,MAAM,MAAM,GAAG,GAAG,CAAC"}
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+//# sourceMappingURL=b.js.map
+//// [/home/src/workspaces/project/b.js.map] *rewrite with same content*
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+//# sourceMappingURL=c.js.map
+//// [/home/src/workspaces/project/c.js.map] *rewrite with same content*
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+//# sourceMappingURL=d.js.map
+//// [/home/src/workspaces/project/d.js.map] *rewrite with same content*
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"sourceMap":true},"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "sourceMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1729
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [10]:: emit js files
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 100;
+
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1700
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [11]:: with declaration and declarationMap
+
+tsgo --build --verbose --declaration --declarationMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/a.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/b.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/c.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/d.d.ts] *rewrite with same content*
+//// [/home/src/workspaces/project/d.d.ts.map] *rewrite with same content*
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"declaration":true,"declarationMap":true},"referencedMap":[[4,1],[5,2]]}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "declaration": true,
+ "declarationMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "size": 1753
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [12]:: with declaration and declarationMap, should not re-emit
+
+tsgo --build --verbose --declaration --declarationMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
diff --git a/testdata/baselines/reference/tsbuild/commandLine/different-options.js b/testdata/baselines/reference/tsbuild/commandLine/different-options.js
new file mode 100644
index 0000000000..0dead645da
--- /dev/null
+++ b/testdata/baselines/reference/tsbuild/commandLine/different-options.js
@@ -0,0 +1,1316 @@
+currentDirectory::/home/src/workspaces/project
+useCaseSensitiveFileNames::true
+Input::
+//// [/home/src/workspaces/project/a.ts] *new*
+export const a = 10;const aLocal = 10;
+//// [/home/src/workspaces/project/b.ts] *new*
+export const b = 10;const bLocal = 10;
+//// [/home/src/workspaces/project/c.ts] *new*
+import { a } from "./a";export const c = a;
+//// [/home/src/workspaces/project/d.ts] *new*
+import { b } from "./b";export const d = b;
+//// [/home/src/workspaces/project/tsconfig.json] *new*
+{
+ "compilerOptions": {
+ "composite": true
+ }
+}
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib*
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+interface ReadonlyArray {}
+interface SymbolConstructor {
+ (desc?: string | number): symbol;
+ for(name: string): symbol;
+ readonly toStringTag: symbol;
+}
+declare var Symbol: SymbolConstructor;
+interface Symbol {
+ readonly [Symbol.toStringTag]: string;
+}
+declare const console: { log(msg: any): void; };
+//// [/home/src/workspaces/project/a.d.ts] *new*
+export declare const a = 10;
+
+//// [/home/src/workspaces/project/a.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 10;
+
+//// [/home/src/workspaces/project/b.d.ts] *new*
+export declare const b = 10;
+
+//// [/home/src/workspaces/project/b.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+
+//// [/home/src/workspaces/project/c.d.ts] *new*
+export declare const c = 10;
+
+//// [/home/src/workspaces/project/c.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+
+//// [/home/src/workspaces/project/d.d.ts] *new*
+export declare const d = 10;
+
+//// [/home/src/workspaces/project/d.js] *new*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "composite": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "latestChangedDtsFile": "./d.d.ts",
+ "size": 1762
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+*refresh* /home/src/tslibs/TS/Lib/lib.d.ts
+*refresh* /home/src/workspaces/project/a.ts
+*refresh* /home/src/workspaces/project/b.ts
+*refresh* /home/src/workspaces/project/c.ts
+*refresh* /home/src/workspaces/project/d.ts
+Signatures::
+(stored at emit) /home/src/workspaces/project/a.ts
+(stored at emit) /home/src/workspaces/project/b.ts
+(stored at emit) /home/src/workspaces/project/c.ts
+(stored at emit) /home/src/workspaces/project/d.ts
+
+
+Edit [0]:: with sourceMap
+
+tsgo --build --verbose --sourceMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 10;
+//# sourceMappingURL=a.js.map
+//// [/home/src/workspaces/project/a.js.map] *new*
+{"version":3,"file":"a.js","sourceRoot":"","sources":["a.ts"],"names":[],"mappings":";;;AAAa,QAAA,CAAC,GAAG,EAAE,CAAC;AAAA,MAAM,MAAM,GAAG,EAAE,CAAC"}
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+//# sourceMappingURL=b.js.map
+//// [/home/src/workspaces/project/b.js.map] *new*
+{"version":3,"file":"b.js","sourceRoot":"","sources":["b.ts"],"names":[],"mappings":";;;AAAa,QAAA,CAAC,GAAG,EAAE,CAAC;AAAA,MAAM,MAAM,GAAG,EAAE,CAAC"}
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+//# sourceMappingURL=c.js.map
+//// [/home/src/workspaces/project/c.js.map] *new*
+{"version":3,"file":"c.js","sourceRoot":"","sources":["c.ts"],"names":[],"mappings":";;;AAAA,2BAAwB;AAAa,QAAA,CAAC,GAAG,KAAC,CAAC"}
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+//# sourceMappingURL=d.js.map
+//// [/home/src/workspaces/project/d.js.map] *new*
+{"version":3,"file":"d.js","sourceRoot":"","sources":["d.ts"],"names":[],"mappings":";;;AAAA,2BAAwB;AAAa,QAAA,CAAC,GAAG,KAAC,CAAC"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true,"sourceMap":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "composite": true,
+ "sourceMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "latestChangedDtsFile": "./d.d.ts",
+ "size": 1779
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [1]:: should re-emit only js so they dont contain sourcemap
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 10;
+
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "composite": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "latestChangedDtsFile": "./d.d.ts",
+ "size": 1762
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [2]:: with declaration should not emit anything
+
+tsgo --build --verbose --declaration
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'd.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
+
+
+Edit [3]:: no change
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'd.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
+
+
+Edit [4]:: with declaration and declarationMap
+
+tsgo --build --verbose --declaration --declarationMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.d.ts] *modified*
+export declare const a = 10;
+//# sourceMappingURL=a.d.ts.map
+//// [/home/src/workspaces/project/a.d.ts.map] *new*
+{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["a.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,CAAC,KAAK,CAAC"}
+//// [/home/src/workspaces/project/b.d.ts] *modified*
+export declare const b = 10;
+//# sourceMappingURL=b.d.ts.map
+//// [/home/src/workspaces/project/b.d.ts.map] *new*
+{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["b.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,CAAC,KAAK,CAAC"}
+//// [/home/src/workspaces/project/c.d.ts] *modified*
+export declare const c = 10;
+//# sourceMappingURL=c.d.ts.map
+//// [/home/src/workspaces/project/c.d.ts.map] *new*
+{"version":3,"file":"c.d.ts","sourceRoot":"","sources":["c.ts"],"names":[],"mappings":"AAAwB,eAAO,MAAM,CAAC,KAAI,CAAC"}
+//// [/home/src/workspaces/project/d.d.ts] *modified*
+export declare const d = 10;
+//# sourceMappingURL=d.d.ts.map
+//// [/home/src/workspaces/project/d.d.ts.map] *new*
+{"version":3,"file":"d.d.ts","sourceRoot":"","sources":["d.ts"],"names":[],"mappings":"AAAwB,eAAO,MAAM,CAAC,KAAI,CAAC"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true,"declaration":true,"declarationMap":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "composite": true,
+ "declaration": true,
+ "declarationMap": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "latestChangedDtsFile": "./d.d.ts",
+ "size": 1803
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [5]:: should re-emit only dts so they dont contain sourcemap
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.d.ts] *modified*
+export declare const a = 10;
+
+//// [/home/src/workspaces/project/b.d.ts] *modified*
+export declare const b = 10;
+
+//// [/home/src/workspaces/project/c.d.ts] *modified*
+export declare const c = 10;
+
+//// [/home/src/workspaces/project/d.d.ts] *modified*
+export declare const d = 10;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "6f850043fadb2d6b35e16ae1adaad5a5-export const a = 10;const aLocal = 10;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "composite": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "latestChangedDtsFile": "./d.d.ts",
+ "size": 1762
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+Signatures::
+
+
+Edit [6]:: with emitDeclarationOnly should not emit anything
+
+tsgo --build --verbose --emitDeclarationOnly
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'd.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
+
+
+Edit [7]:: no change
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'd.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
+
+
+Edit [8]:: local change
+//// [/home/src/workspaces/project/a.ts] *modified*
+export const a = 10;const aLocal = 100;
+
+tsgo --build --verbose
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts'
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 100;
+
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./a.ts",
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;",
+ "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./b.ts",
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;",
+ "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./c.ts",
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;",
+ "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ },
+ {
+ "fileName": "./d.ts",
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;",
+ "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n",
+ "impliedNodeFormat": 1
+ }
+ }
+ ],
+ "fileIdsList": [
+ [
+ "./a.ts"
+ ],
+ [
+ "./b.ts"
+ ]
+ ],
+ "options": {
+ "composite": true
+ },
+ "referencedMap": {
+ "./c.ts": [
+ "./a.ts"
+ ],
+ "./d.ts": [
+ "./b.ts"
+ ]
+ },
+ "latestChangedDtsFile": "./d.d.ts",
+ "size": 1763
+}
+
+tsconfig.json::
+SemanticDiagnostics::
+*refresh* /home/src/workspaces/project/a.ts
+Signatures::
+(computed .d.ts) /home/src/workspaces/project/a.ts
+
+
+Edit [9]:: with declaration should not emit anything
+
+tsgo --build --verbose --declaration
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo'
+
+
+
+
+Edit [10]:: with inlineSourceMap
+
+tsgo --build --verbose --inlineSourceMap
+ExitStatus:: Success
+Output::
+[[90mHH:MM:SS AM[0m] Projects in this build:
+ * tsconfig.json
+
+[[90mHH:MM:SS AM[0m] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions
+
+[[90mHH:MM:SS AM[0m] Building project 'tsconfig.json'...
+
+//// [/home/src/workspaces/project/a.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.a = void 0;
+exports.a = 10;
+const aLocal = 100;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQWEsUUFBQSxDQUFDLEdBQUcsRUFBRSxDQUFDO0FBQUEsTUFBTSxNQUFNLEdBQUcsR0FBRyxDQUFDIn0=
+//// [/home/src/workspaces/project/b.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.b = void 0;
+exports.b = 10;
+const bLocal = 10;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQWEsUUFBQSxDQUFDLEdBQUcsRUFBRSxDQUFDO0FBQUEsTUFBTSxNQUFNLEdBQUcsRUFBRSxDQUFDIn0=
+//// [/home/src/workspaces/project/c.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.c = void 0;
+const a_1 = require("./a");
+exports.c = a_1.a;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMkJBQXdCO0FBQWEsUUFBQSxDQUFDLEdBQUcsS0FBQyxDQUFDIn0=
+//// [/home/src/workspaces/project/d.js] *modified*
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.d = void 0;
+const b_1 = require("./b");
+exports.d = b_1.b;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMkJBQXdCO0FBQWEsUUFBQSxDQUFDLEdBQUcsS0FBQyxDQUFDIn0=
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified*
+{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c74d6b68e2cb0ed4cb8c18e3879119d9-export const a = 10;const aLocal = 100;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"bf1b9c3562b043596607d537fbaf9814-export const b = 10;const bLocal = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"28822e22fad7308e03af07d91b210c8f-import { a } from \"./a\";export const c = a;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1},{"version":"b392c90ba2c0413defc12f6bbf323140-import { b } from \"./b\";export const d = b;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true,"inlineSourceMap":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"}
+//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified*
+{
+ "version": "FakeTSVersion",
+ "root": [
+ {
+ "files": [
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "original": [
+ 2,
+ 5
+ ]
+ }
+ ],
+ "fileNames": [
+ "lib.d.ts",
+ "./a.ts",
+ "./b.ts",
+ "./c.ts",
+ "./d.ts"
+ ],
+ "fileInfos": [
+ {
+ "fileName": "lib.d.ts",
+ "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedNodeFormat": "CommonJS",
+ "original": {
+ "version": "8859c12c614ce56ba9a18e58384a198f-///