diff --git a/cmd/tsgo/sys.go b/cmd/tsgo/sys.go index 6f28371e77..e5b2b8d569 100644 --- a/cmd/tsgo/sys.go +++ b/cmd/tsgo/sys.go @@ -7,7 +7,7 @@ import ( "time" "github.com/microsoft/typescript-go/internal/bundled" - "github.com/microsoft/typescript-go/internal/execute" + "github.com/microsoft/typescript-go/internal/execute/tsc" "github.com/microsoft/typescript-go/internal/tspath" "github.com/microsoft/typescript-go/internal/vfs" "github.com/microsoft/typescript-go/internal/vfs/osvfs" @@ -63,7 +63,7 @@ func newSystem() *osSys { cwd, err := os.Getwd() if err != nil { fmt.Fprintf(os.Stderr, "Error getting current directory: %v\n", err) - os.Exit(int(execute.ExitStatusInvalidProject_OutputsSkipped)) + os.Exit(int(tsc.ExitStatusInvalidProject_OutputsSkipped)) } return &osSys{ 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 1d164bcce3..397ad9cbef 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -540,7 +540,7 @@ type Program interface { SourceFileMayBeEmitted(sourceFile *ast.SourceFile, forceDtsEmit bool) bool IsSourceFromProjectReference(path tspath.Path) bool IsSourceFileDefaultLibrary(path tspath.Path) bool - GetSourceAndProjectReference(path tspath.Path) *tsoptions.SourceAndProjectReference + GetProjectReferenceFromOutputDts(path tspath.Path) *tsoptions.SourceOutputAndProjectReference GetRedirectForResolution(file ast.HasFileName) *tsoptions.ParsedCommandLine CommonSourceDirectory() string } @@ -6483,7 +6483,7 @@ func (c *Checker) checkAliasSymbol(node *ast.Node) { } if c.compilerOptions.VerbatimModuleSyntax.IsTrue() && !ast.IsTypeOnlyImportOrExportDeclaration(node) && node.Flags&ast.NodeFlagsAmbient == 0 && targetFlags&ast.SymbolFlagsConstEnum != 0 { constEnumDeclaration := target.ValueDeclaration - redirect := c.program.GetSourceAndProjectReference(ast.GetSourceFileOfNode(constEnumDeclaration).Path()) + redirect := c.program.GetProjectReferenceFromOutputDts(ast.GetSourceFileOfNode(constEnumDeclaration).Path()) if constEnumDeclaration.Flags&ast.NodeFlagsAmbient != 0 && (redirect == nil || !redirect.Resolved.CompilerOptions().ShouldPreserveConstEnums()) { c.error(node, diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, c.getIsolatedModulesLikeFlagName()) } @@ -7204,7 +7204,7 @@ func (c *Checker) checkConstEnumAccess(node *ast.Node, t *Type) { if c.compilerOptions.IsolatedModules.IsTrue() || c.compilerOptions.VerbatimModuleSyntax.IsTrue() && ok && c.resolveName(node, ast.GetFirstIdentifier(node).Text(), ast.SymbolFlagsAlias, nil, false, true) == nil { debug.Assert(t.symbol.Flags&ast.SymbolFlagsConstEnum != 0) constEnumDeclaration := t.symbol.ValueDeclaration - redirect := c.program.GetSourceAndProjectReference(ast.GetSourceFileOfNode(constEnumDeclaration).Path()) + redirect := c.program.GetProjectReferenceFromOutputDts(ast.GetSourceFileOfNode(constEnumDeclaration).Path()) if constEnumDeclaration.Flags&ast.NodeFlagsAmbient != 0 && !ast.IsValidTypeOnlyAliasUseSite(node) && (redirect == nil || !redirect.Resolved.CompilerOptions().ShouldPreserveConstEnums()) { c.error(node, diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, c.getIsolatedModulesLikeFlagName()) } @@ -14636,7 +14636,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 @@ -14689,7 +14689,7 @@ func (c *Checker) resolveExternalModule(location *ast.Node, moduleReference stri if moduleNotFoundError != nil { // See if this was possibly a projectReference redirect if resolvedModule.IsResolved() { - redirect := c.program.GetOutputAndProjectReference(tspath.ToPath(resolvedModule.ResolvedFileName, c.program.GetCurrentDirectory(), c.program.UseCaseSensitiveFileNames())) + redirect := c.program.GetProjectReferenceFromSource(tspath.ToPath(resolvedModule.ResolvedFileName, c.program.GetCurrentDirectory(), c.program.UseCaseSensitiveFileNames())) if redirect != nil && redirect.OutputDts != "" { c.error( errorNode, 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/emitHost.go b/internal/compiler/emitHost.go index cf6f68dee6..fcc0406342 100644 --- a/internal/compiler/emitHost.go +++ b/internal/compiler/emitHost.go @@ -78,8 +78,8 @@ func (host *emitHost) GetSourceOfProjectReferenceIfOutputIncluded(file ast.HasFi return host.program.GetSourceOfProjectReferenceIfOutputIncluded(file) } -func (host *emitHost) GetOutputAndProjectReference(path tspath.Path) *tsoptions.OutputDtsAndProjectReference { - return host.program.GetOutputAndProjectReference(path) +func (host *emitHost) GetProjectReferenceFromSource(path tspath.Path) *tsoptions.SourceOutputAndProjectReference { + return host.program.GetProjectReferenceFromSource(path) } func (host *emitHost) GetRedirectTargets(path tspath.Path) []string { diff --git a/internal/compiler/emitter.go b/internal/compiler/emitter.go index 2b15feb2ff..6e6cc023bc 100644 --- a/internal/compiler/emitter.go +++ b/internal/compiler/emitter.go @@ -43,9 +43,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()) @@ -268,7 +265,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) } } @@ -292,7 +289,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) } @@ -391,7 +388,7 @@ func (e *emitter) getSourceMappingURL(mapOptions *core.CompilerOptions, sourceMa type SourceFileMayBeEmittedHost interface { Options() *core.CompilerOptions - GetOutputAndProjectReference(path tspath.Path) *tsoptions.OutputDtsAndProjectReference + GetProjectReferenceFromSource(path tspath.Path) *tsoptions.SourceOutputAndProjectReference IsSourceFileFromExternalLibrary(file *ast.SourceFile) bool GetCurrentDirectory() string UseCaseSensitiveFileNames() bool @@ -424,7 +421,7 @@ func sourceFileMayBeEmitted(sourceFile *ast.SourceFile, host SourceFileMayBeEmit // Check other conditions for file emit // Source files from referenced projects are not emitted - if host.GetOutputAndProjectReference(sourceFile.Path()) != nil { + if host.GetProjectReferenceFromSource(sourceFile.Path()) != nil { return false } 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..d18761ee29 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -143,7 +143,10 @@ func processAllProgramFiles( filesByPath := make(map[tspath.Path]*ast.SourceFile, totalFileCount) loader.includeProcessor.fileIncludeReasons = make(map[tspath.Path][]*fileIncludeReason, totalFileCount) - outputFileToProjectReferenceSource := make(map[tspath.Path]string, totalFileCount) + var outputFileToProjectReferenceSource map[tspath.Path]string + if !opts.canUseProjectReferenceSource() { + outputFileToProjectReferenceSource = make(map[tspath.Path]string, totalFileCount) + } resolvedModules := make(map[tspath.Path]module.ModeAwareCache[*module.ResolvedModule], totalFileCount+1) typeResolutionsInFile := make(map[tspath.Path]module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], totalFileCount) sourceFileMetaDatas := make(map[tspath.Path]ast.SourceFileMetaData, totalFileCount) @@ -454,9 +457,9 @@ func (p *fileLoader) resolveTypeReferenceDirectives(t *parseTask) { typeResolutionsInFile := make(module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], len(file.TypeReferenceDirectives)) var typeResolutionsTrace []string for index, ref := range file.TypeReferenceDirectives { - redirect := p.projectReferenceFileMapper.getRedirectForResolution(file) + redirect, fileName := p.projectReferenceFileMapper.getRedirectForResolution(file) resolutionMode := getModeForTypeReferenceDirectiveInFile(ref, file, meta, module.GetCompilerOptionsWithRedirect(p.opts.Config.CompilerOptions(), redirect)) - resolved, trace := p.resolver.ResolveTypeReferenceDirective(ref.FileName, file.FileName(), resolutionMode, redirect) + resolved, trace := p.resolver.ResolveTypeReferenceDirective(ref.FileName, fileName, resolutionMode, redirect) typeResolutionsInFile[module.ModeAwareCacheKey{Name: ref.FileName, Mode: resolutionMode}] = resolved includeReason := &fileIncludeReason{ kind: fileIncludeKindTypeReferenceDirective, @@ -498,7 +501,7 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { isJavaScriptFile := ast.IsSourceFileJS(file) isExternalModuleFile := ast.IsExternalModule(file) - redirect := p.projectReferenceFileMapper.getRedirectForResolution(file) + redirect, fileName := p.projectReferenceFileMapper.getRedirectForResolution(file) optionsForFile := module.GetCompilerOptionsWithRedirect(p.opts.Config.CompilerOptions(), redirect) if isJavaScriptFile || (!file.IsDeclarationFile && (optionsForFile.GetIsolatedModules() || isExternalModuleFile)) { if optionsForFile.ImportHelpers.IsTrue() { @@ -539,7 +542,7 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { } mode := getModeForUsageLocation(file.FileName(), meta, entry, optionsForFile) - resolvedModule, trace := p.resolver.ResolveModuleName(moduleName, file.FileName(), mode, redirect) + resolvedModule, trace := p.resolver.ResolveModuleName(moduleName, fileName, mode, redirect) resolutionsInFile[module.ModeAwareCacheKey{Name: moduleName, Mode: mode}] = resolvedModule resolutionsTrace = append(resolutionsTrace, trace...) @@ -550,7 +553,7 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) { resolvedFileName := resolvedModule.ResolvedFileName isFromNodeModulesSearch := resolvedModule.IsExternalLibraryImport // Don't treat redirected files as JS files. - isJsFile := !tspath.FileExtensionIsOneOf(resolvedFileName, tspath.SupportedTSExtensionsWithJsonFlat) && p.projectReferenceFileMapper.getRedirectForResolution(ast.NewHasFileName(resolvedFileName, p.toPath(resolvedFileName))) == nil + isJsFile := !tspath.FileExtensionIsOneOf(resolvedFileName, tspath.SupportedTSExtensionsWithJsonFlat) && p.projectReferenceFileMapper.getRedirectParsedCommandLineForResolution(ast.NewHasFileName(resolvedFileName, p.toPath(resolvedFileName))) == nil isJsFileFromNodeModules := isFromNodeModulesSearch && isJsFile && strings.Contains(resolvedFileName, "/node_modules/") // add file to program only if: @@ -610,19 +613,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/processingDiagnostic.go b/internal/compiler/processingDiagnostic.go index 4fde4a9caf..83bac967ab 100644 --- a/internal/compiler/processingDiagnostic.go +++ b/internal/compiler/processingDiagnostic.go @@ -67,7 +67,7 @@ func (d *processingDiagnostic) toDiagnostic(program *Program) *ast.Diagnostic { func (d *processingDiagnostic) createDiagnosticExplainingFile(program *Program) *ast.Diagnostic { diag := d.asIncludeExplainingDiagnostic() - var chain []*ast.Diagnostic + var includeDetails []*ast.Diagnostic var relatedInfo []*ast.Diagnostic var redirectInfo []*ast.Diagnostic var preferredLocation *fileIncludeReason @@ -90,7 +90,7 @@ func (d *processingDiagnostic) createDiagnosticExplainingFile(program *Program) if !seenReasons.AddIfAbsent(includeReason) { return } - chain = append(chain, includeReason.toDiagnostic(program, false)) + includeDetails = append(includeDetails, includeReason.toDiagnostic(program, false)) processRelatedInfo(includeReason) } @@ -98,7 +98,7 @@ func (d *processingDiagnostic) createDiagnosticExplainingFile(program *Program) if diag.file != "" { reasons := program.includeProcessor.fileIncludeReasons[diag.file] - chain = make([]*ast.Diagnostic, 0, len(reasons)) + includeDetails = make([]*ast.Diagnostic, 0, len(reasons)) for _, reason := range reasons { processInclude(reason) } @@ -107,9 +107,10 @@ func (d *processingDiagnostic) createDiagnosticExplainingFile(program *Program) if diag.diagnosticReason != nil { processInclude(diag.diagnosticReason) } - if chain != nil && (preferredLocation == nil || seenReasons.Len() != 1) { + var chain []*ast.Diagnostic + if includeDetails != nil && (preferredLocation == nil || seenReasons.Len() != 1) { fileReason := ast.NewCompilerDiagnostic(diagnostics.The_file_is_in_the_program_because_Colon) - fileReason.SetMessageChain(chain) + fileReason.SetMessageChain(includeDetails) chain = []*ast.Diagnostic{fileReason} } if redirectInfo != nil { diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 4f0f201134..4769f82868 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -113,9 +113,9 @@ func (p *Program) GetSourceOfProjectReferenceIfOutputIncluded(file ast.HasFileNa return file.FileName() } -// GetOutputAndProjectReference implements checker.Program. -func (p *Program) GetOutputAndProjectReference(path tspath.Path) *tsoptions.OutputDtsAndProjectReference { - return p.projectReferenceFileMapper.getOutputAndProjectReference(path) +// GetProjectReferenceFromSource implements checker.Program. +func (p *Program) GetProjectReferenceFromSource(path tspath.Path) *tsoptions.SourceOutputAndProjectReference { + return p.projectReferenceFileMapper.getProjectReferenceFromSource(path) } // IsSourceFromProjectReference implements checker.Program. @@ -123,8 +123,8 @@ func (p *Program) IsSourceFromProjectReference(path tspath.Path) bool { return p.projectReferenceFileMapper.isSourceFromProjectReference(path) } -func (p *Program) GetSourceAndProjectReference(path tspath.Path) *tsoptions.SourceAndProjectReference { - return p.projectReferenceFileMapper.getSourceAndProjectReference(path) +func (p *Program) GetProjectReferenceFromOutputDts(path tspath.Path) *tsoptions.SourceOutputAndProjectReference { + return p.projectReferenceFileMapper.getProjectReferenceFromOutputDts(path) } func (p *Program) GetResolvedProjectReferenceFor(path tspath.Path) (*tsoptions.ParsedCommandLine, bool) { @@ -132,7 +132,8 @@ func (p *Program) GetResolvedProjectReferenceFor(path tspath.Path) (*tsoptions.P } func (p *Program) GetRedirectForResolution(file ast.HasFileName) *tsoptions.ParsedCommandLine { - return p.projectReferenceFileMapper.getRedirectForResolution(file) + redirect, _ := p.projectReferenceFileMapper.getRedirectForResolution(file) + return redirect } func (p *Program) GetParseFileRedirect(fileName string) string { @@ -270,6 +271,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()) @@ -1268,11 +1270,10 @@ func (p *Program) CommonSourceDirectory() string { } type WriteFileData struct { - SourceMapUrlPos int - BuildInfo any - Diagnostics []*ast.Diagnostic - DiffersOnlyInMap bool - SkippedDtsWrite bool + SourceMapUrlPos int + BuildInfo any + Diagnostics []*ast.Diagnostic + SkippedDtsWrite bool } type EmitOptions struct { @@ -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..916dce2225 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) { @@ -197,7 +203,7 @@ func (fs *projectReferenceDtsFakingVfs) fileOrDirectoryExistsUsingSource(fileOrD } func (fs *projectReferenceDtsFakingVfs) fileExistsIfProjectReferenceDts(file string) core.Tristate { - source := fs.projectReferenceFileMapper.getSourceAndProjectReference(fs.toPath(file)) + source := fs.projectReferenceFileMapper.getProjectReferenceFromOutputDts(fs.toPath(file)) if source != nil { return core.IfElse(fs.projectReferenceFileMapper.opts.Host.FS().FileExists(source.Source), core.TSTrue, core.TSFalse) } diff --git a/internal/compiler/projectreferencefilemapper.go b/internal/compiler/projectreferencefilemapper.go index f8bd36e651..17649ec3e0 100644 --- a/internal/compiler/projectreferencefilemapper.go +++ b/internal/compiler/projectreferencefilemapper.go @@ -16,19 +16,19 @@ type projectReferenceFileMapper struct { host module.ResolutionHost loader *fileLoader // Only present during populating the mapper and parsing, released after that - configToProjectReference map[tspath.Path]*tsoptions.ParsedCommandLine // All the resolved references needed - referencesInConfigFile map[tspath.Path][]tspath.Path // Map of config file to its references - sourceToOutput map[tspath.Path]*tsoptions.OutputDtsAndProjectReference - outputDtsToSource map[tspath.Path]*tsoptions.SourceAndProjectReference + configToProjectReference map[tspath.Path]*tsoptions.ParsedCommandLine // All the resolved references needed + referencesInConfigFile map[tspath.Path][]tspath.Path // Map of config file to its references + sourceToProjectReference map[tspath.Path]*tsoptions.SourceOutputAndProjectReference + outputDtsToProjectReference map[tspath.Path]*tsoptions.SourceOutputAndProjectReference // Store all the realpath from dts in node_modules to source file from project reference needed during parsing so it can be used later - realpathDtsToSource collections.SyncMap[tspath.Path, *tsoptions.SourceAndProjectReference] + realpathDtsToSource collections.SyncMap[tspath.Path, *tsoptions.SourceOutputAndProjectReference] } func (mapper *projectReferenceFileMapper) getParseFileRedirect(file ast.HasFileName) string { if mapper.opts.canUseProjectReferenceSource() { // Map to source file from project reference - source := mapper.getSourceAndProjectReference(file.Path()) + source := mapper.getProjectReferenceFromOutputDts(file.Path()) if source == nil { source = mapper.getSourceToDtsIfSymlink(file) } @@ -37,7 +37,7 @@ func (mapper *projectReferenceFileMapper) getParseFileRedirect(file ast.HasFileN } } else { // Map to dts file from project reference - output := mapper.getOutputAndProjectReference(file.Path()) + output := mapper.getProjectReferenceFromSource(file.Path()) if output != nil && output.OutputDts != "" { return output.OutputDts } @@ -58,42 +58,47 @@ func (mapper *projectReferenceFileMapper) getResolvedProjectReferences() []*tsop return result } -func (mapper *projectReferenceFileMapper) getOutputAndProjectReference(path tspath.Path) *tsoptions.OutputDtsAndProjectReference { - return mapper.sourceToOutput[path] +func (mapper *projectReferenceFileMapper) getProjectReferenceFromSource(path tspath.Path) *tsoptions.SourceOutputAndProjectReference { + return mapper.sourceToProjectReference[path] } -func (mapper *projectReferenceFileMapper) getSourceAndProjectReference(path tspath.Path) *tsoptions.SourceAndProjectReference { - return mapper.outputDtsToSource[path] +func (mapper *projectReferenceFileMapper) getProjectReferenceFromOutputDts(path tspath.Path) *tsoptions.SourceOutputAndProjectReference { + return mapper.outputDtsToProjectReference[path] } func (mapper *projectReferenceFileMapper) isSourceFromProjectReference(path tspath.Path) bool { - return mapper.opts.canUseProjectReferenceSource() && mapper.getOutputAndProjectReference(path) != nil + return mapper.opts.canUseProjectReferenceSource() && mapper.getProjectReferenceFromSource(path) != nil } func (mapper *projectReferenceFileMapper) getCompilerOptionsForFile(file ast.HasFileName) *core.CompilerOptions { - redirect := mapper.getRedirectForResolution(file) + redirect := mapper.getRedirectParsedCommandLineForResolution(file) return module.GetCompilerOptionsWithRedirect(mapper.opts.Config.CompilerOptions(), redirect) } -func (mapper *projectReferenceFileMapper) getRedirectForResolution(file ast.HasFileName) *tsoptions.ParsedCommandLine { +func (mapper *projectReferenceFileMapper) getRedirectParsedCommandLineForResolution(file ast.HasFileName) *tsoptions.ParsedCommandLine { + redirect, _ := mapper.getRedirectForResolution(file) + return redirect +} + +func (mapper *projectReferenceFileMapper) getRedirectForResolution(file ast.HasFileName) (*tsoptions.ParsedCommandLine, string) { path := file.Path() // Check if outputdts of source file from project reference - output := mapper.getOutputAndProjectReference(path) + output := mapper.getProjectReferenceFromSource(path) if output != nil { - return output.Resolved + return output.Resolved, output.Source } // Source file from project reference - resultFromDts := mapper.getSourceAndProjectReference(path) + resultFromDts := mapper.getProjectReferenceFromOutputDts(path) if resultFromDts != nil { - return resultFromDts.Resolved + return resultFromDts.Resolved, resultFromDts.Source } realpathDtsToSource := mapper.getSourceToDtsIfSymlink(file) if realpathDtsToSource != nil { - return realpathDtsToSource.Resolved + return realpathDtsToSource.Resolved, realpathDtsToSource.Source } - return nil + return nil, file.FileName() } func (mapper *projectReferenceFileMapper) getResolvedReferenceFor(path tspath.Path) (*tsoptions.ParsedCommandLine, bool) { @@ -129,7 +134,7 @@ func (mapper *projectReferenceFileMapper) forEachResolvedReferenceWorker( } } -func (mapper *projectReferenceFileMapper) getSourceToDtsIfSymlink(file ast.HasFileName) *tsoptions.SourceAndProjectReference { +func (mapper *projectReferenceFileMapper) getSourceToDtsIfSymlink(file ast.HasFileName) *tsoptions.SourceOutputAndProjectReference { // If preserveSymlinks is true, module resolution wont jump the symlink // but the resolved real path may be the .d.ts from project reference // Note:: Currently we try the real path only if the @@ -148,7 +153,7 @@ func (mapper *projectReferenceFileMapper) getSourceToDtsIfSymlink(file ast.HasFi if realDeclarationPath == path { mapper.realpathDtsToSource.Store(path, nil) } else { - realpathDtsToSource := mapper.getSourceAndProjectReference(realDeclarationPath) + realpathDtsToSource := mapper.getProjectReferenceFromOutputDts(realDeclarationPath) if realpathDtsToSource != nil { mapper.realpathDtsToSource.Store(path, realpathDtsToSource) return realpathDtsToSource diff --git a/internal/compiler/projectreferenceparser.go b/internal/compiler/projectreferenceparser.go index 8943b1805d..e829e3c11c 100644 --- a/internal/compiler/projectreferenceparser.go +++ b/internal/compiler/projectreferenceparser.go @@ -18,7 +18,7 @@ func (t *projectReferenceParseTask) parse(projectReferenceParser *projectReferen if t.resolved == nil { return } - if t.resolved.SourceToOutput() == nil { + if t.resolved.SourceToProjectReference() == nil { projectReferenceParser.wg.Queue(func() { t.resolved.ParseInputOutputNames() }) @@ -68,10 +68,10 @@ func (p *projectReferenceParser) initMapper(tasks []*projectReferenceParseTask) totalReferences := p.tasksByFileName.Size() + 1 p.loader.projectReferenceFileMapper.configToProjectReference = make(map[tspath.Path]*tsoptions.ParsedCommandLine, totalReferences) p.loader.projectReferenceFileMapper.referencesInConfigFile = make(map[tspath.Path][]tspath.Path, totalReferences) - p.loader.projectReferenceFileMapper.sourceToOutput = make(map[tspath.Path]*tsoptions.OutputDtsAndProjectReference) - p.loader.projectReferenceFileMapper.outputDtsToSource = make(map[tspath.Path]*tsoptions.SourceAndProjectReference) + p.loader.projectReferenceFileMapper.sourceToProjectReference = make(map[tspath.Path]*tsoptions.SourceOutputAndProjectReference) + p.loader.projectReferenceFileMapper.outputDtsToProjectReference = make(map[tspath.Path]*tsoptions.SourceOutputAndProjectReference) p.loader.projectReferenceFileMapper.referencesInConfigFile[p.loader.opts.Config.ConfigFile.SourceFile.Path()] = p.initMapperWorker(tasks, &collections.Set[*projectReferenceParseTask]{}) - if p.loader.projectReferenceFileMapper.opts.canUseProjectReferenceSource() && len(p.loader.projectReferenceFileMapper.outputDtsToSource) != 0 { + if p.loader.projectReferenceFileMapper.opts.canUseProjectReferenceSource() && len(p.loader.projectReferenceFileMapper.outputDtsToProjectReference) != 0 { p.loader.projectReferenceFileMapper.host = newProjectReferenceDtsFakingHost(p.loader) } } @@ -95,11 +95,11 @@ func (p *projectReferenceParser) initMapperWorker(tasks []*projectReferenceParse if task.resolved == nil || p.loader.projectReferenceFileMapper.opts.Config.ConfigFile == task.resolved.ConfigFile { continue } - for key, value := range task.resolved.SourceToOutput() { - p.loader.projectReferenceFileMapper.sourceToOutput[key] = value + for key, value := range task.resolved.SourceToProjectReference() { + p.loader.projectReferenceFileMapper.sourceToProjectReference[key] = value } - for key, value := range task.resolved.OutputDtsToSource() { - p.loader.projectReferenceFileMapper.outputDtsToSource[key] = value + for key, value := range task.resolved.OutputDtsToProjectReference() { + p.loader.projectReferenceFileMapper.outputDtsToProjectReference[key] = value } if p.loader.projectReferenceFileMapper.opts.canUseProjectReferenceSource() { declDir := task.resolved.CompilerOptions().DeclarationDir 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/build/buildtask.go b/internal/execute/build/buildtask.go new file mode 100644 index 0000000000..8c32163e30 --- /dev/null +++ b/internal/execute/build/buildtask.go @@ -0,0 +1,578 @@ +package build + +import ( + "fmt" + "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/execute/incremental" + "github.com/microsoft/typescript-go/internal/execute/tsc" + "github.com/microsoft/typescript-go/internal/tsoptions" + "github.com/microsoft/typescript-go/internal/tspath" +) + +type buildTask struct { + config string + resolved *tsoptions.ParsedCommandLine + upStream []*buildTask + status *upToDateStatus + done chan struct{} + + // task reporting + builder strings.Builder + errors []*ast.Diagnostic + reportStatus tsc.DiagnosticReporter + diagnosticReporter tsc.DiagnosticReporter + exitStatus tsc.ExitStatus + statistics *tsc.Statistics + program *incremental.Program + pseudoBuild bool + filesToDelete []string + prevReporter *buildTask + reportDone chan struct{} +} + +func (t *buildTask) waitOnUpstream() []*upToDateStatus { + upStreamStatus := make([]*upToDateStatus, len(t.upStream)) + for i, upstream := range t.upStream { + <-upstream.done + upStreamStatus[i] = upstream.status + } + return upStreamStatus +} + +func (t *buildTask) unblockDownstream(status *upToDateStatus) { + t.status = status + close(t.done) +} + +func (t *buildTask) reportDiagnostic(err *ast.Diagnostic) { + t.errors = append(t.errors, err) + t.diagnosticReporter(err) +} + +func (t *buildTask) report(orchestrator *Orchestrator, configPath tspath.Path, buildResult *orchestratorResult) { + if t.prevReporter != nil { + <-t.prevReporter.reportDone + } + if len(t.errors) > 0 { + buildResult.errors = append(core.IfElse(buildResult.errors != nil, buildResult.errors, []*ast.Diagnostic{}), t.errors...) + } + fmt.Fprint(orchestrator.opts.Sys.Writer(), t.builder.String()) + if t.exitStatus > buildResult.result.Status { + buildResult.result.Status = t.exitStatus + } + if t.statistics != nil { + buildResult.programStats = append(buildResult.programStats, t.statistics) + } + if t.program != nil { + buildResult.result.IncrementalProgram = append(buildResult.result.IncrementalProgram, t.program) + buildResult.statistics.ProjectsBuilt++ + } + if t.pseudoBuild { + buildResult.statistics.TimestampUpdates++ + } + buildResult.filesToDelete = append(buildResult.filesToDelete, t.filesToDelete...) + close(t.reportDone) +} + +func (t *buildTask) buildProject(orchestrator *Orchestrator, path tspath.Path) { + // Wait on upstream tasks to complete + upStreamStatus := t.waitOnUpstream() + status := t.getUpToDateStatus(orchestrator, path, upStreamStatus) + t.reportUpToDateStatus(orchestrator, status) + if handled := t.handleStatusThatDoesntRequireBuild(orchestrator, status); handled == nil { + if orchestrator.opts.Command.BuildOptions.Verbose.IsTrue() { + t.reportStatus(ast.NewCompilerDiagnostic(diagnostics.Building_project_0, orchestrator.relativeFileName(t.config))) + } + + // Real build + var compileTimes tsc.CompileTimes + configAndTime, _ := orchestrator.host.resolvedReferences.Load(path) + compileTimes.ConfigTime = configAndTime.time + buildInfoReadStart := orchestrator.opts.Sys.Now() + oldProgram := incremental.ReadBuildInfoProgram(t.resolved, orchestrator.host, orchestrator.host) + compileTimes.BuildInfoReadTime = orchestrator.opts.Sys.Now().Sub(buildInfoReadStart) + parseStart := orchestrator.opts.Sys.Now() + program := compiler.NewProgram(compiler.ProgramOptions{ + Config: t.resolved, + Host: &compilerHost{ + host: orchestrator.host, + trace: tsc.GetTraceWithWriterFromSys(&t.builder, orchestrator.opts.Testing), + }, + JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors, + }) + compileTimes.ParseTime = orchestrator.opts.Sys.Now().Sub(parseStart) + changesComputeStart := orchestrator.opts.Sys.Now() + t.program = incremental.NewProgram(program, oldProgram, orchestrator.host, orchestrator.opts.Testing != nil) + compileTimes.ChangesComputeTime = orchestrator.opts.Sys.Now().Sub(changesComputeStart) + + result, statistics := tsc.EmitAndReportStatistics( + orchestrator.opts.Sys, + t.program, + program, + t.resolved, + t.reportDiagnostic, + tsc.QuietDiagnosticsReporter, + &t.builder, + compileTimes, + orchestrator.opts.Testing, + ) + t.exitStatus = result.Status + t.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 + t.updateTimeStamps(orchestrator, result.EmitResult.EmittedFiles, diagnostics.Updating_unchanged_output_timestamps_of_project_0) + } + + if result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsSkipped || result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsGenerated { + status = &upToDateStatus{kind: upToDateStatusTypeBuildErrors} + } else { + status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + } + } else { + status = handled + if t.resolved != nil { + for _, diagnostic := range t.resolved.GetConfigFileParsingDiagnostics() { + t.reportDiagnostic(diagnostic) + } + } + if len(t.errors) > 0 { + t.exitStatus = tsc.ExitStatusDiagnosticsPresent_OutputsSkipped + } + } + t.unblockDownstream(status) +} + +func (t *buildTask) handleStatusThatDoesntRequireBuild(orchestrator *Orchestrator, status *upToDateStatus) *upToDateStatus { + switch status.kind { + case upToDateStatusTypeUpToDate: + if orchestrator.opts.Command.BuildOptions.Dry.IsTrue() { + t.reportStatus(ast.NewCompilerDiagnostic(diagnostics.Project_0_is_up_to_date, t.config)) + } + return status + case upToDateStatusTypeUpstreamErrors: + upstreamStatus := status.data.(*upstreamErrors) + if orchestrator.opts.Command.BuildOptions.Verbose.IsTrue() { + t.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, + ), + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(upstreamStatus.ref), + )) + } + return status + case upToDateStatusTypeSolution: + return status + case upToDateStatusTypeConfigFileNotFound: + t.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.File_0_not_found, t.config)) + return status + } + + // update timestamps + if status.isPseudoBuild() { + if orchestrator.opts.Command.BuildOptions.Dry.IsTrue() { + t.reportStatus(ast.NewCompilerDiagnostic(diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, t.config)) + status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + return status + } + + t.updateTimeStamps(orchestrator, nil, diagnostics.Updating_output_timestamps_of_project_0) + status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + t.pseudoBuild = true + return status + } + + if orchestrator.opts.Command.BuildOptions.Dry.IsTrue() { + t.reportStatus(ast.NewCompilerDiagnostic(diagnostics.A_non_dry_build_would_build_project_0, t.config)) + status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + return status + } + return nil +} + +func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tspath.Path, upStreamStatus []*upToDateStatus) *upToDateStatus { + // Config file not found + if t.resolved == nil { + return &upToDateStatus{kind: upToDateStatusTypeConfigFileNotFound} + } + + // Solution - nothing to build + if len(t.resolved.FileNames()) == 0 && t.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 orchestrator.opts.Command.BuildOptions.StopBuildOnErrors.IsTrue() && upstreamStatus.isError() { + // Upstream project has errors, so we cannot build this project + return &upToDateStatus{kind: upToDateStatusTypeUpstreamErrors, data: &upstreamErrors{t.resolved.ProjectReferences()[index].Path, upstreamStatus.kind == upToDateStatusTypeUpstreamErrors}} + } + } + + if orchestrator.opts.Command.BuildOptions.Force.IsTrue() { + return &upToDateStatus{kind: upToDateStatusTypeForceBuild} + } + + // Check the build info + buildInfoPath := t.resolved.GetBuildInfoFileName() + buildInfo := orchestrator.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" + (!t.resolved.CompilerOptions().NoCheck.IsTrue() && (buildInfo.SemanticErrors || buildInfo.CheckPending)) { // Errors without --noCheck + return &upToDateStatus{kind: upToDateStatusTypeOutOfDateBuildInfoWithErrors, data: buildInfoPath} + } + + if t.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 (t.resolved.CompilerOptions().GetEmitDeclarations() && buildInfo.EmitDiagnosticsPerFile != nil) || // Always reported errors + (!t.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 !t.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(t.resolved, tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(buildInfoPath, orchestrator.comparePathsOptions.CurrentDirectory))) { + return &upToDateStatus{kind: upToDateStatusTypeOutOfDateOptions, data: buildInfoPath} + } + } + var inputTextUnchanged bool + oldestOutputFileAndTime := fileAndTime{buildInfoPath, orchestrator.host.GetMTime(buildInfoPath)} + var newestInputFileAndTime fileAndTime + var seenRoots collections.Set[tspath.Path] + var buildInfoRootInfoReader *incremental.BuildInfoRootInfoReader + for _, inputFile := range t.resolved.FileNames() { + inputTime := orchestrator.host.GetMTime(inputFile) + if inputTime.IsZero() { + return &upToDateStatus{kind: upToDateStatusTypeInputFileMissing, data: inputFile} + } + inputPath := orchestrator.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, orchestrator.comparePathsOptions.CurrentDirectory)), orchestrator.comparePathsOptions) + } + buildInfoFileInfo, resolvedInputPath := buildInfoRootInfoReader.GetBuildInfoFileInfo(inputPath) + if fileInfo := buildInfoFileInfo.GetFileInfo(); fileInfo != nil && fileInfo.Version() != "" { + version = fileInfo.Version() + if text, ok := orchestrator.host.FS().ReadFile(string(resolvedInputPath)); ok { + currentVersion = incremental.ComputeHash(text, orchestrator.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, orchestrator.comparePathsOptions.CurrentDirectory)), orchestrator.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 !t.resolved.CompilerOptions().IsIncremental() { + // Check output file stamps + for outputFile := range t.resolved.GetOutputFileNames() { + outputTime := orchestrator.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 orchestrator.host.hasConflictingBuildInfo(configPath) { + return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{t.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 := orchestrator.host.getLatestChangedDtsMTime(t.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{t.resolved.ProjectReferences()[index].Path, oldestOutputFileAndTime.file}} + } + + checkInputFileTime := func(inputFile string) *upToDateStatus { + inputTime := orchestrator.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 + } + + configStatus := checkInputFileTime(t.config) + if configStatus != nil { + return configStatus + } + + for _, extendedConfig := range t.resolved.ExtendedSourceFiles() { + extendedConfigStatus := checkInputFileTime(extendedConfig) + 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 (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upToDateStatus) { + if !orchestrator.opts.Command.BuildOptions.Verbose.IsTrue() { + return + } + switch status.kind { + case upToDateStatusTypeConfigFileNotFound: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_config_file_does_not_exist, + orchestrator.relativeFileName(t.config), + )) + case upToDateStatusTypeUpstreamErrors: + upstreamStatus := status.data.(*upstreamErrors) + t.reportStatus(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, + ), + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(upstreamStatus.ref), + )) + case upToDateStatusTypeUpToDate: + inputOutputFileAndTime := status.data.(*inputOutputFileAndTime) + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(inputOutputFileAndTime.input.file), + orchestrator.relativeFileName(inputOutputFileAndTime.output.file), + )) + case upToDateStatusTypeUpToDateWithUpstreamTypes: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, + orchestrator.relativeFileName(t.config), + )) + case upToDateStatusTypeUpToDateWithInputFileText: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, + orchestrator.relativeFileName(t.config), + )) + case upToDateStatusTypeInputFileMissing: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_input_1_does_not_exist, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(status.data.(string)), + )) + case upToDateStatusTypeOutputMissing: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(status.data.(string)), + )) + case upToDateStatusTypeInputFileNewer: + inputOutput := status.data.(*inputOutputName) + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(inputOutput.output), + orchestrator.relativeFileName(inputOutput.input), + )) + case upToDateStatusTypeOutOfDateBuildInfoWithPendingEmit: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(status.data.(string)), + )) + case upToDateStatusTypeOutOfDateBuildInfoWithErrors: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(status.data.(string)), + )) + case upToDateStatusTypeOutOfDateOptions: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(status.data.(string)), + )) + case upToDateStatusTypeOutOfDateRoots: + inputOutput := status.data.(*inputOutputName) + t.reportStatus(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, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(inputOutput.output), + orchestrator.relativeFileName(inputOutput.input), + )) + case upToDateStatusTypeTsVersionOutputOfDate: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, + orchestrator.relativeFileName(t.config), + orchestrator.relativeFileName(status.data.(string)), + core.Version(), + )) + case upToDateStatusTypeForceBuild: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_being_forcibly_rebuilt, + orchestrator.relativeFileName(t.config), + )) + case upToDateStatusTypeSolution: + // Does not need to report status + default: + panic(fmt.Sprintf("Unknown up to date status kind: %v", status.kind)) + } +} + +func (t *buildTask) updateTimeStamps(orchestrator *Orchestrator, emittedFiles []string, verboseMessage *diagnostics.Message) { + if t.resolved.CompilerOptions().NoEmit.IsTrue() { + return + } + emitted := collections.NewSetFromItems(emittedFiles...) + var verboseMessageReported bool + updateTimeStamp := func(file string) { + if emitted.Has(file) { + return + } + if !verboseMessageReported && orchestrator.opts.Command.BuildOptions.Verbose.IsTrue() { + t.reportStatus(ast.NewCompilerDiagnostic(verboseMessage, orchestrator.relativeFileName(t.config))) + verboseMessageReported = true + } + err := orchestrator.host.SetMTime(file, orchestrator.opts.Sys.Now()) + if err != nil { + t.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Failed_to_update_timestamp_of_file_0, file)) + } + } + + if t.resolved.CompilerOptions().IsIncremental() { + updateTimeStamp(t.resolved.GetBuildInfoFileName()) + } else { + for outputFile := range t.resolved.GetOutputFileNames() { + updateTimeStamp(outputFile) + } + } +} + +func (t *buildTask) cleanProject(orchestrator *Orchestrator, path tspath.Path) { + if t.resolved == nil { + t.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.File_0_not_found, t.config)) + t.exitStatus = tsc.ExitStatusDiagnosticsPresent_OutputsSkipped + return + } + + inputs := collections.NewSetFromItems(core.Map(t.resolved.FileNames(), orchestrator.toPath)...) + for outputFile := range t.resolved.GetOutputFileNames() { + t.cleanProjectOutput(orchestrator, outputFile, inputs) + } + t.cleanProjectOutput(orchestrator, t.resolved.GetBuildInfoFileName(), inputs) +} + +func (t *buildTask) cleanProjectOutput(orchestrator *Orchestrator, outputFile string, inputs *collections.Set[tspath.Path]) { + outputPath := orchestrator.toPath(outputFile) + // If output name is same as input file name, do not delete and ignore the error + if inputs.Has(outputPath) { + return + } + if orchestrator.host.FS().FileExists(outputFile) { + if !orchestrator.opts.Command.BuildOptions.Dry.IsTrue() { + err := orchestrator.host.FS().Remove(outputFile) + if err != nil { + t.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Failed_to_delete_file_0, outputFile)) + } + } else { + t.filesToDelete = append(t.filesToDelete, outputFile) + } + } +} diff --git a/internal/execute/build/compilerHost.go b/internal/execute/build/compilerHost.go new file mode 100644 index 0000000000..f11f06b9fc --- /dev/null +++ b/internal/execute/build/compilerHost.go @@ -0,0 +1,40 @@ +package build + +import ( + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/compiler" + "github.com/microsoft/typescript-go/internal/tsoptions" + "github.com/microsoft/typescript-go/internal/tspath" + "github.com/microsoft/typescript-go/internal/vfs" +) + +type compilerHost struct { + host *host + trace func(msg string) +} + +var _ compiler.CompilerHost = (*compilerHost)(nil) + +func (h *compilerHost) FS() vfs.FS { + return h.host.FS() +} + +func (h *compilerHost) DefaultLibraryPath() string { + return h.host.DefaultLibraryPath() +} + +func (h *compilerHost) GetCurrentDirectory() string { + return h.host.GetCurrentDirectory() +} + +func (h *compilerHost) Trace(msg string) { + h.trace(msg) +} + +func (h *compilerHost) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile { + return h.host.GetSourceFile(opts) +} + +func (h *compilerHost) GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine { + return h.host.GetResolvedProjectReference(fileName, path) +} diff --git a/internal/execute/build/graph_test.go b/internal/execute/build/graph_test.go new file mode 100644 index 0000000000..0265b99d36 --- /dev/null +++ b/internal/execute/build/graph_test.go @@ -0,0 +1,120 @@ +package build_test + +import ( + "fmt" + "slices" + "strings" + "testing" + + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/execute/build" + "github.com/microsoft/typescript-go/internal/execute/tsctests" + "github.com/microsoft/typescript-go/internal/tsoptions" + "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]any) + deps := map[string][]string{ + "A": {"B", "C"}, + "B": {"C", "D"}, + "C": {"D", "E"}, + "F": {"E"}, + "H": {"I"}, + "I": {"J"}, + "J": {"H", "E"}, + } + 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) + } + + sys := tsctests.NewTscSystem(files, true, "/home/src/workspaces/project") + args := append([]string{"--build", "--dry"}, b.projects...) + buildCommand := tsoptions.ParseBuildCommandLine(args, sys) + orchestrator := build.NewOrchestrator(build.Options{ + Sys: sys, + Command: buildCommand, + }) + orchestrator.GenerateGraph() + buildOrder := core.Map(orchestrator.Order(), b.projectName) + assert.DeepEqual(t, buildOrder, b.expected) + + for index, project := range buildOrder { + upstream := core.Map(orchestrator.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)) + } + } + } + + 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/build/host.go b/internal/execute/build/host.go new file mode 100644 index 0000000000..3f2a00c513 --- /dev/null +++ b/internal/execute/build/host.go @@ -0,0 +1,202 @@ +package build + +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/execute/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 host struct { + builder *Orchestrator + 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 = (*host)(nil) + _ compiler.CompilerHost = (*host)(nil) + _ incremental.BuildInfoReader = (*host)(nil) + _ incremental.BuildHost = (*host)(nil) +) + +func (h *host) FS() vfs.FS { + return h +} + +func (h *host) UseCaseSensitiveFileNames() bool { + return h.host.FS().UseCaseSensitiveFileNames() +} + +func (h *host) FileExists(path string) bool { + return h.host.FS().FileExists(path) +} + +func (h *host) ReadFile(path string) (string, bool) { + return h.host.FS().ReadFile(path) +} + +func (h *host) 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 *host) Remove(path string) error { + return h.host.FS().Remove(path) +} + +func (h *host) Chtimes(path string, aTime time.Time, mTime time.Time) error { + return h.host.FS().Chtimes(path, aTime, mTime) +} + +func (h *host) DirectoryExists(path string) bool { + return h.host.FS().DirectoryExists(path) +} + +func (h *host) GetAccessibleEntries(path string) vfs.Entries { + return h.host.FS().GetAccessibleEntries(path) +} + +func (h *host) Stat(path string) vfs.FileInfo { + return h.host.FS().Stat(path) +} + +func (h *host) WalkDir(root string, walkFn vfs.WalkDirFunc) error { + return h.host.FS().WalkDir(root, walkFn) +} + +func (h *host) Realpath(path string) string { + return h.host.FS().Realpath(path) +} + +func (h *host) DefaultLibraryPath() string { + return h.host.DefaultLibraryPath() +} + +func (h *host) GetCurrentDirectory() string { + return h.host.GetCurrentDirectory() +} + +func (h *host) Trace(msg string) { + panic("build.Orchestrator.host does not support tracing, use a different host for tracing") +} + +func (h *host) 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 *host) 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 *host) 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 *host) 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 *host) hasConflictingBuildInfo(configPath tspath.Path) bool { + if existing, loaded := h.buildInfos.Load(configPath); loaded { + return existing.config != configPath + } + return false +} + +func (h *host) 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 *host) 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 *host) getLatestChangedDtsMTime(config string) time.Time { + path := h.builder.toPath(config) + if existing, loaded := h.latestChangedDtsFiles.Load(path); loaded { + return existing + } + + var changedDtsMTime time.Time + if configAndTime, loaded := h.resolvedReferences.Load(path); loaded { + buildInfoPath := configAndTime.resolved.GetBuildInfoFileName() + buildInfo := h.readOrStoreBuildInfo(path, buildInfoPath) + if buildInfo != nil && buildInfo.LatestChangedDtsFile != "" { + changedDtsMTime = h.GetMTime( + tspath.GetNormalizedAbsolutePath( + buildInfo.LatestChangedDtsFile, + tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(buildInfoPath, h.GetCurrentDirectory())), + ), + ) + } + } + + changedDtsMTime, _ = h.mTimes.LoadOrStore(path, changedDtsMTime) + return changedDtsMTime +} diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go new file mode 100644 index 0000000000..27535deb86 --- /dev/null +++ b/internal/execute/build/orchestrator.go @@ -0,0 +1,236 @@ +package build + +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/execute/tsc" + "github.com/microsoft/typescript-go/internal/tsoptions" + "github.com/microsoft/typescript-go/internal/tspath" +) + +type Options struct { + Sys tsc.System + Command *tsoptions.ParsedBuildCommandLine + Testing tsc.CommandLineTesting +} + +type orchestratorResult struct { + result tsc.CommandLineResult + errors []*ast.Diagnostic + statistics tsc.Statistics + programStats []*tsc.Statistics + filesToDelete []string +} + +func (b *orchestratorResult) report(s *Orchestrator) { + tsc.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.Aggregate(b.programStats, s.opts.Sys.SinceStart()) + b.statistics.Report(s.opts.Sys.Writer(), s.opts.Testing) +} + +type Orchestrator struct { + opts Options + comparePathsOptions tspath.ComparePathsOptions + host *host + + // order generation result + tasks collections.SyncMap[tspath.Path, *buildTask] + order []string + errors []*ast.Diagnostic +} + +func (o *Orchestrator) relativeFileName(fileName string) string { + return tspath.ConvertToRelativePath(fileName, o.comparePathsOptions) +} + +func (o *Orchestrator) toPath(fileName string) tspath.Path { + return tspath.ToPath(fileName, o.comparePathsOptions.CurrentDirectory, o.comparePathsOptions.UseCaseSensitiveFileNames) +} + +func (o *Orchestrator) Order() []string { + return o.order +} + +func (o *Orchestrator) Upstream(configName string) []string { + path := o.toPath(configName) + task, ok := o.tasks.Load(path) + if !ok { + panic("No build task found for " + configName) + } + return core.Map(task.upStream, func(t *buildTask) string { + return t.config + }) +} + +func (o *Orchestrator) createBuildTasks(configs []string, wg core.WorkGroup) { + for _, config := range configs { + wg.Queue(func() { + path := o.toPath(config) + task := &buildTask{config: config} + if _, loaded := o.tasks.LoadOrStore(path, task); loaded { + return + } + task.resolved = o.host.GetResolvedProjectReference(config, path) + if task.resolved != nil { + o.createBuildTasks(task.resolved.ResolvedProjectReferencePaths(), wg) + } + }) + } +} + +func (o *Orchestrator) setupBuildTask( + configName string, + inCircularContext bool, + completed *collections.Set[tspath.Path], + analyzing *collections.Set[tspath.Path], + circularityStack []string, +) *buildTask { + path := o.toPath(configName) + task, ok := o.tasks.Load(path) + if !ok { + panic("No build task found for " + configName) + } + if !completed.Has(path) { + if analyzing.Has(path) { + if !inCircularContext { + o.errors = append(o.errors, ast.NewCompilerDiagnostic( + diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0, + strings.Join(circularityStack, "\n"), + )) + } + return nil + } + analyzing.Add(path) + circularityStack = append(circularityStack, configName) + if task.resolved != nil { + for index, subReference := range task.resolved.ResolvedProjectReferencePaths() { + upstream := o.setupBuildTask(subReference, inCircularContext || task.resolved.ProjectReferences()[index].Circular, completed, analyzing, circularityStack) + if upstream != nil { + task.upStream = append(task.upStream, upstream) + } + } + } + circularityStack = circularityStack[:len(circularityStack)-1] + completed.Add(path) + task.reportDone = make(chan struct{}) + prev := core.LastOrNil(o.order) + if prev != "" { + if prevTask, ok := o.tasks.Load(o.toPath(prev)); ok { + task.prevReporter = prevTask + } else { + panic("No previous task found for " + prev) + } + } + task.done = make(chan struct{}) + o.order = append(o.order, configName) + } + return task +} + +func (o *Orchestrator) GenerateGraph() { + o.host = &host{ + builder: o, + host: compiler.NewCachedFSCompilerHost(o.opts.Sys.GetCurrentDirectory(), o.opts.Sys.FS(), o.opts.Sys.DefaultLibraryPath(), nil, nil), + } + + projects := o.opts.Command.ResolvedProjectPaths() + // Parse all config files in parallel + wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) + o.createBuildTasks(projects, wg) + wg.RunAndWait() + + // Generate the graph + completed := collections.Set[tspath.Path]{} + analyzing := collections.Set[tspath.Path]{} + circularityStack := []string{} + for _, project := range projects { + o.setupBuildTask(project, false, &completed, &analyzing, circularityStack) + } +} + +func (o *Orchestrator) Start() tsc.CommandLineResult { + o.GenerateGraph() + build := !o.opts.Command.BuildOptions.Clean.IsTrue() + if build && o.opts.Command.BuildOptions.Verbose.IsTrue() { + o.createBuilderStatusReporter(nil)(ast.NewCompilerDiagnostic( + diagnostics.Projects_in_this_build_Colon_0, + strings.Join(core.Map(o.Order(), func(p string) string { + return "\r\n * " + o.relativeFileName(p) + }), ""), + )) + } + var buildResult orchestratorResult + if len(o.errors) == 0 { + wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) + o.tasks.Range(func(path tspath.Path, task *buildTask) bool { + task.reportStatus = o.createBuilderStatusReporter(task) + task.diagnosticReporter = o.createDiagnosticReporter(task) + wg.Queue(func() { + if build { + task.buildProject(o, path) + } else { + task.cleanProject(o, path) + } + task.report(o, path, &buildResult) + }) + return true + }) + wg.RunAndWait() + buildResult.statistics.Projects = len(o.Order()) + } else { + buildResult.result.Status = tsc.ExitStatusProjectReferenceCycle_OutputsSkipped + reportDiagnostic := o.createDiagnosticReporter(nil) + for _, err := range o.errors { + reportDiagnostic(err) + } + buildResult.errors = o.errors + } + buildResult.report(o) + return buildResult.result +} + +func (o *Orchestrator) getWriter(task *buildTask) io.Writer { + if task == nil { + return o.opts.Sys.Writer() + } + return &task.builder +} + +func (o *Orchestrator) createBuilderStatusReporter(task *buildTask) tsc.DiagnosticReporter { + return tsc.CreateBuilderStatusReporter(o.opts.Sys, o.getWriter(task), o.opts.Command.CompilerOptions, o.opts.Testing) +} + +func (o *Orchestrator) createDiagnosticReporter(task *buildTask) tsc.DiagnosticReporter { + return tsc.CreateDiagnosticReporter(o.opts.Sys, o.getWriter(task), o.opts.Command.CompilerOptions) +} + +func NewOrchestrator(opts Options) *Orchestrator { + return &Orchestrator{ + opts: opts, + comparePathsOptions: tspath.ComparePathsOptions{ + CurrentDirectory: opts.Sys.GetCurrentDirectory(), + UseCaseSensitiveFileNames: opts.Sys.FS().UseCaseSensitiveFileNames(), + }, + } +} diff --git a/internal/execute/build/uptodatestatus.go b/internal/execute/build/uptodatestatus.go new file mode 100644 index 0000000000..8d6218b2f9 --- /dev/null +++ b/internal/execute/build/uptodatestatus.go @@ -0,0 +1,107 @@ +package build + +import "time" + +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) 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 +} diff --git a/internal/incremental/affectedfileshandler.go b/internal/execute/incremental/affectedfileshandler.go similarity index 100% rename from internal/incremental/affectedfileshandler.go rename to internal/execute/incremental/affectedfileshandler.go diff --git a/internal/incremental/buildInfo.go b/internal/execute/incremental/buildInfo.go similarity index 60% rename from internal/incremental/buildInfo.go rename to internal/execute/incremental/buildInfo.go index bf537e0084..ab5b622363 100644 --- a/internal/incremental/buildInfo.go +++ b/internal/execute/incremental/buildInfo.go @@ -2,6 +2,7 @@ package incremental import ( "fmt" + "iter" "github.com/go-json-experiment/json" "github.com/go-json-experiment/json/jsontext" @@ -17,52 +18,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 { + var start int + if err := json.Unmarshal(data, &start); err != nil { + var name string + if err := json.Unmarshal(data, &name); err != nil { + return fmt.Errorf("invalid BuildInfoRoot: %s", data) + } + *b = BuildInfoRoot{ + NonIncremental: name, + } + return nil + } + *b = BuildInfoRoot{ + Start: BuildInfoFileId(start), + } + return nil + } + *b = BuildInfoRoot{ + Start: BuildInfoFileId(startAndEnd[0]), + End: BuildInfoFileId(startAndEnd[1]), + } + return nil +} type buildInfoFileInfoNoSignature struct { Version string `json:"version,omitzero"` @@ -109,6 +114,9 @@ func newBuildInfoFileInfo(fileInfo *fileInfo) *BuildInfoFileInfo { } func (b *BuildInfoFileInfo) GetFileInfo() *fileInfo { + if b == nil { + return nil + } if b.signature != "" { return &fileInfo{ version: b.signature, @@ -147,20 +155,20 @@ func (b *BuildInfoFileInfo) MarshalJSON() ([]byte, error) { func (b *BuildInfoFileInfo) UnmarshalJSON(data []byte) error { var vSignature string - if err := json.Unmarshal(data, &vSignature); err == nil { - *b = BuildInfoFileInfo{signature: vSignature} - return nil - } - var noSignature buildInfoFileInfoNoSignature - if err := json.Unmarshal(data, &noSignature); err == nil && noSignature.NoSignature { + if err := json.Unmarshal(data, &vSignature); err != nil { + var noSignature buildInfoFileInfoNoSignature + if err := json.Unmarshal(data, &noSignature); err != nil || !noSignature.NoSignature { + var fileInfo buildInfoFileInfoWithSignature + if err := json.Unmarshal(data, &fileInfo); err != nil { + return fmt.Errorf("invalid BuildInfoFileInfo: %s", data) + } + *b = BuildInfoFileInfo{fileInfo: &fileInfo} + return nil + } *b = BuildInfoFileInfo{noSignature: &noSignature} return nil } - var fileInfo buildInfoFileInfoWithSignature - if err := json.Unmarshal(data, &fileInfo); err != nil { - return fmt.Errorf("invalid BuildInfoFileInfo: %s", data) - } - *b = BuildInfoFileInfo{fileInfo: &fileInfo} + *b = BuildInfoFileInfo{signature: vSignature} return nil } @@ -251,20 +259,20 @@ func (b *BuildInfoSemanticDiagnostic) MarshalJSON() ([]byte, error) { func (b *BuildInfoSemanticDiagnostic) UnmarshalJSON(data []byte) error { var fileId BuildInfoFileId - if err := json.Unmarshal(data, &fileId); err == nil { - *b = BuildInfoSemanticDiagnostic{ - FileId: fileId, + if err := json.Unmarshal(data, &fileId); err != nil { + var diagnostics BuildInfoDiagnosticsOfFile + if err := json.Unmarshal(data, &diagnostics); err != nil { + return fmt.Errorf("invalid BuildInfoSemanticDiagnostic: %s", data) } - return nil - } - var diagnostics BuildInfoDiagnosticsOfFile - if err := json.Unmarshal(data, &diagnostics); err == nil { *b = BuildInfoSemanticDiagnostic{ Diagnostics: &diagnostics, } return nil } - return fmt.Errorf("invalid BuildInfoSemanticDiagnostic: %s", data) + *b = BuildInfoSemanticDiagnostic{ + FileId: fileId, + } + return nil } // fileId if pending emit is same as what compilerOptions suggest @@ -289,30 +297,32 @@ func (b *BuildInfoFilePendingEmit) MarshalJSON() ([]byte, error) { func (b *BuildInfoFilePendingEmit) UnmarshalJSON(data []byte) error { var fileId BuildInfoFileId - if err := json.Unmarshal(data, &fileId); err == nil { - *b = BuildInfoFilePendingEmit{ - FileId: fileId, + if err := json.Unmarshal(data, &fileId); err != nil { + var intTuple []int + if err := json.Unmarshal(data, &intTuple); err != nil || len(intTuple) == 0 { + return fmt.Errorf("invalid BuildInfoFilePendingEmit: %s", data) } - return nil - } - var intTuple []int - if err := json.Unmarshal(data, &intTuple); err == nil { - if len(intTuple) == 1 { + switch len(intTuple) { + case 1: *b = BuildInfoFilePendingEmit{ FileId: BuildInfoFileId(intTuple[0]), EmitKind: FileEmitKindDts, } return nil - } else if len(intTuple) == 2 { + case 2: *b = BuildInfoFilePendingEmit{ FileId: BuildInfoFileId(intTuple[0]), EmitKind: FileEmitKind(intTuple[1]), } return nil + default: + return fmt.Errorf("invalid BuildInfoFilePendingEmit: expected 1 or 2 integers, got %d", len(intTuple)) } - return fmt.Errorf("invalid BuildInfoFilePendingEmit: expected 1 or 2 integers, got %d", len(intTuple)) } - return fmt.Errorf("invalid BuildInfoFilePendingEmit: %s", data) + *b = BuildInfoFilePendingEmit{ + FileId: fileId, + } + return nil } // [fileId, signature] if different from file's signature @@ -367,59 +377,86 @@ func (b *BuildInfoEmitSignature) MarshalJSON() ([]byte, error) { func (b *BuildInfoEmitSignature) UnmarshalJSON(data []byte) error { var fileId BuildInfoFileId - if err := json.Unmarshal(data, &fileId); err == nil { - *b = BuildInfoEmitSignature{ - FileId: fileId, + if err := json.Unmarshal(data, &fileId); err != nil { + var fileIdAndSignature []any + if err := json.Unmarshal(data, &fileIdAndSignature); err != nil { + return fmt.Errorf("invalid BuildInfoEmitSignature: %s", data) } - return nil - } - var fileIdAndSignature []any - if err := json.Unmarshal(data, &fileIdAndSignature); err == nil { - if len(fileIdAndSignature) == 2 { - var fileId BuildInfoFileId - if id, ok := fileIdAndSignature[0].(float64); ok { - fileId = BuildInfoFileId(id) + if len(fileIdAndSignature) != 2 { + return fmt.Errorf("invalid BuildInfoEmitSignature: expected 2 elements, got %d", len(fileIdAndSignature)) + } + var fileId BuildInfoFileId + if id, ok := fileIdAndSignature[0].(float64); !ok { + return fmt.Errorf("invalid fileId in BuildInfoEmitSignature: expected float64, got %T", fileIdAndSignature[0]) + } else { + fileId = BuildInfoFileId(id) + } + var signature string + var differsOnlyInDtsMap, differsInOptions bool + if signatureV, ok := fileIdAndSignature[1].(string); !ok { + if signatureList, ok := fileIdAndSignature[1].([]any); !ok { + return fmt.Errorf("invalid signature in BuildInfoEmitSignature: expected string or []string, got %T", fileIdAndSignature[1]) } else { - return fmt.Errorf("invalid fileId in BuildInfoEmitSignature: expected float64, got %T", fileIdAndSignature[0]) - } - var signature string - var differsOnlyInDtsMap, differsInOptions bool - if signatureV, ok := fileIdAndSignature[1].(string); !ok { - if signatureList, ok := fileIdAndSignature[1].([]string); ok { - if len(signatureList) == 0 { - differsOnlyInDtsMap = true - } else if len(signatureList) == 1 { - signature = signatureList[0] - differsInOptions = true + switch len(signatureList) { + case 0: + differsOnlyInDtsMap = true + case 1: + if sig, ok := signatureList[0].(string); !ok { + return fmt.Errorf("invalid signature in BuildInfoEmitSignature: expected string, got %T", signatureList[0]) } else { - return fmt.Errorf("invalid signature in BuildInfoEmitSignature: expected string or []string with 0 or 1 element, got %d elements", len(signatureList)) + signature = sig + differsInOptions = true } - } else { - return fmt.Errorf("invalid signature in BuildInfoEmitSignature: expected string or []string, got %T", fileIdAndSignature[1]) + default: + return fmt.Errorf("invalid signature in BuildInfoEmitSignature: expected string or []string with 0 or 1 element, got %d elements", len(signatureList)) } - } else { - signature = signatureV - } - *b = BuildInfoEmitSignature{ - FileId: fileId, - Signature: signature, - DiffersOnlyInDtsMap: differsOnlyInDtsMap, - DiffersInOptions: differsInOptions, } - return nil + } else { + signature = signatureV + } + *b = BuildInfoEmitSignature{ + FileId: fileId, + Signature: signature, + DiffersOnlyInDtsMap: differsOnlyInDtsMap, + DiffersInOptions: differsInOptions, } - return fmt.Errorf("invalid BuildInfoEmitSignature: expected 2 elements, got %d", len(fileIdAndSignature)) + return nil + } - return fmt.Errorf("invalid BuildInfoEmitSignature: %s", data) + *b = BuildInfoEmitSignature{ + FileId: fileId, + } + return nil +} + +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 { + return fmt.Errorf("invalid BuildInfoResolvedRoot: %s", data) + } + *b = BuildInfoResolvedRoot{ + Resolved: BuildInfoFileId(resolvedAndRoot[0]), + Root: BuildInfoFileId(resolvedAndRoot[1]), + } + return nil } 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 +470,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 +484,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 +507,78 @@ 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 { + resolvedRootFileInfos := make(map[tspath.Path]*BuildInfoFileInfo, len(b.FileNames)) + // Roots of the File + rootToResolved := collections.NewOrderedMapWithSizeHint[tspath.Path, tspath.Path](len(b.FileNames)) + resolvedToRoot := make(map[tspath.Path]tspath.Path, len(b.ResolvedRoot)) + toPath := func(fileName string) tspath.Path { + return tspath.ToPath(fileName, buildInfoDirectory, comparePathOptions.UseCaseSensitiveFileNames) + } + + // Create map from resolvedRoot to Root + for _, resolved := range b.ResolvedRoot { + resolvedToRoot[toPath(b.fileName(resolved.Resolved))] = toPath(b.fileName(resolved.Root)) + } + + addRoot := func(resolvedRoot string, fileInfo *BuildInfoFileInfo) { + resolvedRootPath := toPath(resolvedRoot) + if rootPath, ok := resolvedToRoot[resolvedRootPath]; ok { + rootToResolved.Set(rootPath, resolvedRootPath) + } else { + rootToResolved.Set(resolvedRootPath, resolvedRootPath) + } + if fileInfo != nil { + resolvedRootFileInfos[resolvedRootPath] = 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)) + } + } + } + + return &BuildInfoRootInfoReader{ + resolvedRootFileInfos: resolvedRootFileInfos, + rootToResolved: rootToResolved, + } +} + +type BuildInfoRootInfoReader struct { + resolvedRootFileInfos map[tspath.Path]*BuildInfoFileInfo + rootToResolved *collections.OrderedMap[tspath.Path, tspath.Path] +} + +func (b *BuildInfoRootInfoReader) GetBuildInfoFileInfo(inputFilePath tspath.Path) (*BuildInfoFileInfo, tspath.Path) { + if info, ok := b.resolvedRootFileInfos[inputFilePath]; ok { + return info, inputFilePath + } + if resolved, ok := b.rootToResolved.Get(inputFilePath); ok { + return b.resolvedRootFileInfos[resolved], resolved + } + return nil, "" +} + +func (b *BuildInfoRootInfoReader) Roots() iter.Seq[tspath.Path] { + return b.rootToResolved.Keys() +} diff --git a/internal/incremental/buildinfotosnapshot.go b/internal/execute/incremental/buildinfotosnapshot.go similarity index 99% rename from internal/incremental/buildinfotosnapshot.go rename to internal/execute/incremental/buildinfotosnapshot.go index 67a49c0cea..309ed32c95 100644 --- a/internal/incremental/buildinfotosnapshot.go +++ b/internal/execute/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/execute/incremental/emitfileshandler.go similarity index 83% rename from internal/incremental/emitfileshandler.go rename to internal/execute/incremental/emitfileshandler.go index 6f2937815b..9ff05cfe19 100644 --- a/internal/incremental/emitfileshandler.go +++ b/internal/execute/incremental/emitfileshandler.go @@ -2,7 +2,7 @@ package incremental import ( "context" - "slices" + "time" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" @@ -22,7 +22,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] } @@ -147,6 +147,7 @@ func (h *emitFilesHandler) getEmitOptions(options compiler.EmitOptions) compiler TargetSourceFile: options.TargetSourceFile, EmitOnly: options.EmitOnly, WriteFile: func(fileName string, text string, writeByteOrderMark bool, data *compiler.WriteFileData) error { + var differsOnlyInMap bool if tspath.IsDeclarationFileName(fileName) { var emitSignature string info, _ := h.program.snapshot.fileInfos.Load(options.TargetSourceFile.Path()) @@ -164,22 +165,33 @@ func (h *emitFilesHandler) getEmitOptions(options compiler.EmitOptions) compiler // Store d.ts emit hash so later can be compared to check if d.ts has changed. // Currently we do this only for composite projects since these are the only projects that can be referenced by other projects // and would need their d.ts change time in --build mode - if h.skipDtsOutputOfComposite(options.TargetSourceFile, fileName, text, data, emitSignature) { + if h.skipDtsOutputOfComposite(options.TargetSourceFile, fileName, text, data, emitSignature, &differsOnlyInMap) { return nil } } + var aTime time.Time + if differsOnlyInMap { + aTime = h.program.host.GetMTime(fileName) + } + var err error if options.WriteFile != nil { - return options.WriteFile(fileName, text, writeByteOrderMark, data) + err = options.WriteFile(fileName, text, writeByteOrderMark, data) + } else { + err = h.program.program.Host().FS().WriteFile(fileName, text, writeByteOrderMark) + } + if err != nil && differsOnlyInMap { + // Revert the time to original one + err = h.program.host.SetMTime(fileName, aTime) } - return h.program.program.Host().FS().WriteFile(fileName, text, writeByteOrderMark) + return err }, } } // Compare to existing computed signature and store it or handle the changes in d.ts map option from before // returning undefined means that, we dont need to emit this d.ts file since its contents didnt change -func (h *emitFilesHandler) skipDtsOutputOfComposite(file *ast.SourceFile, outputFileName string, text string, data *compiler.WriteFileData, newSignature string) bool { +func (h *emitFilesHandler) skipDtsOutputOfComposite(file *ast.SourceFile, outputFileName string, text string, data *compiler.WriteFileData, newSignature string, differsOnlyInMap *bool) bool { if !h.program.snapshot.options.Composite.IsTrue() { return false } @@ -202,12 +214,12 @@ func (h *emitFilesHandler) skipDtsOutputOfComposite(file *ast.SourceFile, output data.SkippedDtsWrite = true return true } else { - // Mark as differsOnlyInMap so that --build can reverse the timestamp so that + // Mark as differsOnlyInMap so that we can reverse the timestamp with --build so that // the downstream projects dont detect this as change in d.ts file - data.DiffersOnlyInMap = true + *differsOnlyInMap = h.program.Options().Build.IsTrue() } } else { - h.latestChangedDtsFiles.Add(outputFileName) + h.latestChangedDtsFiles.Store(file.Path(), outputFileName) } h.emitSignatures.Store(file.Path(), &emitSignature{signature: newSignature}) return false @@ -228,32 +240,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/incremental.go b/internal/execute/incremental/incremental.go similarity index 100% rename from internal/incremental/incremental.go rename to internal/execute/incremental/incremental.go diff --git a/internal/incremental/program.go b/internal/execute/incremental/program.go similarity index 88% rename from internal/incremental/program.go rename to internal/execute/incremental/program.go index 362cea8a3c..09c50e7d19 100644 --- a/internal/incremental/program.go +++ b/internal/execute/incremental/program.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "slices" + "time" "github.com/go-json-experiment/json" "github.com/microsoft/typescript-go/internal/ast" @@ -23,19 +24,26 @@ const ( SignatureUpdateKindUsedVersion ) +type BuildHost interface { + GetMTime(fileName string) time.Time + SetMTime(fileName string, mTime time.Time) error +} + type Program struct { snapshot *snapshot program *compiler.Program semanticDiagnosticsPerFile *collections.SyncMap[tspath.Path, *diagnosticsOrBuildInfoDiagnosticsWithFileName] updatedSignatureKinds map[tspath.Path]SignatureUpdateKind + host BuildHost } var _ compiler.ProgramLike = (*Program)(nil) -func NewProgram(program *compiler.Program, oldProgram *Program, testing bool) *Program { +func NewProgram(program *compiler.Program, oldProgram *Program, buildHost BuildHost, testing bool) *Program { incrementalProgram := &Program{ snapshot: programToSnapshot(program, oldProgram, testing), program: program, + host: buildHost, } if testing { @@ -186,7 +194,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 +257,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 +289,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 since the emit diagnostics are encoded + 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 since the syntax and program diagnostics are encoded as present + 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 +333,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/execute/incremental/programtosnapshot.go similarity index 99% rename from internal/incremental/programtosnapshot.go rename to internal/execute/incremental/programtosnapshot.go index aa60746f3e..69f8cd5a7e 100644 --- a/internal/incremental/programtosnapshot.go +++ b/internal/execute/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/referencemap.go b/internal/execute/incremental/referencemap.go similarity index 100% rename from internal/incremental/referencemap.go rename to internal/execute/incremental/referencemap.go diff --git a/internal/incremental/snapshot.go b/internal/execute/incremental/snapshot.go similarity index 95% rename from internal/incremental/snapshot.go rename to internal/execute/incremental/snapshot.go index 36db50687c..1fc0222c08 100644 --- a/internal/incremental/snapshot.go +++ b/internal/execute/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 ( @@ -87,7 +96,7 @@ func getPendingEmitKind(emitKind FileEmitKind, oldEmitKind FileEmitKind) FileEmi } // If dts errors pending, add dts errors flag if (diff & FileEmitKindDtsErrors) != 0 { - result |= emitKind & FileEmitKindDtsErrors + result |= emitKind & FileEmitKindAllDts } // If there is diff in Dts emit, pending emit is dts emit flags if (diff & FileEmitKindAllDtsEmit) != 0 { @@ -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 @@ -227,7 +239,9 @@ func (s *snapshot) addFileToChangeSet(filePath tspath.Path) { func (s *snapshot) addFileToAffectedFilesPendingEmit(filePath tspath.Path, emitKind FileEmitKind) { existingKind, _ := s.affectedFilesPendingEmit.Load(filePath) s.affectedFilesPendingEmit.Store(filePath, existingKind|emitKind) - s.emitDiagnosticsPerFile.Delete(filePath) + if emitKind&FileEmitKindDtsErrors != 0 { + s.emitDiagnosticsPerFile.Delete(filePath) + } s.buildInfoEmitPending.Store(true) } @@ -295,10 +309,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/execute/incremental/snapshottobuildinfo.go similarity index 83% rename from internal/incremental/snapshottobuildinfo.go rename to internal/execute/incremental/snapshottobuildinfo.go index 8fa6dfee5a..22b3e9d1ce 100644 --- a/internal/incremental/snapshottobuildinfo.go +++ b/internal/execute/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/execute/system.go b/internal/execute/system.go deleted file mode 100644 index db7a40907b..0000000000 --- a/internal/execute/system.go +++ /dev/null @@ -1,32 +0,0 @@ -package execute - -import ( - "io" - "time" - - "github.com/microsoft/typescript-go/internal/vfs" -) - -type System interface { - Writer() io.Writer - FS() vfs.FS - DefaultLibraryPath() string - GetCurrentDirectory() string - WriteOutputIsTTY() bool - GetWidthOfTerminal() int - GetEnvironmentVariable(name string) string - - Now() time.Time - SinceStart() time.Duration -} - -type ExitStatus int - -const ( - ExitStatusSuccess ExitStatus = 0 - ExitStatusDiagnosticsPresent_OutputsSkipped ExitStatus = 1 - ExitStatusDiagnosticsPresent_OutputsGenerated ExitStatus = 2 - ExitStatusInvalidProject_OutputsSkipped ExitStatus = 3 - ExitStatusProjectReferenceCycle_OutputsSkipped ExitStatus = 4 - ExitStatusNotImplemented ExitStatus = 5 -) diff --git a/internal/execute/testfs_test.go b/internal/execute/testfs_test.go deleted file mode 100644 index 9b49e548dc..0000000000 --- a/internal/execute/testfs_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package execute_test - -import ( - "github.com/microsoft/typescript-go/internal/collections" - "github.com/microsoft/typescript-go/internal/vfs" -) - -type testFs struct { - vfs.FS - defaultLibs *collections.SyncSet[string] - writtenFiles collections.SyncSet[string] -} - -func (f *testFs) removeIgnoreLibPath(path string) { - if f.defaultLibs != nil && f.defaultLibs.Has(path) { - f.defaultLibs.Delete(path) - } -} - -// ReadFile reads the file specified by path and returns the content. -// If the file fails to be read, ok will be false. -func (f *testFs) ReadFile(path string) (contents string, ok bool) { - f.removeIgnoreLibPath(path) - return f.FS.ReadFile(path) -} - -func (f *testFs) WriteFile(path string, data string, writeByteOrderMark bool) error { - f.removeIgnoreLibPath(path) - f.writtenFiles.Add(path) - return f.FS.WriteFile(path, data, writeByteOrderMark) -} - -// Removes `path` and all its contents. Will return the first error it encounters. -func (f *testFs) Remove(path string) error { - f.removeIgnoreLibPath(path) - return f.FS.Remove(path) -} diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go index 066685a34e..226af2db9d 100644 --- a/internal/execute/tsc.go +++ b/internal/execute/tsc.go @@ -3,17 +3,17 @@ package execute import ( "context" "fmt" - "runtime" "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/execute/build" + "github.com/microsoft/typescript-go/internal/execute/incremental" + "github.com/microsoft/typescript-go/internal/execute/tsc" "github.com/microsoft/typescript-go/internal/format" - "github.com/microsoft/typescript-go/internal/incremental" "github.com/microsoft/typescript-go/internal/jsonutil" "github.com/microsoft/typescript-go/internal/parser" "github.com/microsoft/typescript-go/internal/pprof" @@ -39,27 +39,12 @@ func applyBulkEdits(text string, edits []core.TextChange) string { return b.String() } -type CommandLineResult struct { - Status ExitStatus - IncrementalProgram *incremental.Program - Watcher *Watcher -} - -type CommandLineTesting interface { - OnListFilesStart() - OnListFilesEnd() - OnStatisticsStart() - OnStatisticsEnd() - GetTrace() func(str string) -} - -func CommandLine(sys System, commandLineArgs []string, testing CommandLineTesting) CommandLineResult { +func CommandLine(sys tsc.System, commandLineArgs []string, testing tsc.CommandLineTesting) tsc.CommandLineResult { if len(commandLineArgs) > 0 { // !!! 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]) } @@ -68,14 +53,14 @@ func CommandLine(sys System, commandLineArgs []string, testing CommandLineTestin return tscCompilation(sys, tsoptions.ParseCommandLine(commandLineArgs, sys), testing) } -func fmtMain(sys System, input, output string) ExitStatus { +func fmtMain(sys tsc.System, input, output string) tsc.ExitStatus { ctx := format.WithFormatCodeSettings(context.Background(), format.GetDefaultFormatCodeSettings("\n"), "\n") input = string(tspath.ToPath(input, sys.GetCurrentDirectory(), sys.FS().UseCaseSensitiveFileNames())) output = string(tspath.ToPath(output, sys.GetCurrentDirectory(), sys.FS().UseCaseSensitiveFileNames())) fileContent, ok := sys.FS().ReadFile(input) if !ok { fmt.Fprintln(sys.Writer(), "File not found:", input) - return ExitStatusNotImplemented + return tsc.ExitStatusNotImplemented } text := fileContent pathified := tspath.ToPath(input, sys.GetCurrentDirectory(), true) @@ -89,21 +74,56 @@ func fmtMain(sys System, input, output string) ExitStatus { if err := sys.FS().WriteFile(output, newText, false); err != nil { fmt.Fprintln(sys.Writer(), err.Error()) - return ExitStatusNotImplemented + return tsc.ExitStatusNotImplemented + } + return tsc.ExitStatusSuccess +} + +func tscBuildCompilation(sys tsc.System, buildCommand *tsoptions.ParsedBuildCommandLine, testing tsc.CommandLineTesting) tsc.CommandLineResult { + reportDiagnostic := tsc.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 tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} + } + + if pprofDir := buildCommand.CompilerOptions.PprofDir; pprofDir != "" { + // !!! stderr? + profileSession := pprof.BeginProfiling(pprofDir, sys.Writer()) + defer profileSession.Stop() + } + + if buildCommand.CompilerOptions.Help.IsTrue() { + tsc.PrintVersion(sys) + tsc.PrintBuildHelp(sys, tsoptions.BuildOpts) + return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } - return ExitStatusSuccess + + // !!! sheetal watch mode + orchestrator := build.NewOrchestrator(build.Options{ + Sys: sys, + Command: buildCommand, + Testing: testing, + }) + return orchestrator.Start() } -func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testing CommandLineTesting) CommandLineResult { +func tscCompilation(sys tsc.System, commandLine *tsoptions.ParsedCommandLine, testing tsc.CommandLineTesting) tsc.CommandLineResult { configFileName := "" - reportDiagnostic := createDiagnosticReporter(sys, commandLine.CompilerOptions()) + reportDiagnostic := tsc.CreateDiagnosticReporter(sys, sys.Writer(), commandLine.CompilerOptions()) // if commandLine.Options().Locale != nil if len(commandLine.Errors) > 0 { for _, e := range commandLine.Errors { reportDiagnostic(e) } - return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsSkipped} + return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} } if pprofDir := commandLine.CompilerOptions().PprofDir; pprofDir != "" { @@ -113,28 +133,28 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin } if commandLine.CompilerOptions().Init.IsTrue() { - return CommandLineResult{Status: ExitStatusNotImplemented} + return tsc.CommandLineResult{Status: tsc.ExitStatusNotImplemented} } if commandLine.CompilerOptions().Version.IsTrue() { - printVersion(sys) - return CommandLineResult{Status: ExitStatusSuccess} + tsc.PrintVersion(sys) + return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } if commandLine.CompilerOptions().Help.IsTrue() || commandLine.CompilerOptions().All.IsTrue() { - printHelp(sys, commandLine) - return CommandLineResult{Status: ExitStatusSuccess} + tsc.PrintHelp(sys, commandLine) + return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } if commandLine.CompilerOptions().Watch.IsTrue() && commandLine.CompilerOptions().ListFilesOnly.IsTrue() { reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Options_0_and_1_cannot_be_combined, "watch", "listFilesOnly")) - return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsSkipped} + return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} } if commandLine.CompilerOptions().Project != "" { if len(commandLine.FileNames()) != 0 { reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Option_project_cannot_be_mixed_with_source_files_on_a_command_line)) - return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsSkipped} + return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} } fileOrDirectory := tspath.NormalizePath(commandLine.CompilerOptions().Project) @@ -142,13 +162,13 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin configFileName = tspath.CombinePaths(fileOrDirectory, "tsconfig.json") if !sys.FS().FileExists(configFileName) { reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, configFileName)) - return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsSkipped} + return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} } } else { configFileName = fileOrDirectory if !sys.FS().FileExists(configFileName) { reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.The_specified_path_does_not_exist_Colon_0, fileOrDirectory)) - return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsSkipped} + return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} } } } else if len(commandLine.FileNames()) == 0 { @@ -160,48 +180,50 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin if commandLine.CompilerOptions().ShowConfig.IsTrue() { reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, tspath.NormalizePath(sys.GetCurrentDirectory()))) } else { - printVersion(sys) - printHelp(sys, commandLine) + tsc.PrintVersion(sys) + tsc.PrintHelp(sys, commandLine) } - return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsSkipped} + return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped} } // !!! convert to options with absolute paths is usually done here, but for ease of implementation, it's done in `tsoptions.ParseCommandLine()` compilerOptionsFromCommandLine := commandLine.CompilerOptions() configForCompilation := commandLine var extendedConfigCache collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry] - var configTime time.Duration + var compileTimes tsc.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 { reportDiagnostic(e) } - return CommandLineResult{Status: ExitStatusDiagnosticsPresent_OutputsGenerated} + return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsGenerated} } configForCompilation = configParseResult // Updater to reflect pretty - reportDiagnostic = createDiagnosticReporter(sys, commandLine.CompilerOptions()) + reportDiagnostic = tsc.CreateDiagnosticReporter(sys, sys.Writer(), commandLine.CompilerOptions()) } + reportErrorSummary := tsc.CreateReportErrorSummary(sys, configForCompilation.CompilerOptions()) if compilerOptionsFromCommandLine.ShowConfig.IsTrue() { showConfig(sys, configForCompilation.CompilerOptions()) - return CommandLineResult{Status: ExitStatusSuccess} + return tsc.CommandLineResult{Status: tsc.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} + return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess, Watcher: watcher} } else if configForCompilation.CompilerOptions().IsIncremental() { return performIncrementalCompilation( sys, configForCompilation, reportDiagnostic, + reportErrorSummary, &extendedConfigCache, - configTime, + compileTimes, testing, ) } @@ -209,8 +231,9 @@ func tscCompilation(sys System, commandLine *tsoptions.ParsedCommandLine, testin sys, configForCompilation, reportDiagnostic, + reportErrorSummary, &extendedConfigCache, - configTime, + compileTimes, testing, ) } @@ -229,28 +252,23 @@ func findConfigFile(searchPath string, fileExists func(string) bool, configName return result } -func getTraceFromSys(sys System, testing CommandLineTesting) func(msg string) { - if testing == nil { - return func(msg string) { - fmt.Fprintln(sys.Writer(), msg) - } - } else { - return testing.GetTrace() - } +func getTraceFromSys(sys tsc.System, testing tsc.CommandLineTesting) func(msg string) { + return tsc.GetTraceWithWriterFromSys(sys.Writer(), testing) } func performIncrementalCompilation( - sys System, + sys tsc.System, config *tsoptions.ParsedCommandLine, - reportDiagnostic diagnosticReporter, + reportDiagnostic tsc.DiagnosticReporter, + reportErrorSummary tsc.DiagnosticsReporter, extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry], - configTime time.Duration, - testing CommandLineTesting, -) CommandLineResult { + compileTimes tsc.CompileTimes, + testing tsc.CommandLineTesting, +) tsc.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,36 +276,36 @@ 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) - return CommandLineResult{ - Status: emitAndReportStatistics( - sys, - incrementalProgram, - incrementalProgram.GetProgram(), - config, - reportDiagnostic, - configTime, - parseTime, - - buildInfoReadTime, - changesComputeTime, - testing, - ), - IncrementalProgram: incrementalProgram, + incrementalProgram := incremental.NewProgram(program, oldProgram, nil, testing != nil) + compileTimes.ChangesComputeTime = sys.Now().Sub(changesComputeStart) + result, _ := tsc.EmitAndReportStatistics( + sys, + incrementalProgram, + incrementalProgram.GetProgram(), + config, + reportDiagnostic, + reportErrorSummary, + sys.Writer(), + compileTimes, + testing, + ) + return tsc.CommandLineResult{ + Status: result.Status, + IncrementalProgram: []*incremental.Program{incrementalProgram}, } } func performCompilation( - sys System, + sys tsc.System, config *tsoptions.ParsedCommandLine, - reportDiagnostic diagnosticReporter, + reportDiagnostic tsc.DiagnosticReporter, + reportErrorSummary tsc.DiagnosticsReporter, extendedConfigCache *collections.SyncMap[tspath.Path, *tsoptions.ExtendedConfigCacheEntry], - configTime time.Duration, - testing CommandLineTesting, -) CommandLineResult { + compileTimes tsc.CompileTimes, + testing tsc.CommandLineTesting, +) tsc.CommandLineResult { host := compiler.NewCachedFSCompilerHost(sys.GetCurrentDirectory(), sys.FS(), sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(sys, testing)) // todo: cache, statistics, tracing parseStart := sys.Now() @@ -296,157 +314,24 @@ func performCompilation( Host: host, JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors, }) - parseTime := sys.Now().Sub(parseStart) - return CommandLineResult{ - Status: emitAndReportStatistics( - sys, - program, - program, - config, - reportDiagnostic, - configTime, - parseTime, - 0, - 0, - testing, - ), - } -} - -func emitAndReportStatistics( - sys System, - programLike compiler.ProgramLike, - program *compiler.Program, - config *tsoptions.ParsedCommandLine, - reportDiagnostic diagnosticReporter, - configTime time.Duration, - parseTime time.Duration, - buildInfoReadTime time.Duration, - changesComputeTime time.Duration, - testing CommandLineTesting, -) ExitStatus { - result := emitFilesAndReportErrors(sys, programLike, program, reportDiagnostic, testing) - if result.status != ExitStatusSuccess { - // compile exited early - return result.status - } - - result.configTime = configTime - result.parseTime = parseTime - result.buildInfoReadTime = buildInfoReadTime - result.changesComputeTime = changesComputeTime - result.totalTime = sys.SinceStart() - - if config.CompilerOptions().Diagnostics.IsTrue() || config.CompilerOptions().ExtendedDiagnostics.IsTrue() { - var memStats runtime.MemStats - // GC must be called twice to allow things to settle. - runtime.GC() - runtime.GC() - runtime.ReadMemStats(&memStats) - - reportStatistics(sys, program, result, &memStats, testing) - } - - if result.emitResult.EmitSkipped && len(result.diagnostics) > 0 { - return ExitStatusDiagnosticsPresent_OutputsSkipped - } else if len(result.diagnostics) > 0 { - return ExitStatusDiagnosticsPresent_OutputsGenerated - } - return ExitStatusSuccess -} - -type compileAndEmitResult struct { - diagnostics []*ast.Diagnostic - emitResult *compiler.EmitResult - status ExitStatus - configTime time.Duration - parseTime time.Duration - bindTime time.Duration - checkTime time.Duration - totalTime time.Duration - emitTime time.Duration - buildInfoReadTime time.Duration - changesComputeTime time.Duration -} - -func emitFilesAndReportErrors( - sys System, - programLike compiler.ProgramLike, - program *compiler.Program, - reportDiagnostic diagnosticReporter, - testing CommandLineTesting, -) (result compileAndEmitResult) { - ctx := context.Background() - - allDiagnostics := compiler.GetDiagnosticsOfAnyProgram( - ctx, - programLike, - nil, - false, - func(ctx context.Context, file *ast.SourceFile) []*ast.Diagnostic { - // Options diagnostics include global diagnostics (even though we collect them separately), - // and global diagnostics create checkers, which then bind all of the files. Do this binding - // early so we can track the time. - bindStart := sys.Now() - diags := programLike.GetBindDiagnostics(ctx, file) - result.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) - return diags - }, + compileTimes.ParseTime = sys.Now().Sub(parseStart) + result, _ := tsc.EmitAndReportStatistics( + sys, + program, + program, + config, + reportDiagnostic, + reportErrorSummary, + sys.Writer(), + compileTimes, + testing, ) - - emitResult := &compiler.EmitResult{EmitSkipped: true, Diagnostics: []*ast.Diagnostic{}} - if !programLike.Options().ListFilesOnly.IsTrue() { - emitStart := sys.Now() - emitResult = programLike.Emit(ctx, compiler.EmitOptions{}) - result.emitTime = sys.Now().Sub(emitStart) - } - if emitResult != nil { - allDiagnostics = append(allDiagnostics, emitResult.Diagnostics...) + return tsc.CommandLineResult{ + Status: result.Status, } - - allDiagnostics = compiler.SortAndDeduplicateDiagnostics(allDiagnostics) - for _, diagnostic := range allDiagnostics { - reportDiagnostic(diagnostic) - } - - listFiles(sys, program, emitResult, testing) - - createReportErrorSummary(sys, programLike.Options())(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) { +func showConfig(sys tsc.System, config *core.CompilerOptions) { // !!! _ = jsonutil.MarshalIndentWrite(sys.Writer(), config, "", " ") } - -func listFiles(sys System, 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())) - } - options := program.Options() - if options.ExplainFiles.IsTrue() { - program.ExplainFiles(sys.Writer()) - } else if options.ListFiles.IsTrue() || options.ListFilesOnly.IsTrue() { - for _, file := range program.GetSourceFiles() { - fmt.Fprintln(sys.Writer(), file.FileName()) - } - } -} diff --git a/internal/execute/tsc/compile.go b/internal/execute/tsc/compile.go new file mode 100644 index 0000000000..cceb0f4c96 --- /dev/null +++ b/internal/execute/tsc/compile.go @@ -0,0 +1,75 @@ +package tsc + +import ( + "io" + "time" + + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/compiler" + "github.com/microsoft/typescript-go/internal/execute/incremental" + "github.com/microsoft/typescript-go/internal/vfs" +) + +type System interface { + Writer() io.Writer + FS() vfs.FS + DefaultLibraryPath() string + GetCurrentDirectory() string + WriteOutputIsTTY() bool + GetWidthOfTerminal() int + GetEnvironmentVariable(name string) string + + Now() time.Time + SinceStart() time.Duration +} + +type ExitStatus int + +const ( + ExitStatusSuccess ExitStatus = 0 + ExitStatusDiagnosticsPresent_OutputsGenerated ExitStatus = 1 + ExitStatusDiagnosticsPresent_OutputsSkipped ExitStatus = 2 + ExitStatusInvalidProject_OutputsSkipped ExitStatus = 3 + ExitStatusProjectReferenceCycle_OutputsSkipped ExitStatus = 4 + ExitStatusNotImplemented ExitStatus = 5 +) + +type Watcher interface { + DoCycle() + GetProgram() *incremental.Program +} + +type CommandLineResult struct { + Status ExitStatus + IncrementalProgram []*incremental.Program + Watcher Watcher +} + +type CommandLineTesting interface { + // 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) +} + +type CompileTimes struct { + ConfigTime time.Duration + ParseTime time.Duration + bindTime time.Duration + checkTime time.Duration + totalTime time.Duration + emitTime time.Duration + BuildInfoReadTime time.Duration + ChangesComputeTime time.Duration +} +type CompileAndEmitResult struct { + Diagnostics []*ast.Diagnostic + EmitResult *compiler.EmitResult + Status ExitStatus + times CompileTimes +} diff --git a/internal/execute/tsc/diagnostics.go b/internal/execute/tsc/diagnostics.go new file mode 100644 index 0000000000..cb6154d562 --- /dev/null +++ b/internal/execute/tsc/diagnostics.go @@ -0,0 +1,147 @@ +package tsc + +import ( + "fmt" + "io" + "strings" + + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/diagnosticwriter" + "github.com/microsoft/typescript-go/internal/tspath" +) + +func getFormatOptsOfSys(sys System) *diagnosticwriter.FormattingOptions { + return &diagnosticwriter.FormattingOptions{ + NewLine: "\n", + ComparePathsOptions: tspath.ComparePathsOptions{ + CurrentDirectory: sys.GetCurrentDirectory(), + UseCaseSensitiveFileNames: sys.FS().UseCaseSensitiveFileNames(), + }, + } +} + +type DiagnosticReporter = func(*ast.Diagnostic) + +func QuietDiagnosticReporter(diagnostic *ast.Diagnostic) {} +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(w, diagnostic, formatOpts) + fmt.Fprint(w, formatOpts.NewLine) + } +} + +func defaultIsPretty(sys System) bool { + return sys.WriteOutputIsTTY() && sys.GetEnvironmentVariable("NO_COLOR") == "" +} + +func shouldBePretty(sys System, options *core.CompilerOptions) bool { + if options == nil || options.Pretty.IsUnknown() { + return defaultIsPretty(sys) + } + return options.Pretty.IsTrue() +} + +type colors struct { + showColors bool + + isWindows bool + isWindowsTerminal bool + isVSCode bool + supportsRicherColors bool +} + +func createColors(sys System) *colors { + if !defaultIsPretty(sys) { + return &colors{showColors: false} + } + + os := sys.GetEnvironmentVariable("OS") + isWindows := strings.Contains(strings.ToLower(os), "windows") + isWindowsTerminal := sys.GetEnvironmentVariable("WT_SESSION") != "" + isVSCode := sys.GetEnvironmentVariable("TERM_PROGRAM") == "vscode" + supportsRicherColors := sys.GetEnvironmentVariable("COLORTERM") == "truecolor" || sys.GetEnvironmentVariable("TERM") == "xterm-256color" + + return &colors{ + showColors: true, + isWindows: isWindows, + isWindowsTerminal: isWindowsTerminal, + isVSCode: isVSCode, + supportsRicherColors: supportsRicherColors, + } +} + +func (c *colors) bold(str string) string { + if !c.showColors { + return str + } + return "\x1b[1m" + str + "\x1b[22m" +} + +func (c *colors) blue(str string) string { + if !c.showColors { + return str + } + + // Effectively Powershell and Command prompt users use cyan instead + // of blue because the default theme doesn't show blue with enough contrast. + if c.isWindows && !c.isWindowsTerminal && !c.isVSCode { + return c.brightWhite(str) + } + return "\x1b[94m" + str + "\x1b[39m" +} + +func (c *colors) blueBackground(str string) string { + if !c.showColors { + return str + } + if c.supportsRicherColors { + return "\x1B[48;5;68m" + str + "\x1B[39;49m" + } else { + return "\x1b[44m" + str + "\x1B[39;49m" + } +} + +func (c *colors) brightWhite(str string) string { + if !c.showColors { + return str + } + return "\x1b[97m" + str + "\x1b[39m" +} + +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 QuietDiagnosticsReporter +} + +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) + } +} diff --git a/internal/execute/tsc/emit.go b/internal/execute/tsc/emit.go new file mode 100644 index 0000000000..499fff29da --- /dev/null +++ b/internal/execute/tsc/emit.go @@ -0,0 +1,143 @@ +package tsc + +import ( + "context" + "fmt" + "io" + "runtime" + + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/compiler" + "github.com/microsoft/typescript-go/internal/tsoptions" + "github.com/microsoft/typescript-go/internal/tspath" +) + +func GetTraceWithWriterFromSys(w io.Writer, testing CommandLineTesting) func(msg string) { + if testing == nil { + return func(msg string) { + fmt.Fprintln(w, msg) + } + } else { + return testing.GetTrace(w) + } +} + +func EmitAndReportStatistics( + sys System, + programLike compiler.ProgramLike, + program *compiler.Program, + config *tsoptions.ParsedCommandLine, + reportDiagnostic DiagnosticReporter, + reportErrorSummary DiagnosticsReporter, + w io.Writer, + compileTimes CompileTimes, + testing CommandLineTesting, +) (CompileAndEmitResult, *Statistics) { + var statistics *Statistics + result := EmitFilesAndReportErrors(sys, programLike, program, reportDiagnostic, reportErrorSummary, w, compileTimes, testing) + if result.Status != ExitStatusSuccess { + // compile exited early + return result, nil + } + result.times.totalTime = sys.SinceStart() + + if config.CompilerOptions().Diagnostics.IsTrue() || config.CompilerOptions().ExtendedDiagnostics.IsTrue() { + var memStats runtime.MemStats + // GC must be called twice to allow things to settle. + runtime.GC() + runtime.GC() + runtime.ReadMemStats(&memStats) + + statistics = statisticsFromProgram(program, &compileTimes, &memStats) + statistics.Report(w, testing) + } + + if result.EmitResult.EmitSkipped && len(result.Diagnostics) > 0 { + result.Status = ExitStatusDiagnosticsPresent_OutputsSkipped + } else if len(result.Diagnostics) > 0 { + result.Status = ExitStatusDiagnosticsPresent_OutputsGenerated + } + return result, statistics +} + +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( + ctx, + programLike, + nil, + false, + func(ctx context.Context, file *ast.SourceFile) []*ast.Diagnostic { + // Options diagnostics include global diagnostics (even though we collect them separately), + // and global diagnostics create checkers, which then bind all of the files. Do this binding + // early so we can track the time. + bindStart := sys.Now() + diags := programLike.GetBindDiagnostics(ctx, file) + 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.times.checkTime = sys.Now().Sub(checkStart) + return diags + }, + ) + + emitResult := &compiler.EmitResult{EmitSkipped: true, Diagnostics: []*ast.Diagnostic{}} + if !programLike.Options().ListFilesOnly.IsTrue() { + emitStart := sys.Now() + emitResult = programLike.Emit(ctx, compiler.EmitOptions{}) + 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(w, program, emitResult, testing) + + reportErrorSummary(allDiagnostics) + result.Diagnostics = allDiagnostics + result.EmitResult = emitResult + result.Status = ExitStatusSuccess + return result +} + +func listFiles(w io.Writer, program *compiler.Program, emitResult *compiler.EmitResult, testing CommandLineTesting) { + if testing != nil { + 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(w) + } else if options.ListFiles.IsTrue() || options.ListFilesOnly.IsTrue() { + for _, file := range program.GetSourceFiles() { + fmt.Fprintln(w, file.FileName()) + } + } +} diff --git a/internal/execute/outputs.go b/internal/execute/tsc/help.go similarity index 69% rename from internal/execute/outputs.go rename to internal/execute/tsc/help.go index 29b1e4c825..f3467a6b6d 100644 --- a/internal/execute/outputs.go +++ b/internal/execute/tsc/help.go @@ -1,183 +1,21 @@ -package execute +package tsc import ( "fmt" - "io" - "runtime" "slices" - "strconv" "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/diagnosticwriter" "github.com/microsoft/typescript-go/internal/tsoptions" - "github.com/microsoft/typescript-go/internal/tspath" ) -func getFormatOptsOfSys(sys System) *diagnosticwriter.FormattingOptions { - return &diagnosticwriter.FormattingOptions{ - NewLine: "\n", - ComparePathsOptions: tspath.ComparePathsOptions{ - CurrentDirectory: sys.GetCurrentDirectory(), - UseCaseSensitiveFileNames: sys.FS().UseCaseSensitiveFileNames(), - }, - } -} - -type diagnosticReporter = func(*ast.Diagnostic) - -func quietDiagnosticReporter(diagnostic *ast.Diagnostic) {} -func createDiagnosticReporter(sys System, 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) - } -} - -func defaultIsPretty(sys System) bool { - return sys.WriteOutputIsTTY() && sys.GetEnvironmentVariable("NO_COLOR") == "" -} - -func shouldBePretty(sys System, options *core.CompilerOptions) bool { - if options == nil || options.Pretty.IsUnknown() { - return defaultIsPretty(sys) - } - return options.Pretty.IsTrue() -} - -type colors struct { - showColors bool - - isWindows bool - isWindowsTerminal bool - isVSCode bool - supportsRicherColors bool -} - -func createColors(sys System) *colors { - if !defaultIsPretty(sys) { - return &colors{showColors: false} - } - - os := sys.GetEnvironmentVariable("OS") - isWindows := strings.Contains(strings.ToLower(os), "windows") - isWindowsTerminal := sys.GetEnvironmentVariable("WT_SESSION") != "" - isVSCode := sys.GetEnvironmentVariable("TERM_PROGRAM") == "vscode" - supportsRicherColors := sys.GetEnvironmentVariable("COLORTERM") == "truecolor" || sys.GetEnvironmentVariable("TERM") == "xterm-256color" - - return &colors{ - showColors: true, - isWindows: isWindows, - isWindowsTerminal: isWindowsTerminal, - isVSCode: isVSCode, - supportsRicherColors: supportsRicherColors, - } -} - -func (c *colors) bold(str string) string { - if !c.showColors { - return str - } - return "\x1b[1m" + str + "\x1b[22m" -} - -func (c *colors) blue(str string) string { - if !c.showColors { - return str - } - - // Effectively Powershell and Command prompt users use cyan instead - // of blue because the default theme doesn't show blue with enough contrast. - if c.isWindows && !c.isWindowsTerminal && !c.isVSCode { - return c.brightWhite(str) - } - return "\x1b[94m" + str + "\x1b[39m" -} - -func (c *colors) blueBackground(str string) string { - if !c.showColors { - return str - } - if c.supportsRicherColors { - return "\x1B[48;5;68m" + str + "\x1B[39;49m" - } else { - return "\x1b[44m" + str + "\x1B[39;49m" - } -} - -func (c *colors) brightWhite(str string) string { - if !c.showColors { - return str - } - return "\x1b[97m" + str + "\x1b[39m" -} - -func createReportErrorSummary(sys System, options *core.CompilerOptions) func(diagnostics []*ast.Diagnostic) { - if shouldBePretty(sys, options) { - formatOpts := getFormatOptsOfSys(sys) - return func(diagnostics []*ast.Diagnostic) { - diagnosticwriter.WriteErrorSummaryText(sys.Writer(), diagnostics, formatOpts) - } - } - return func(diagnostics []*ast.Diagnostic) {} -} - -func reportStatistics(sys System, program *compiler.Program, result compileAndEmitResult, memStats *runtime.MemStats, testing CommandLineTesting) { - var stats table - - if testing != nil { - testing.OnStatisticsStart() - defer testing.OnStatisticsEnd() - } - 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) - } - if result.buildInfoReadTime != 0 { - stats.add("BuildInfo read time", result.buildInfoReadTime) - } - stats.add("Parse time", result.parseTime) - if result.bindTime != 0 { - stats.add("Bind time", result.bindTime) - } - if result.checkTime != 0 { - stats.add("Check time", result.checkTime) - } - if result.emitTime != 0 { - stats.add("Emit time", result.emitTime) - } - if result.changesComputeTime != 0 { - stats.add("Changes compute time", result.changesComputeTime) - } - stats.add("Total time", result.totalTime) - - stats.print(sys.Writer()) -} - -func printVersion(sys System) { +func PrintVersion(sys System) { fmt.Fprintln(sys.Writer(), diagnostics.Version_0.Format(core.Version())) } -func printHelp(sys System, commandLine *tsoptions.ParsedCommandLine) { +func PrintHelp(sys System, commandLine *tsoptions.ParsedCommandLine) { if commandLine.CompilerOptions().All.IsFalseOrUnknown() { printEasyHelp(sys, getOptionsForHelp(commandLine)) } else { @@ -269,6 +107,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, @@ -540,44 +392,3 @@ func getPrettyOutput(colors *colors, left string, right string, rightAlignOfLeft func getDisplayNameTextOfOption(option *tsoptions.CommandLineOption) string { return "--" + option.Name + core.IfElse(option.ShortName != "", ", -"+option.ShortName, "") } - -type tableRow struct { - name string - value string -} - -type table struct { - rows []tableRow -} - -func (t *table) add(name string, value any) { - if d, ok := value.(time.Duration); ok { - value = formatDuration(d) - } - t.rows = append(t.rows, tableRow{name, fmt.Sprint(value)}) -} - -func (t *table) print(w io.Writer) { - nameWidth := 0 - valueWidth := 0 - for _, r := range t.rows { - nameWidth = max(nameWidth, len(r.name)) - valueWidth = max(valueWidth, len(r.value)) - } - - for _, r := range t.rows { - fmt.Fprintf(w, "%-*s %*s\n", nameWidth+1, r.name+":", valueWidth, r.value) - } -} - -func formatDuration(d time.Duration) string { - return fmt.Sprintf("%.3fs", d.Seconds()) -} - -func identifierCount(p *compiler.Program) int { - count := 0 - for _, file := range p.SourceFiles() { - count += file.IdentifierCount - } - return count -} diff --git a/internal/execute/tsc/statistics.go b/internal/execute/tsc/statistics.go new file mode 100644 index 0000000000..fe2e548fa1 --- /dev/null +++ b/internal/execute/tsc/statistics.go @@ -0,0 +1,151 @@ +package tsc + +import ( + "fmt" + "io" + "runtime" + "strconv" + "time" + + "github.com/microsoft/typescript-go/internal/compiler" +) + +type tableRow struct { + name string + value string +} + +type table struct { + rows []tableRow +} + +func (t *table) add(name string, value any) { + if d, ok := value.(time.Duration); ok { + value = formatDuration(d) + } + t.rows = append(t.rows, tableRow{name, fmt.Sprint(value)}) +} + +func (t *table) print(w io.Writer) { + nameWidth := 0 + valueWidth := 0 + for _, r := range t.rows { + nameWidth = max(nameWidth, len(r.name)) + valueWidth = max(valueWidth, len(r.value)) + } + + for _, r := range t.rows { + fmt.Fprintf(w, "%-*s %*s\n", nameWidth+1, r.name+":", valueWidth, r.value) + } +} + +func formatDuration(d time.Duration) string { + return fmt.Sprintf("%.3fs", d.Seconds()) +} + +func identifierCount(p *compiler.Program) int { + count := 0 + for _, file := range p.SourceFiles() { + count += file.IdentifierCount + } + return count +} + +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 (s *Statistics) Report(w io.Writer, testing CommandLineTesting) { + if testing != nil { + testing.OnStatisticsStart(w) + defer testing.OnStatisticsEnd(w) + } + var table table + var prefix string + + if s.isAggregate { + prefix = "Aggregate " + table.add("Projects in scope", s.Projects) + table.add("Projects built", s.ProjectsBuilt) + table.add("Timestamps only updates", s.TimestampUpdates) + } + table.add(prefix+"Files", s.files) + table.add(prefix+"Lines", s.lines) + table.add(prefix+"Identifiers", s.identifiers) + table.add(prefix+"Symbols", s.symbols) + table.add(prefix+"Types", s.types) + table.add(prefix+"Instantiations", s.instantiations) + table.add(prefix+"Memory used", fmt.Sprintf("%vK", s.memoryUsed/1024)) + table.add(prefix+"Memory allocs", strconv.FormatUint(s.memoryAllocs, 10)) + if s.compileTimes.ConfigTime != 0 { + table.add(prefix+"Config time", s.compileTimes.ConfigTime) + } + if s.compileTimes.BuildInfoReadTime != 0 { + table.add(prefix+"BuildInfo read time", s.compileTimes.BuildInfoReadTime) + } + table.add(prefix+"Parse time", s.compileTimes.ParseTime) + if s.compileTimes.bindTime != 0 { + table.add(prefix+"Bind time", s.compileTimes.bindTime) + } + if s.compileTimes.checkTime != 0 { + table.add(prefix+"Check time", s.compileTimes.checkTime) + } + if s.compileTimes.emitTime != 0 { + table.add(prefix+"Emit time", s.compileTimes.emitTime) + } + if s.compileTimes.ChangesComputeTime != 0 { + table.add(prefix+"Changes compute time", s.compileTimes.ChangesComputeTime) + } + table.add(prefix+"Total time", s.compileTimes.totalTime) + table.print(w) +} + +func (s *Statistics) Aggregate(stats []*Statistics, totalTime time.Duration) { + s.isAggregate = true + s.compileTimes = &CompileTimes{} + for _, stat := range stats { + // Aggregate statistics + s.files += stat.files + s.lines += stat.lines + s.identifiers += stat.identifiers + s.symbols += stat.symbols + s.types += stat.types + s.instantiations += stat.instantiations + s.memoryUsed += stat.memoryUsed + s.memoryAllocs += stat.memoryAllocs + s.compileTimes.ConfigTime += stat.compileTimes.ConfigTime + s.compileTimes.BuildInfoReadTime += stat.compileTimes.BuildInfoReadTime + s.compileTimes.ParseTime += stat.compileTimes.ParseTime + s.compileTimes.bindTime += stat.compileTimes.bindTime + s.compileTimes.checkTime += stat.compileTimes.checkTime + s.compileTimes.emitTime += stat.compileTimes.emitTime + s.compileTimes.ChangesComputeTime += stat.compileTimes.ChangesComputeTime + } + s.compileTimes.totalTime = totalTime +} diff --git a/internal/execute/tsc_test.go b/internal/execute/tsc_test.go deleted file mode 100644 index 85ad87e4af..0000000000 --- a/internal/execute/tsc_test.go +++ /dev/null @@ -1,268 +0,0 @@ -package execute_test - -import ( - "testing" - - "github.com/microsoft/typescript-go/internal/testutil/stringtestutil" -) - -func TestTscCommandline(t *testing.T) { - t.Parallel() - testCases := []*tscInput{ - { - subScenario: "show help with ExitStatus.DiagnosticsPresent_OutputsSkipped", - env: map[string]string{ - "TS_TEST_TERMINAL_WIDTH": "120", - }, - commandLineArgs: nil, - }, - { - subScenario: "show help with ExitStatus.DiagnosticsPresent_OutputsSkipped when host cannot provide terminal width", - commandLineArgs: nil, - }, - { - subScenario: "does not add color when NO_COLOR is set", - env: map[string]string{ - "NO_COLOR": "true", - }, - commandLineArgs: nil, - }, - { - subScenario: "when build not first argument", - commandLineArgs: []string{"--verbose", "--build"}, - }, - { - subScenario: "help", - commandLineArgs: []string{"--help"}, - }, - { - subScenario: "help all", - commandLineArgs: []string{"--help", "--all"}, - }, - { - subScenario: "Parse --lib option with file name", - files: FileMap{"/home/src/workspaces/project/first.ts": `export const Key = Symbol()`}, - commandLineArgs: []string{"--lib", "es6 ", "first.ts"}, - }, - { - subScenario: "Project is empty string", - files: FileMap{ - "/home/src/workspaces/project/first.ts": `export const a = 1`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "strict": true, - "noEmit": true - } - }`), - }, - commandLineArgs: []string{}, - }, - { - subScenario: "Parse -p", - files: FileMap{ - "/home/src/workspaces/project/first.ts": `export const a = 1`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "strict": true, - "noEmit": true - } - }`), - }, - commandLineArgs: []string{"-p", "."}, - }, - { - subScenario: "Parse -p with path to tsconfig file", - files: FileMap{ - "/home/src/workspaces/project/first.ts": `export const a = 1`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "strict": true, - "noEmit": true - } - }`), - }, - commandLineArgs: []string{"-p", "/home/src/workspaces/project/tsconfig.json"}, - }, - { - subScenario: "Parse -p with path to tsconfig folder", - files: FileMap{ - "/home/src/workspaces/project/first.ts": `export const a = 1`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "strict": true, - "noEmit": true - } - }`), - }, - commandLineArgs: []string{"-p", "/home/src/workspaces/project"}, - }, - { - subScenario: "Parse enum type options", - commandLineArgs: []string{"--moduleResolution", "nodenext ", "first.ts", "--module", "nodenext", "--target", "esnext", "--moduleDetection", "auto", "--jsx", "react", "--newLine", "crlf"}, - }, - { - subScenario: "Parse watch interval option", - files: FileMap{ - "/home/src/workspaces/project/first.ts": `export const a = 1`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "strict": true, - "noEmit": true - } - }`), - }, - commandLineArgs: []string{"-w", "--watchInterval", "1000"}, - }, - { - subScenario: "Parse watch interval option without tsconfig.json", - commandLineArgs: []string{"-w", "--watchInterval", "1000"}, - }, - { - subScenario: "Config with references and empty file and refers to config with noEmit", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`{ - "files": [], - "references": [ - { - "path": "./packages/pkg1" - }, - ], - }`), - "/home/src/workspaces/project/packages/pkg1/tsconfig.json": stringtestutil.Dedent(`{ - "compilerOptions": { - "composite": true, - "noEmit": true - }, - "files": [ - "./index.ts", - ], - }`), - "/home/src/workspaces/project/packages/pkg1/index.ts": `export const a = 1;`, - }, - commandLineArgs: []string{"-p", "."}, - }, - } - - for _, testCase := range testCases { - testCase.run(t, "commandLine") - } -} - -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 TestExtends(t *testing.T) { - t.Parallel() - extendsSysScenario := func(subScenario string, commandlineArgs []string) *tscInput { - return &tscInput{ - subScenario: subScenario, - commandLineArgs: commandlineArgs, - 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/*"], - "other/*": ["other/*"], - }, - "baseUrl": "${configDir}", - }, - "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/src/secondary.ts": stringtestutil.Dedent(` - // some comment - export const z = 10; - import { k } from "other/sometype2"; - `), - "/home/src/projects/myproject/types/sometype.ts": stringtestutil.Dedent(` - // some comment - export const x = 10; - `), - "/home/src/projects/myproject/root2/other/sometype2/index.d.ts": stringtestutil.Dedent(` - export const k = 10; - `), - }, - cwd: "/home/src/projects/myproject", - } - } - - cases := []*tscInput{ - extendsSysScenario("configDir template", []string{"--explainFiles"}), - extendsSysScenario("configDir template showConfig", []string{"--showConfig"}), - extendsSysScenario("configDir template with commandline", []string{"--explainFiles", "--outDir", "${configDir}/outDir"}), - } - - for _, c := range cases { - c.run(t, "extends") - } -} - -func TestTypeAcquisition(t *testing.T) { - t.Parallel() - (&tscInput{ - subScenario: "parse tsconfig with typeAcquisition", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "noEmit": true, - }, - "typeAcquisition": { - "enable": true, - "include": ["0.d.ts", "1.d.ts"], - "exclude": ["0.js", "1.js"], - "disableFilenameBasedTypeAcquisition": true, - }, - }`), - }, - commandLineArgs: []string{}, - }).run(t, "typeAcquisition") -} diff --git a/internal/execute/tscincremental_test.go b/internal/execute/tscincremental_test.go deleted file mode 100644 index 76fe263bbc..0000000000 --- a/internal/execute/tscincremental_test.go +++ /dev/null @@ -1,701 +0,0 @@ -package execute_test - -import ( - "testing" - - "github.com/microsoft/typescript-go/internal/testutil/stringtestutil" -) - -func TestIncremental(t *testing.T) { - t.Parallel() - testCases := []*tscInput{ - { - subScenario: "serializing error chain", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "incremental": true, - "strict": true, - "jsx": "react", - "module": "esnext", - }, - }`), - "/home/src/workspaces/project/index.tsx": stringtestutil.Dedent(` - declare namespace JSX { - interface ElementChildrenAttribute { children: {}; } - interface IntrinsicElements { div: {} } - } - - declare var React: any; - - declare function Component(props: never): any; - declare function Component(props: { children?: number }): any; - ( -
-
- )`), - }, - edits: noChangeOnlyEdit, - }, - { - subScenario: "serializing composite project", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "strict": true, - "module": "esnext", - }, - }`), - "/home/src/workspaces/project/index.tsx": `export const a = 1;`, - "/home/src/workspaces/project/other.ts": `export const b = 2;`, - }, - }, - { - subScenario: "change to modifier of class expression field with declaration emit enabled", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "esnext", - "declaration": true - } - }`), - "/home/src/workspaces/project/main.ts": stringtestutil.Dedent(` - import MessageablePerson from './MessageablePerson.js'; - function logMessage( person: MessageablePerson ) { - console.log( person.message ); - }`), - "/home/src/workspaces/project/MessageablePerson.ts": stringtestutil.Dedent(` - const Messageable = () => { - return class MessageableClass { - public message = 'hello'; - } - }; - const wrapper = () => Messageable(); - type MessageablePerson = InstanceType>; - export default MessageablePerson;`), - tscLibPath + "/lib.d.ts": tscDefaultLibContent + "\n" + stringtestutil.Dedent(` - type ReturnType any> = T extends (...args: any) => infer R ? R : any; - type InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;`), - }, - commandLineArgs: []string{"--incremental"}, - edits: []*tscEdit{ - noChange, - { - caption: "modify public to protected", - edit: func(sys *testSys) { - sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "public", "protected") - }, - }, - noChange, - { - caption: "modify protected to public", - edit: func(sys *testSys) { - sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "protected", "public") - }, - }, - noChange, - }, - }, - { - subScenario: "change to modifier of class expression field", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "esnext" - } - }`), - "/home/src/workspaces/project/main.ts": stringtestutil.Dedent(` - import MessageablePerson from './MessageablePerson.js'; - function logMessage( person: MessageablePerson ) { - console.log( person.message ); - }`), - "/home/src/workspaces/project/MessageablePerson.ts": stringtestutil.Dedent(` - const Messageable = () => { - return class MessageableClass { - public message = 'hello'; - } - }; - const wrapper = () => Messageable(); - type MessageablePerson = InstanceType>; - export default MessageablePerson;`), - tscLibPath + "/lib.d.ts": tscDefaultLibContent + "\n" + stringtestutil.Dedent(` - type ReturnType any> = T extends (...args: any) => infer R ? R : any; - type InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;`), - }, - commandLineArgs: []string{"--incremental"}, - edits: []*tscEdit{ - noChange, - { - caption: "modify public to protected", - edit: func(sys *testSys) { - sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "public", "protected") - }, - }, - noChange, - { - caption: "modify protected to public", - edit: func(sys *testSys) { - sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "protected", "public") - }, - }, - noChange, - }, - }, - { - subScenario: "when passing filename for buildinfo on commandline", - 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" - }, - "include": [ - "src/**/*.ts" - ], - }`), - }, - commandLineArgs: []string{"--incremental", "--tsBuildInfoFile", ".tsbuildinfo", "--explainFiles"}, - edits: noChangeOnlyEdit, - }, - { - subScenario: "when passing rootDir from commandline", - files: FileMap{ - "/home/src/workspaces/project/src/main.ts": "export const x = 10;", - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "incremental": true, - "outDir": "dist" - } - }`), - }, - commandLineArgs: []string{"--rootDir", "src"}, - edits: noChangeOnlyEdit, - }, - { - subScenario: "with only dts files", - files: FileMap{ - "/home/src/workspaces/project/src/main.d.ts": "export const x = 10;", - "/home/src/workspaces/project/src/another.d.ts": "export const y = 10;", - "/home/src/workspaces/project/tsconfig.json": "{}", - }, - commandLineArgs: []string{"--incremental"}, - edits: []*tscEdit{ - noChange, - { - caption: "modify d.ts file", - edit: func(sys *testSys) { - sys.appendFile("/home/src/workspaces/project/src/main.d.ts", "export const xy = 100;") - }, - }, - }, - }, - { - subScenario: "when passing rootDir is in the tsconfig", - files: FileMap{ - "/home/src/workspaces/project/src/main.ts": "export const x = 10;", - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "incremental": true, - "outDir": "dist", - "rootDir": "./" - } - }`), - }, - edits: noChangeOnlyEdit, - }, - { - subScenario: "tsbuildinfo has error", - files: FileMap{ - "/home/src/workspaces/project/main.ts": "export const x = 10;", - "/home/src/workspaces/project/tsconfig.json": "{}", - "/home/src/workspaces/project/tsconfig.tsbuildinfo": "Some random string", - }, - commandLineArgs: []string{"-i"}, - edits: []*tscEdit{ - { - caption: "tsbuildinfo written has error", - edit: func(sys *testSys) { - sys.prependFile("/home/src/workspaces/project/tsconfig.tsbuildinfo", "Some random string") - }, - }, - }, - }, - { - subScenario: "when global file is added, the signatures are updated", - files: FileMap{ - "/home/src/workspaces/project/src/main.ts": stringtestutil.Dedent(` - /// - /// - function main() { } - `), - "/home/src/workspaces/project/src/anotherFileWithSameReferenes.ts": stringtestutil.Dedent(` - /// - /// - function anotherFileWithSameReferenes() { } - `), - "/home/src/workspaces/project/src/filePresent.ts": `function something() { return 10; }`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { "composite": true }, - "include": ["src/**/*.ts"], - }`), - }, - commandLineArgs: []string{}, - edits: []*tscEdit{ - noChange, - { - caption: "Modify main file", - edit: func(sys *testSys) { - sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `something();`) - }, - }, - { - caption: "Modify main file again", - edit: func(sys *testSys) { - sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `something();`) - }, - }, - { - caption: "Add new file and update main file", - edit: func(sys *testSys) { - sys.writeFileNoError(`/home/src/workspaces/project/src/newFile.ts`, "function foo() { return 20; }", false) - sys.prependFile( - `/home/src/workspaces/project/src/main.ts`, - `/// -`, - ) - sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `foo();`) - }, - }, - { - caption: "Write file that could not be resolved", - edit: func(sys *testSys) { - sys.writeFileNoError(`/home/src/workspaces/project/src/fileNotFound.ts`, "function something2() { return 20; }", false) - }, - }, - { - caption: "Modify main file", - edit: func(sys *testSys) { - sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `something();`) - }, - }, - }, - }, - { - subScenario: "react-jsx-emit-mode with no backing types found doesnt crash", - files: FileMap{ - "/home/src/workspaces/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result - "/home/src/workspaces/project/node_modules/@types/react/index.d.ts": stringtestutil.Dedent(` - export {}; - declare global { - namespace JSX { - interface Element {} - interface IntrinsicElements { - div: { - propA?: boolean; - }; - } - } - }`), // doesn't contain a jsx-runtime definition - "/home/src/workspaces/project/src/index.tsx": `export const App = () =>
;`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "commonjs", - "jsx": "react-jsx", - "incremental": true, - "jsxImportSource": "react" - } - }`), - }, - }, - { - subScenario: "react-jsx-emit-mode with no backing types found doesnt crash under --strict", - files: FileMap{ - "/home/src/workspaces/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result - "/home/src/workspaces/project/node_modules/@types/react/index.d.ts": stringtestutil.Dedent(` - export {}; - declare global { - namespace JSX { - interface Element {} - interface IntrinsicElements { - div: { - propA?: boolean; - }; - } - } - }`), // doesn't contain a jsx-runtime definition - "/home/src/workspaces/project/src/index.tsx": `export const App = () =>
;`, - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "commonjs", - "jsx": "react-jsx", - "incremental": true, - "jsxImportSource": "react" - } - }`), - }, - commandLineArgs: []string{"--strict"}, - }, - { - subScenario: "change to type that gets used as global through export in another file", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true - } - }`), - "/home/src/workspaces/project/class1.ts": stringtestutil.Dedent(` - const a: MagicNumber = 1; - console.log(a);`), - "/home/src/workspaces/project/constants.ts": "export default 1;", - "/home/src/workspaces/project/types.d.ts": `type MagicNumber = typeof import('./constants').default`, - }, - edits: []*tscEdit{ - { - caption: "Modify imports used in global file", - edit: func(sys *testSys) { - sys.writeFileNoError("/home/src/workspaces/project/constants.ts", "export default 2;", false) - }, - expectedDiff: "Currently there is issue with d.ts emit for export default = 1 to widen in dts which is why we are not re-computing errors and results in incorrect error reporting", - }, - }, - }, - { - subScenario: "change to type that gets used as global through export in another file through indirect import", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true - } - }`), - "/home/src/workspaces/project/class1.ts": stringtestutil.Dedent(` - const a: MagicNumber = 1; - console.log(a);`), - "/home/src/workspaces/project/constants.ts": "export default 1;", - "/home/src/workspaces/project/reexport.ts": `export { default as ConstantNumber } from "./constants"`, - "/home/src/workspaces/project/types.d.ts": `type MagicNumber = typeof import('./reexport').ConstantNumber`, - }, - edits: []*tscEdit{ - { - caption: "Modify imports used in global file", - edit: func(sys *testSys) { - sys.writeFileNoError("/home/src/workspaces/project/constants.ts", "export default 2;", false) - }, - expectedDiff: "Currently there is issue with d.ts emit for export default = 1 to widen in dts which is why we are not re-computing errors and results in incorrect error reporting", - }, - }, - }, - { - subScenario: "when file is deleted", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "outDir": "outDir" - } - }`), - "/home/src/workspaces/project/file1.ts": `export class C { }`, - "/home/src/workspaces/project/file2.ts": `export class D { }`, - }, - edits: []*tscEdit{ - { - caption: "delete file with imports", - edit: func(sys *testSys) { - err := sys.fsFromFileMap().Remove("/home/src/workspaces/project/file2.ts") - if err != nil { - panic(err) - } - }, - }, - }, - }, - { - subScenario: "generates typerefs correctly", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "outDir": "outDir", - "checkJs": true - }, - "include": ["src"], - }`), - "/home/src/workspaces/project/src/box.ts": stringtestutil.Dedent(` - export interface Box { - unbox(): T - } - `), - "/home/src/workspaces/project/src/bug.js": stringtestutil.Dedent(` - import * as B from "./box.js" - import * as W from "./wrap.js" - - /** - * @template {object} C - * @param {C} source - * @returns {W.Wrap} - */ - const wrap = source => { - throw source - } - - /** - * @returns {B.Box} - */ - const box = (n = 0) => ({ unbox: () => n }) - - export const bug = wrap({ n: box(1) }); - `), - "/home/src/workspaces/project/src/wrap.ts": stringtestutil.Dedent(` - export type Wrap = { - [K in keyof C]: { wrapped: C[K] } - } - `), - }, - edits: []*tscEdit{ - { - caption: "modify js file", - edit: func(sys *testSys) { - sys.appendFile("/home/src/workspaces/project/src/bug.js", `export const something = 1;`) - }, - }, - }, - }, - getConstEnumTest(` - export const enum A { - ONE = 1 - } - `, "/home/src/workspaces/project/b.d.ts", ""), - getConstEnumTest(` - export const enum AWorker { - ONE = 1 - } - export { AWorker as A }; - `, "/home/src/workspaces/project/b.d.ts", " aliased"), - getConstEnumTest(`export { AWorker as A } from "./worker";`, "/home/src/workspaces/project/worker.d.ts", " aliased in different file"), - { - subScenario: "option changes with composite", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - } - }`), - "/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;`, - }, - edits: []*tscEdit{ - { - caption: "with sourceMap", - commandLineArgs: []string{"--sourceMap"}, - }, - { - caption: "should re-emit only js so they dont contain sourcemap", - }, - { - caption: "with declaration should not emit anything", - commandLineArgs: []string{"--declaration"}, - // discrepancyExplanation: () => [ - // `Clean build tsbuildinfo will have compilerOptions with composite and ${option.replace(/-/g, "")}`, - // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option composite only`, - // ], - }, - noChange, - { - caption: "with declaration and declarationMap", - commandLineArgs: []string{"--declaration", "--declarationMap"}, - }, - { - caption: "should re-emit only dts so they dont contain sourcemap", - }, - { - caption: "with emitDeclarationOnly should not emit anything", - commandLineArgs: []string{"--emitDeclarationOnly"}, - // discrepancyExplanation: () => [ - // `Clean build tsbuildinfo will have compilerOptions with composite and ${option.replace(/-/g, "")}`, - // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option composite only`, - // ], - }, - 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{"--declaration"}, - // discrepancyExplanation: () => [ - // `Clean build tsbuildinfo will have compilerOptions with composite and ${option.replace(/-/g, "")}`, - // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option composite only`, - // ], - }, - { - caption: "with inlineSourceMap", - commandLineArgs: []string{"--inlineSourceMap"}, - }, - { - caption: "with sourceMap", - commandLineArgs: []string{"--sourceMap"}, - }, - { - caption: "declarationMap enabling", - edit: func(sys *testSys) { - sys.replaceFileText("/home/src/workspaces/project/tsconfig.json", `"composite": true,`, `"composite": true, "declarationMap": true`) - }, - }, - { - caption: "with sourceMap should not emit d.ts", - commandLineArgs: []string{"--sourceMap"}, - }, - }, - }, - { - subScenario: "option changes with incremental", - files: FileMap{ - "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "incremental": true, - } - }`), - "/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;`, - }, - edits: []*tscEdit{ - { - caption: "with sourceMap", - commandLineArgs: []string{"--sourceMap"}, - }, - { - caption: "should re-emit only js so they dont contain sourcemap", - }, - { - caption: "with declaration, emit Dts and should not emit js", - commandLineArgs: []string{"--declaration"}, - }, - { - caption: "with declaration and declarationMap", - commandLineArgs: []string{"--declaration", "--declarationMap"}, - }, - { - caption: "no change", - // discrepancyExplanation: () => [ - // `Clean build tsbuildinfo will have compilerOptions {}`, - // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option declaration and declarationMap`, - // ], - }, - { - 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{"--declaration", "--declarationMap"}, - }, - { - caption: "no change", - // discrepancyExplanation: () => [ - // `Clean build tsbuildinfo will have compilerOptions {}`, - // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option declaration and declarationMap`, - // ], - }, - { - caption: "with inlineSourceMap", - commandLineArgs: []string{"--inlineSourceMap"}, - }, - { - caption: "with sourceMap", - commandLineArgs: []string{"--sourceMap"}, - }, - { - caption: "emit js files", - }, - { - caption: "with declaration and declarationMap", - commandLineArgs: []string{"--declaration", "--declarationMap"}, - }, - { - caption: "with declaration and declarationMap, should not re-emit", - commandLineArgs: []string{"--declaration", "--declarationMap"}, - }, - }, - }, - } - - for _, test := range testCases { - test.run(t, "incremental") - } -} - -func getConstEnumTest(bdsContents string, changeEnumFile string, testSuffix string) *tscInput { - return &tscInput{ - subScenario: "const enums" + testSuffix, - files: FileMap{ - "/home/src/workspaces/project/a.ts": stringtestutil.Dedent(` - import {A} from "./c" - let a = A.ONE - `), - "/home/src/workspaces/project/b.d.ts": stringtestutil.Dedent(bdsContents), - "/home/src/workspaces/project/c.ts": stringtestutil.Dedent(` - import {A} from "./b" - let b = A.ONE - export {A} - `), - "/home/src/workspaces/project/worker.d.ts": stringtestutil.Dedent(` - export const enum AWorker { - ONE = 1 - } - `), - }, - commandLineArgs: []string{"-i", `a.ts`, "--tsbuildinfofile", "a.tsbuildinfo"}, - edits: []*tscEdit{ - { - caption: "change enum value", - edit: func(sys *testSys) { - sys.replaceFileText(changeEnumFile, "1", "2") - }, - }, - { - caption: "change enum value again", - edit: func(sys *testSys) { - sys.replaceFileText(changeEnumFile, "2", "3") - }, - }, - { - caption: "something else changes in b.d.ts", - edit: func(sys *testSys) { - sys.appendFile("/home/src/workspaces/project/b.d.ts", "export const randomThing = 10;") - }, - }, - { - caption: "something else changes in b.d.ts again", - edit: func(sys *testSys) { - sys.appendFile("/home/src/workspaces/project/b.d.ts", "export const randomThing2 = 10;") - }, - }, - }, - } -} diff --git a/internal/execute/tscnocheck_test.go b/internal/execute/tscnocheck_test.go deleted file mode 100644 index 45d4846d84..0000000000 --- a/internal/execute/tscnocheck_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package execute_test - -import ( - "testing" - - "github.com/microsoft/typescript-go/internal/testutil/stringtestutil" -) - -type noCheckScenario struct { - subscenario string - aText string -} - -func TestNoCheck(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 - }, - commandLineArgs: []string{"--noCheck"}, - }).run(t, "noCheck") - } -} diff --git a/internal/execute/tscprojectreferences_test.go b/internal/execute/tscprojectreferences_test.go deleted file mode 100644 index 43469158ad..0000000000 --- a/internal/execute/tscprojectreferences_test.go +++ /dev/null @@ -1,334 +0,0 @@ -package execute_test - -import ( - "testing" - - "github.com/microsoft/typescript-go/internal/testutil/stringtestutil" -) - -func TestProjectReferences(t *testing.T) { - t.Parallel() - cases := []tscInput{ - { - subScenario: "when project references composite project with noEmit", - files: FileMap{ - "/home/src/workspaces/solution/utils/index.ts": "export const x = 10;", - "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "noEmit": true - } - }`), - "/home/src/workspaces/solution/project/index.ts": `import { x } from "../utils";`, - "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` - { - "references": [ - { "path": "../utils" }, - ], - }`), - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "project"}, - }, - { - subScenario: "when project references composite", - files: FileMap{ - "/home/src/workspaces/solution/utils/index.ts": "export const x = 10;", - "/home/src/workspaces/solution/utils/index.d.ts": "export declare const x = 10;", - "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true - } - }`), - "/home/src/workspaces/solution/project/index.ts": `import { x } from "../utils";`, - "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` - { - "references": [ - { "path": "../utils" }, - ], - }`), - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "project"}, - }, - { - subScenario: "when project reference is not built", - files: FileMap{ - "/home/src/workspaces/solution/utils/index.ts": "export const x = 10;", - "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true - } - }`), - "/home/src/workspaces/solution/project/index.ts": `import { x } from "../utils";`, - "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` - { - "references": [ - { "path": "../utils" }, - ], - }`), - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "project"}, - }, - { - subScenario: "when project contains invalid project reference", - files: FileMap{ - "/home/src/workspaces/solution/project/index.ts": `export const x = 10;`, - "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` - { - "references": [ - { "path": "../utils" }, - ], - }`), - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "project"}, - }, - { - subScenario: "default import interop uses referenced project settings", - files: FileMap{ - "/home/src/workspaces/project/node_modules/ambiguous-package/package.json": stringtestutil.Dedent(` - { - "name": "ambiguous-package" - }`), - "/home/src/workspaces/project/node_modules/ambiguous-package/index.d.ts": "export declare const ambiguous: number;", - "/home/src/workspaces/project/node_modules/esm-package/package.json": stringtestutil.Dedent(` - { - "name": "esm-package", - "type": "module" - }`), - "/home/src/workspaces/project/node_modules/esm-package/index.d.ts": "export declare const esm: number;", - "/home/src/workspaces/project/lib/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "declaration": true, - "rootDir": "src", - "outDir": "dist", - "module": "esnext", - "moduleResolution": "bundler", - }, - "include": ["src"], - }`), - "/home/src/workspaces/project/lib/src/a.ts": "export const a = 0;", - "/home/src/workspaces/project/lib/dist/a.d.ts": "export declare const a = 0;", - "/home/src/workspaces/project/app/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "esnext", - "moduleResolution": "bundler", - "rootDir": "src", - "outDir": "dist", - }, - "include": ["src"], - "references": [ - { "path": "../lib" }, - ], - }`), - "/home/src/workspaces/project/app/src/local.ts": "export const local = 0;", - "/home/src/workspaces/project/app/src/index.ts": stringtestutil.Dedent(` - import local from "./local"; // Error - import esm from "esm-package"; // Error - import referencedSource from "../../lib/src/a"; // Error - import referencedDeclaration from "../../lib/dist/a"; // Error - import ambiguous from "ambiguous-package"; // Ok`), - }, - commandLineArgs: []string{"--p", "app", "--pretty", "false"}, - }, - { - subScenario: "referencing ambient const enum from referenced project with preserveConstEnums", - files: FileMap{ - "/home/src/workspaces/solution/utils/index.ts": "export const enum E { A = 1 }", - "/home/src/workspaces/solution/utils/index.d.ts": "export declare const enum E { A = 1 }", - "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "declaration": true, - "preserveConstEnums": true, - }, - }`), - "/home/src/workspaces/solution/project/index.ts": `import { E } from "../utils"; E.A;`, - "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "isolatedModules": true, - }, - "references": [ - { "path": "../utils" }, - ], - }`), - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "project"}, - }, - { - subScenario: "importing const enum from referenced project with preserveConstEnums and verbatimModuleSyntax", - files: FileMap{ - "/home/src/workspaces/solution/preserve/index.ts": "export const enum E { A = 1 }", - "/home/src/workspaces/solution/preserve/index.d.ts": "export declare const enum E { A = 1 }", - "/home/src/workspaces/solution/preserve/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "declaration": true, - "preserveConstEnums": true, - }, - }`), - "/home/src/workspaces/solution/no-preserve/index.ts": "export const enum E { A = 1 }", - "/home/src/workspaces/solution/no-preserve/index.d.ts": "export declare const enum F { A = 1 }", - "/home/src/workspaces/solution/no-preserve/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "declaration": true, - "preserveConstEnums": false, - }, - }`), - "/home/src/workspaces/solution/project/index.ts": stringtestutil.Dedent(` - import { E } from "../preserve"; - import { F } from "../no-preserve"; - E.A; - F.A;`), - "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "preserve", - "verbatimModuleSyntax": true, - }, - "references": [ - { "path": "../preserve" }, - { "path": "../no-preserve" }, - ], - }`), - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "project", "--pretty", "false"}, - }, - { - subScenario: "rewriteRelativeImportExtensionsProjectReferences1", - files: FileMap{ - "/home/src/workspaces/packages/common/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "composite": true, - "rootDir": "src", - "outDir": "dist", - "module": "nodenext" - } - }`), - "/home/src/workspaces/packages/common/package.json": stringtestutil.Dedent(` - { - "name": "common", - "version": "1.0.0", - "type": "module", - "exports": { - ".": { - "source": "./src/index.ts", - "default": "./dist/index.js" - } - } - }`), - "/home/src/workspaces/packages/common/src/index.ts": "export {};", - "/home/src/workspaces/packages/common/dist/index.d.ts": "export {};", - "/home/src/workspaces/packages/main/tsconfig.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "nodenext", - "rewriteRelativeImportExtensions": true, - "rootDir": "src", - "outDir": "dist" - }, - "references": [ - { "path": "../common" } - ] - }`), - "/home/src/workspaces/packages/main/package.json": stringtestutil.Dedent(` - { - "type": "module" - }`), - "/home/src/workspaces/packages/main/src/index.ts": `import {} from "../../common/src/index.ts";`, - }, - cwd: "/home/src/workspaces", - commandLineArgs: []string{"-p", "packages/main", "--pretty", "false"}, - }, - { - subScenario: "rewriteRelativeImportExtensionsProjectReferences2", - files: FileMap{ - "/home/src/workspaces/solution/src/tsconfig-base.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "nodenext", - "composite": true, - "rootDir": ".", - "outDir": "../dist", - "rewriteRelativeImportExtensions": true - } - }`), - "/home/src/workspaces/solution/src/compiler/tsconfig.json": stringtestutil.Dedent(` - { - "extends": "../tsconfig-base.json", - "compilerOptions": {} - }`), - "/home/src/workspaces/solution/src/compiler/parser.ts": "export {};", - "/home/src/workspaces/solution/dist/compiler/parser.d.ts": "export {};", - "/home/src/workspaces/solution/src/services/tsconfig.json": stringtestutil.Dedent(` - { - "extends": "../tsconfig-base.json", - "compilerOptions": {}, - "references": [ - { "path": "../compiler" } - ] - }`), - "/home/src/workspaces/solution/src/services/services.ts": `import {} from "../compiler/parser.ts";`, - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "src/services", "--pretty", "false"}, - }, - { - subScenario: "rewriteRelativeImportExtensionsProjectReferences3", - files: FileMap{ - "/home/src/workspaces/solution/src/tsconfig-base.json": stringtestutil.Dedent(` - { - "compilerOptions": { - "module": "nodenext", - "composite": true, - "rewriteRelativeImportExtensions": true - } - }`), - "/home/src/workspaces/solution/src/compiler/tsconfig.json": stringtestutil.Dedent(` - { - "extends": "../tsconfig-base.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "../../dist/compiler" - } - }`), - "/home/src/workspaces/solution/src/compiler/parser.ts": "export {};", - "/home/src/workspaces/solution/dist/compiler/parser.d.ts": "export {};", - "/home/src/workspaces/solution/src/services/tsconfig.json": stringtestutil.Dedent(` - { - "extends": "../tsconfig-base.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "../../dist/services" - }, - "references": [ - { "path": "../compiler" } - ] - }`), - "/home/src/workspaces/solution/src/services/services.ts": `import {} from "../compiler/parser.ts";`, - }, - cwd: "/home/src/workspaces/solution", - commandLineArgs: []string{"--p", "src/services", "--pretty", "false"}, - }, - } - - for _, c := range cases { - c.run(t, "projectReferences") - } -} diff --git a/internal/testutil/incrementaltestutil/fs.go b/internal/execute/tsctests/fs.go similarity index 55% rename from internal/testutil/incrementaltestutil/fs.go rename to internal/execute/tsctests/fs.go index d238229955..03c653a2a8 100644 --- a/internal/testutil/incrementaltestutil/fs.go +++ b/internal/execute/tsctests/fs.go @@ -1,23 +1,37 @@ -package incrementaltestutil +package tsctests import ( "fmt" "github.com/go-json-experiment/json" + "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" - "github.com/microsoft/typescript-go/internal/incremental" + "github.com/microsoft/typescript-go/internal/execute/incremental" "github.com/microsoft/typescript-go/internal/testutil/harnessutil" "github.com/microsoft/typescript-go/internal/tspath" "github.com/microsoft/typescript-go/internal/vfs" ) -type FsHandlingBuildInfo struct { +type testFs struct { vfs.FS + defaultLibs *collections.SyncSet[string] + writtenFiles collections.SyncSet[string] +} + +func (f *testFs) removeIgnoreLibPath(path string) { + if f.defaultLibs != nil && f.defaultLibs.Has(path) { + f.defaultLibs.Delete(path) + } } // ReadFile reads the file specified by path and returns the content. // If the file fails to be read, ok will be false. -func (f *FsHandlingBuildInfo) ReadFile(path string) (contents string, ok bool) { +func (f *testFs) ReadFile(path string) (contents string, ok bool) { + f.removeIgnoreLibPath(path) + return f.readFileHandlingBuildInfo(path) +} + +func (f *testFs) readFileHandlingBuildInfo(path string) (contents string, ok bool) { contents, ok = f.FS.ReadFile(path) if ok && tspath.FileExtensionIs(path, tspath.ExtensionTsBuildInfo) { // read buildinfo and modify version @@ -35,7 +49,13 @@ func (f *FsHandlingBuildInfo) ReadFile(path string) (contents string, ok bool) { return contents, ok } -func (f *FsHandlingBuildInfo) WriteFile(path string, data string, writeByteOrderMark bool) error { +func (f *testFs) WriteFile(path string, data string, writeByteOrderMark bool) error { + f.removeIgnoreLibPath(path) + f.writtenFiles.Add(path) + return f.writeFileHandlingBuildInfo(path, data, writeByteOrderMark) +} + +func (f *testFs) writeFileHandlingBuildInfo(path string, data string, writeByteOrderMark bool) error { if tspath.FileExtensionIs(path, tspath.ExtensionTsBuildInfo) { var buildInfo incremental.BuildInfo if err := json.Unmarshal([]byte(data), &buildInfo); err == nil { @@ -49,10 +69,18 @@ func (f *FsHandlingBuildInfo) WriteFile(path string, data string, writeByteOrder data = string(newData) } // Write readable build info version - if err := f.FS.WriteFile(path+".readable.baseline.txt", toReadableBuildInfo(&buildInfo, data), false); err != nil { + if err := f.WriteFile(path+".readable.baseline.txt", toReadableBuildInfo(&buildInfo, data), false); err != nil { return fmt.Errorf("testFs.WriteFile: failed to write readable build info: %w", err) } + } else { + panic("testFs.WriteFile: failed to unmarshal build info: - use underlying FS's write method if this is intended use for testcase" + err.Error()) } } return f.FS.WriteFile(path, data, writeByteOrderMark) } + +// Removes `path` and all its contents. Will return the first error it encounters. +func (f *testFs) Remove(path string) error { + f.removeIgnoreLibPath(path) + return f.FS.Remove(path) +} diff --git a/internal/testutil/incrementaltestutil/readablebuildinfo.go b/internal/execute/tsctests/readablebuildinfo.go similarity index 82% rename from internal/testutil/incrementaltestutil/readablebuildinfo.go rename to internal/execute/tsctests/readablebuildinfo.go index dbfa965087..3969ac5f75 100644 --- a/internal/testutil/incrementaltestutil/readablebuildinfo.go +++ b/internal/execute/tsctests/readablebuildinfo.go @@ -1,4 +1,4 @@ -package incrementaltestutil +package tsctests import ( "fmt" @@ -8,7 +8,7 @@ import ( "github.com/microsoft/typescript-go/internal/collections" "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/execute/incremental" "github.com/microsoft/typescript-go/internal/jsonutil" ) @@ -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 { @@ -86,14 +94,15 @@ func (r *readableBuildInfoDiagnosticsOfFile) UnmarshalJSON(data []byte) error { if !ok { return fmt.Errorf("invalid fileId in readableBuildInfoDiagnosticsOfFile: expected string, got %T", fileIdAndDiagnostics[0]) } - if diagnostics, ok := fileIdAndDiagnostics[1].([]*readableBuildInfoDiagnostic); ok { + if diagnostics, ok := fileIdAndDiagnostics[1].([]*readableBuildInfoDiagnostic); !ok { + return fmt.Errorf("invalid diagnostics in readableBuildInfoDiagnosticsOfFile: expected []*readableBuildInfoDiagnostic, got %T", fileIdAndDiagnostics[1]) + } else { *r = readableBuildInfoDiagnosticsOfFile{ file: file, diagnostics: diagnostics, } return nil } - return fmt.Errorf("invalid diagnostics in readableBuildInfoDiagnosticsOfFile: expected []*readableBuildInfoDiagnostic, got %T", fileIdAndDiagnostics[1]) } type readableBuildInfoSemanticDiagnostic struct { @@ -110,20 +119,20 @@ func (r *readableBuildInfoSemanticDiagnostic) MarshalJSON() ([]byte, error) { func (r *readableBuildInfoSemanticDiagnostic) UnmarshalJSON(data []byte) error { var file string - if err := json.Unmarshal(data, &file); err == nil { - *r = readableBuildInfoSemanticDiagnostic{ - file: file, + if err := json.Unmarshal(data, &file); err != nil { + var diagnostics readableBuildInfoDiagnosticsOfFile + if err := json.Unmarshal(data, &diagnostics); err != nil { + return fmt.Errorf("invalid readableBuildInfoSemanticDiagnostic: %s", data) } - return nil - } - var diagnostics readableBuildInfoDiagnosticsOfFile - if err := json.Unmarshal(data, &diagnostics); err == nil { *r = readableBuildInfoSemanticDiagnostic{ diagnostics: &diagnostics, } return nil } - return fmt.Errorf("invalid readableBuildInfoSemanticDiagnostic: %s", data) + *r = readableBuildInfoSemanticDiagnostic{ + file: file, + } + return nil } type readableBuildInfoFilePendingEmit struct { @@ -174,6 +183,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 { + return fmt.Errorf("invalid BuildInfoResolvedRoot: %s", data) + } + *b = readableBuildInfoResolvedRoot{ + Resolved: resolvedAndRoot[0], + Root: resolvedAndRoot[1], + } + return nil +} + func toReadableBuildInfo(buildInfo *incremental.BuildInfo, buildInfoText string) string { readable := readableBuildInfo{ buildInfo: buildInfo, @@ -183,9 +213,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 +225,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 +289,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 +411,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/execute/tsctestrunner_test.go b/internal/execute/tsctests/runner.go similarity index 87% rename from internal/execute/tsctestrunner_test.go rename to internal/execute/tsctests/runner.go index d6546c7e06..efaf923e50 100644 --- a/internal/execute/tsctestrunner_test.go +++ b/internal/execute/tsctests/runner.go @@ -1,4 +1,4 @@ -package execute_test +package tsctests import ( "fmt" @@ -9,6 +9,7 @@ import ( "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/execute" + "github.com/microsoft/typescript-go/internal/execute/tsc" "github.com/microsoft/typescript-go/internal/testutil/baseline" "github.com/microsoft/typescript-go/internal/tspath" ) @@ -39,21 +40,21 @@ type tscInput struct { windowsStyleRoot string } -func (test *tscInput) executeCommand(sys *testSys, baselineBuilder *strings.Builder, commandLineArgs []string) execute.CommandLineResult { +func (test *tscInput) executeCommand(sys *testSys, baselineBuilder *strings.Builder, commandLineArgs []string) tsc.CommandLineResult { fmt.Fprint(baselineBuilder, "tsgo ", strings.Join(commandLineArgs, " "), "\n") result := execute.CommandLine(sys, commandLineArgs, sys) switch result.Status { - case execute.ExitStatusSuccess: + case tsc.ExitStatusSuccess: baselineBuilder.WriteString("ExitStatus:: Success") - case execute.ExitStatusDiagnosticsPresent_OutputsSkipped: + case tsc.ExitStatusDiagnosticsPresent_OutputsSkipped: baselineBuilder.WriteString("ExitStatus:: DiagnosticsPresent_OutputsSkipped") - case execute.ExitStatusDiagnosticsPresent_OutputsGenerated: + case tsc.ExitStatusDiagnosticsPresent_OutputsGenerated: baselineBuilder.WriteString("ExitStatus:: DiagnosticsPresent_OutputsGenerated") - case execute.ExitStatusInvalidProject_OutputsSkipped: + case tsc.ExitStatusInvalidProject_OutputsSkipped: baselineBuilder.WriteString("ExitStatus:: InvalidProject_OutputsSkipped") - case execute.ExitStatusProjectReferenceCycle_OutputsSkipped: + case tsc.ExitStatusProjectReferenceCycle_OutputsSkipped: baselineBuilder.WriteString("ExitStatus:: ProjectReferenceCycle_OutputsSkipped") - case execute.ExitStatusNotImplemented: + case tsc.ExitStatusNotImplemented: baselineBuilder.WriteString("ExitStatus:: NotImplemented") default: panic(fmt.Sprintf("UnknownExitStatus %d", result.Status)) @@ -63,11 +64,11 @@ 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{} - sys := newTestSys(test) + sys := newTestSys(test, false) fmt.Fprint( baselineBuilder, "currentDirectory::", @@ -79,7 +80,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 { @@ -94,18 +95,18 @@ func (test *tscInput) run(t *testing.T, scenario string) { } sys.baselineFSwithDiff(baselineBuilder) - var editResult execute.CommandLineResult + var editResult tsc.CommandLineResult if result.Watcher == nil { editResult = test.executeCommand(sys, baselineBuilder, commandLineArgs) } else { 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 - nonIncrementalSys = newTestSys(test) + nonIncrementalSys = newTestSys(test, true) for i := range index + 1 { if test.edits[i].edit != nil { test.edits[i].edit(nonIncrementalSys) @@ -137,7 +138,7 @@ func (test *tscInput) run(t *testing.T, scenario string) { func getDiffForIncremental(incrementalSys *testSys, nonIncrementalSys *testSys) string { var diffBuilder strings.Builder - nonIncrementalOutputs := nonIncrementalSys.testFs().writtenFiles.ToSlice() + nonIncrementalOutputs := nonIncrementalSys.fs.writtenFiles.ToSlice() slices.Sort(nonIncrementalOutputs) for _, nonIncrementalOutput := range nonIncrementalOutputs { if tspath.FileExtensionIs(nonIncrementalOutput, tspath.ExtensionTsBuildInfo) || diff --git a/internal/execute/testsys_test.go b/internal/execute/tsctests/sys.go similarity index 68% rename from internal/execute/testsys_test.go rename to internal/execute/tsctests/sys.go index 44875635a9..90b269bac0 100644 --- a/internal/execute/testsys_test.go +++ b/internal/execute/tsctests/sys.go @@ -1,4 +1,4 @@ -package execute_test +package tsctests import ( "fmt" @@ -12,11 +12,11 @@ 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" + "github.com/microsoft/typescript-go/internal/execute/incremental" + "github.com/microsoft/typescript-go/internal/execute/tsc" "github.com/microsoft/typescript-go/internal/testutil/harnessutil" - "github.com/microsoft/typescript-go/internal/testutil/incrementaltestutil" "github.com/microsoft/typescript-go/internal/testutil/stringtestutil" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" @@ -54,6 +54,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 @@ -74,7 +84,18 @@ func (t *TestClock) SinceStart() time.Duration { return t.Now().Sub(t.start) } -func newTestSys(tscInput *tscInput) *testSys { +func NewTscSystem(files FileMap, useCaseSensitiveFileNames bool, cwd string) *testSys { + clock := &TestClock{start: time.Now()} + return &testSys{ + fs: &testFs{ + FS: vfstest.FromMapWithClock(files, useCaseSensitiveFileNames, clock), + }, + cwd: cwd, + clock: clock, + } +} + +func newTestSys(tscInput *tscInput, forIncrementalCorrectness bool) *testSys { cwd := tscInput.cwd if cwd == "" { cwd = "/home/src/workspaces/project" @@ -84,23 +105,15 @@ func newTestSys(tscInput *tscInput) *testSys { libPath = tscInput.windowsStyleRoot + libPath[1:] } currentWrite := &strings.Builder{} - clock := &TestClock{start: time.Now()} - sys := &testSys{ - fs: &incrementaltestutil.FsHandlingBuildInfo{ - FS: &testFs{ - FS: vfstest.FromMapWithClock(tscInput.files, !tscInput.ignoreCase, clock), - }, - }, - defaultLibraryPath: libPath, - cwd: cwd, - currentWrite: currentWrite, - tracer: harnessutil.NewTracerForBaselining(tspath.ComparePathsOptions{ - UseCaseSensitiveFileNames: !tscInput.ignoreCase, - CurrentDirectory: cwd, - }, currentWrite), - clock: clock, - env: tscInput.env, - } + sys := NewTscSystem(tscInput.files, !tscInput.ignoreCase, cwd) + sys.defaultLibraryPath = libPath + sys.currentWrite = currentWrite + sys.tracer = harnessutil.NewTracerForBaselining(tspath.ComparePathsOptions{ + UseCaseSensitiveFileNames: !tscInput.ignoreCase, + CurrentDirectory: cwd, + }, currentWrite) + sys.env = tscInput.env + sys.forIncrementalCorrectness = forIncrementalCorrectness // Ensure the default library file is present sys.ensureLibPathExists("lib.d.ts") @@ -126,11 +139,12 @@ type snapshot struct { } type testSys struct { - currentWrite *strings.Builder - tracer *harnessutil.TracerForBaselining - serializedDiff *snapshot + currentWrite *strings.Builder + tracer *harnessutil.TracerForBaselining + serializedDiff *snapshot + forIncrementalCorrectness bool - fs *incrementaltestutil.FsHandlingBuildInfo + fs *testFs defaultLibraryPath string cwd string env map[string]string @@ -138,8 +152,8 @@ type testSys struct { } var ( - _ execute.System = (*testSys)(nil) - _ execute.CommandLineTesting = (*testSys)(nil) + _ tsc.System = (*testSys)(nil) + _ tsc.CommandLineTesting = (*testSys)(nil) ) func (s *testSys) Now() time.Time { @@ -154,12 +168,8 @@ func (s *testSys) FS() vfs.FS { return s.fs } -func (s *testSys) testFs() *testFs { - return s.fs.FS.(*testFs) -} - func (s *testSys) fsFromFileMap() iovfs.FsWithSys { - return s.testFs().FS.(iovfs.FsWithSys) + return s.fs.FS.(iovfs.FsWithSys) } func (s *testSys) mapFs() *vfstest.MapFS { @@ -169,10 +179,10 @@ func (s *testSys) mapFs() *vfstest.MapFS { func (s *testSys) ensureLibPathExists(path string) { path = s.defaultLibraryPath + "/" + path if _, ok := s.fsFromFileMap().ReadFile(path); !ok { - if s.testFs().defaultLibs == nil { - s.testFs().defaultLibs = &collections.SyncSet[string]{} + if s.fs.defaultLibs == nil { + s.fs.defaultLibs = &collections.SyncSet[string]{} } - s.testFs().defaultLibs.Add(path) + s.fs.defaultLibs.Add(path) err := s.fsFromFileMap().WriteFile(path, tscDefaultLibContent, false) if err != nil { panic("Failed to write default library file: " + err.Error()) @@ -207,34 +217,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) OnListFilesStart(w io.Writer) { + fmt.Fprintln(w, listFileStart) } -func (s *testSys) OnListFilesEnd() { - fmt.Fprintln(s.Writer(), listFileEnd) +func (s *testSys) OnListFilesEnd(w io.Writer) { + fmt.Fprintln(w, listFileEnd) } -func (s *testSys) OnStatisticsStart() { - fmt.Fprintln(s.Writer(), statisticsStart) +func (s *testSys) OnStatisticsStart(w io.Writer) { + fmt.Fprintln(w, statisticsStart) } -func (s *testSys) OnStatisticsEnd() { - fmt.Fprintln(s.Writer(), statisticsEnd) +func (s *testSys) OnStatisticsEnd(w io.Writer) { + fmt.Fprintln(w, statisticsEnd) } -func (s *testSys) GetTrace() func(str string) { +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 tsc.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 +329,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) { @@ -312,16 +355,27 @@ type outputSanitizer struct { } func (o *outputSanitizer) addOutputLine(s string) { + if change := strings.ReplaceAll(s, fmt.Sprintf("'%s'", core.Version()), fmt.Sprintf("'%s'", harnessutil.FakeTSVersion)); change != s { + s = change + } + if change := strings.ReplaceAll(s, "Version "+core.Version(), "Version "+harnessutil.FakeTSVersion); change != s { + s = change + } 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] - if change := strings.Replace(line, "Version "+core.Version(), "Version "+harnessutil.FakeTSVersion, 1); change != line { - o.addOutputLine(change) - continue - } if strings.HasPrefix(line, buildStartingAt) { if !o.forComparing { o.addOutputLine(buildStartingAt + fakeTimeStamp) @@ -334,9 +388,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 +402,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) @@ -382,7 +444,6 @@ func (s *testSys) baselineFSwithDiff(baseline io.Writer) { // todo: baselines the entire fs, possibly doesn't correctly diff all cases of emitted files, since emit isn't fully implemented and doesn't always emit the same way as strada snap := map[string]*diffEntry{} - testFs := s.testFs() diffs := map[string]string{} for path, file := range s.mapFs().Entries() { @@ -396,7 +457,7 @@ func (s *testSys) baselineFSwithDiff(baseline io.Writer) { s.addFsEntryDiff(diffs, newEntry, path) continue } else if file.Mode.IsRegular() { - newEntry := &diffEntry{content: string(file.Data), mTime: file.ModTime, isWritten: testFs.writtenFiles.Has(path)} + newEntry := &diffEntry{content: string(file.Data), mTime: file.ModTime, isWritten: s.fs.writtenFiles.Has(path)} snap[path] = newEntry s.addFsEntryDiff(diffs, newEntry, path) } @@ -411,8 +472,8 @@ func (s *testSys) baselineFSwithDiff(baseline io.Writer) { } } var defaultLibs collections.SyncSet[string] - if s.testFs().defaultLibs != nil { - s.testFs().defaultLibs.Range(func(libPath string) bool { + if s.fs.defaultLibs != nil { + s.fs.defaultLibs.Range(func(libPath string) bool { defaultLibs.Add(libPath) return true }) @@ -427,7 +488,7 @@ func (s *testSys) baselineFSwithDiff(baseline io.Writer) { fmt.Fprint(baseline, "//// ["+path+"] ", diffs[path], "\n") } fmt.Fprintln(baseline) - testFs.writtenFiles = collections.SyncSet[string]{} // Reset written files after baseline + s.fs.writtenFiles = collections.SyncSet[string]{} // Reset written files after baseline } func (s *testSys) addFsEntryDiff(diffs map[string]string, newDirContent *diffEntry, path string) { @@ -439,7 +500,7 @@ func (s *testSys) addFsEntryDiff(diffs map[string]string, newDirContent *diffEnt } // todo handle more cases of fs changes if oldDirContent == nil { - if s.testFs().defaultLibs == nil || !s.testFs().defaultLibs.Has(path) { + if s.fs.defaultLibs == nil || !s.fs.defaultLibs.Has(path) { if newDirContent.symlinkTarget != "" { diffs[path] = "-> " + newDirContent.symlinkTarget + " *new*" } else { @@ -454,7 +515,7 @@ func (s *testSys) addFsEntryDiff(diffs map[string]string, newDirContent *diffEnt diffs[path] = "*rewrite with same content*" } else if newDirContent.mTime != oldDirContent.mTime { diffs[path] = "*mTime changed*" - } else if defaultLibs != nil && defaultLibs.Has(path) && s.testFs().defaultLibs != nil && !s.testFs().defaultLibs.Has(path) { + } else if defaultLibs != nil && defaultLibs.Has(path) && s.fs.defaultLibs != nil && !s.fs.defaultLibs.Has(path) { // Lib file that was read diffs[path] = "*Lib*\n" + newDirContent.content } @@ -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/tsctests/tsc_test.go b/internal/execute/tsctests/tsc_test.go new file mode 100644 index 0000000000..81eb372253 --- /dev/null +++ b/internal/execute/tsctests/tsc_test.go @@ -0,0 +1,3546 @@ +package tsctests + +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 TestTscCommandline(t *testing.T) { + t.Parallel() + testCases := []*tscInput{ + { + subScenario: "show help with ExitStatus.DiagnosticsPresent_OutputsSkipped", + env: map[string]string{ + "TS_TEST_TERMINAL_WIDTH": "120", + }, + commandLineArgs: nil, + }, + { + subScenario: "show help with ExitStatus.DiagnosticsPresent_OutputsSkipped when host cannot provide terminal width", + commandLineArgs: nil, + }, + { + subScenario: "does not add color when NO_COLOR is set", + env: map[string]string{ + "NO_COLOR": "true", + }, + commandLineArgs: nil, + }, + { + subScenario: "when build not first argument", + commandLineArgs: []string{"--verbose", "--build"}, + }, + { + subScenario: "help", + commandLineArgs: []string{"--help"}, + }, + { + subScenario: "help all", + commandLineArgs: []string{"--help", "--all"}, + }, + { + subScenario: "Parse --lib option with file name", + files: FileMap{"/home/src/workspaces/project/first.ts": `export const Key = Symbol()`}, + commandLineArgs: []string{"--lib", "es6 ", "first.ts"}, + }, + { + subScenario: "Project is empty string", + files: FileMap{ + "/home/src/workspaces/project/first.ts": `export const a = 1`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true, + "noEmit": true + } + }`), + }, + commandLineArgs: []string{}, + }, + { + subScenario: "Parse -p", + files: FileMap{ + "/home/src/workspaces/project/first.ts": `export const a = 1`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true, + "noEmit": true + } + }`), + }, + commandLineArgs: []string{"-p", "."}, + }, + { + subScenario: "Parse -p with path to tsconfig file", + files: FileMap{ + "/home/src/workspaces/project/first.ts": `export const a = 1`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true, + "noEmit": true + } + }`), + }, + commandLineArgs: []string{"-p", "/home/src/workspaces/project/tsconfig.json"}, + }, + { + subScenario: "Parse -p with path to tsconfig folder", + files: FileMap{ + "/home/src/workspaces/project/first.ts": `export const a = 1`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true, + "noEmit": true + } + }`), + }, + commandLineArgs: []string{"-p", "/home/src/workspaces/project"}, + }, + { + subScenario: "Parse enum type options", + commandLineArgs: []string{"--moduleResolution", "nodenext ", "first.ts", "--module", "nodenext", "--target", "esnext", "--moduleDetection", "auto", "--jsx", "react", "--newLine", "crlf"}, + }, + { + subScenario: "Parse watch interval option", + files: FileMap{ + "/home/src/workspaces/project/first.ts": `export const a = 1`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true, + "noEmit": true + } + }`), + }, + commandLineArgs: []string{"-w", "--watchInterval", "1000"}, + }, + { + subScenario: "Parse watch interval option without tsconfig.json", + commandLineArgs: []string{"-w", "--watchInterval", "1000"}, + }, + { + subScenario: "Config with references and empty file and refers to config with noEmit", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`{ + "files": [], + "references": [ + { + "path": "./packages/pkg1" + }, + ], + }`), + "/home/src/workspaces/project/packages/pkg1/tsconfig.json": stringtestutil.Dedent(`{ + "compilerOptions": { + "composite": true, + "noEmit": true + }, + "files": [ + "./index.ts", + ], + }`), + "/home/src/workspaces/project/packages/pkg1/index.ts": `export const a = 1;`, + }, + commandLineArgs: []string{"-p", "."}, + }, + } + + for _, testCase := range testCases { + testCase.run(t, "commandLine") + } +} + +func TestTscComposite(t *testing.T) { + t.Parallel() + 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"}, + }, + { + // !!! sheetal null is not reflected in final options + subScenario: "when setting composite null 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", "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(` + { + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo", + }, + "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", + ], + }`), + }, + 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(` + { + "compilerOptions": { + "module": "none", + "composite": true, + }, + }`), + }, + 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/project/node_modules/solid-js/jsx-runtime.d.ts": stringtestutil.Dedent(` + export namespace JSX { + type IntrinsicElements = { div: {}; }; + } + `), + }, + 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/project/node_modules/solid-js/jsx-runtime.d.ts": stringtestutil.Dedent(` + export namespace JSX { + type IntrinsicElements = { div: {}; }; + } + `), + }, + cwd: "/home/src/projects/project", + }, + } + + for _, testCase := range testCases { + testCase.run(t, "composite") + } +} + +func TestTscDeclarationEmit(t *testing.T) { + t.Parallel() + getBuildDeclarationEmitDtsReferenceAsTrippleSlashMap := func(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 + } + + getTscDeclarationEmitDtsErrorsFileMap := func(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" + } + `), + } + } + + pluginOneConfig := func() string { + return stringtestutil.Dedent(` + { + "compilerOptions": { + "target": "es5", + "declaration": true, + "traceResolution": true, + }, + }`) + } + + pluginOneIndex := func() string { + return `import pluginTwo from "plugin-two"; // include this to add reference to symlink` + } + + pluginOneAction := func() 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 };`) + } + + pluginTwoDts := func() 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;`) + } + + fsaPackageJson := func() string { + return stringtestutil.Dedent(` + { + "name": "typescript-fsa", + "version": "3.0.0-beta-2" + }`) + } + + fsaIndex := func() 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;`) + } + 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 TestTscExtends(t *testing.T) { + t.Parallel() + getBuildConfigFileExtendsFileMap := func() 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;`, + } + } + getTscExtendsWithSymlinkTestCase := func(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"}, + } + } + getTscExtendsConfigDirTestCase := func(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, + } + } + 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 TestTscIncremental(t *testing.T) { + t.Parallel() + getConstEnumTest := func(bdsContents string, changeEnumFile string, testSuffix string) *tscInput { + return &tscInput{ + subScenario: "const enums" + testSuffix, + files: FileMap{ + "/home/src/workspaces/project/a.ts": stringtestutil.Dedent(` + import {A} from "./c" + let a = A.ONE + `), + "/home/src/workspaces/project/b.d.ts": stringtestutil.Dedent(bdsContents), + "/home/src/workspaces/project/c.ts": stringtestutil.Dedent(` + import {A} from "./b" + let b = A.ONE + export {A} + `), + "/home/src/workspaces/project/worker.d.ts": stringtestutil.Dedent(` + export const enum AWorker { + ONE = 1 + } + `), + }, + commandLineArgs: []string{"-i", `a.ts`, "--tsbuildinfofile", "a.tsbuildinfo"}, + edits: []*tscEdit{ + { + caption: "change enum value", + edit: func(sys *testSys) { + sys.replaceFileText(changeEnumFile, "1", "2") + }, + }, + { + caption: "change enum value again", + edit: func(sys *testSys) { + sys.replaceFileText(changeEnumFile, "2", "3") + }, + }, + { + caption: "something else changes in b.d.ts", + edit: func(sys *testSys) { + sys.appendFile("/home/src/workspaces/project/b.d.ts", "export const randomThing = 10;") + }, + }, + { + caption: "something else changes in b.d.ts again", + edit: func(sys *testSys) { + sys.appendFile("/home/src/workspaces/project/b.d.ts", "export const randomThing2 = 10;") + }, + }, + }, + } + } + testCases := []*tscInput{ + { + subScenario: "serializing error chain", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + "strict": true, + "jsx": "react", + "module": "esnext", + }, + }`), + "/home/src/workspaces/project/index.tsx": stringtestutil.Dedent(` + declare namespace JSX { + interface ElementChildrenAttribute { children: {}; } + interface IntrinsicElements { div: {} } + } + + declare var React: any; + + declare function Component(props: never): any; + declare function Component(props: { children?: number }): any; + ( +
+
+ )`), + }, + edits: noChangeOnlyEdit, + }, + { + subScenario: "serializing composite project", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "strict": true, + "module": "esnext", + }, + }`), + "/home/src/workspaces/project/index.tsx": `export const a = 1;`, + "/home/src/workspaces/project/other.ts": `export const b = 2;`, + }, + }, + { + subScenario: "change to modifier of class expression field with declaration emit enabled", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "esnext", + "declaration": true + } + }`), + "/home/src/workspaces/project/main.ts": stringtestutil.Dedent(` + import MessageablePerson from './MessageablePerson.js'; + function logMessage( person: MessageablePerson ) { + console.log( person.message ); + }`), + "/home/src/workspaces/project/MessageablePerson.ts": stringtestutil.Dedent(` + const Messageable = () => { + return class MessageableClass { + public message = 'hello'; + } + }; + const wrapper = () => Messageable(); + type MessageablePerson = InstanceType>; + export default MessageablePerson;`), + tscLibPath + "/lib.d.ts": tscDefaultLibContent + "\n" + stringtestutil.Dedent(` + type ReturnType any> = T extends (...args: any) => infer R ? R : any; + type InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;`), + }, + commandLineArgs: []string{"--incremental"}, + edits: []*tscEdit{ + noChange, + { + caption: "modify public to protected", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "public", "protected") + }, + }, + noChange, + { + caption: "modify protected to public", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "protected", "public") + }, + }, + noChange, + }, + }, + { + subScenario: "change to modifier of class expression field", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "esnext" + } + }`), + "/home/src/workspaces/project/main.ts": stringtestutil.Dedent(` + import MessageablePerson from './MessageablePerson.js'; + function logMessage( person: MessageablePerson ) { + console.log( person.message ); + }`), + "/home/src/workspaces/project/MessageablePerson.ts": stringtestutil.Dedent(` + const Messageable = () => { + return class MessageableClass { + public message = 'hello'; + } + }; + const wrapper = () => Messageable(); + type MessageablePerson = InstanceType>; + export default MessageablePerson;`), + tscLibPath + "/lib.d.ts": tscDefaultLibContent + "\n" + stringtestutil.Dedent(` + type ReturnType any> = T extends (...args: any) => infer R ? R : any; + type InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;`), + }, + commandLineArgs: []string{"--incremental"}, + edits: []*tscEdit{ + noChange, + { + caption: "modify public to protected", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "public", "protected") + }, + }, + noChange, + { + caption: "modify protected to public", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/MessageablePerson.ts", "protected", "public") + }, + }, + noChange, + }, + }, + { + subScenario: "when passing filename for buildinfo on commandline", + 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" + }, + "include": [ + "src/**/*.ts" + ], + }`), + }, + commandLineArgs: []string{"--incremental", "--tsBuildInfoFile", ".tsbuildinfo", "--explainFiles"}, + edits: noChangeOnlyEdit, + }, + { + subScenario: "when passing rootDir from commandline", + files: FileMap{ + "/home/src/workspaces/project/src/main.ts": "export const x = 10;", + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + "outDir": "dist" + } + }`), + }, + commandLineArgs: []string{"--rootDir", "src"}, + edits: noChangeOnlyEdit, + }, + { + subScenario: "with only dts files", + files: FileMap{ + "/home/src/workspaces/project/src/main.d.ts": "export const x = 10;", + "/home/src/workspaces/project/src/another.d.ts": "export const y = 10;", + "/home/src/workspaces/project/tsconfig.json": "{}", + }, + commandLineArgs: []string{"--incremental"}, + edits: []*tscEdit{ + noChange, + { + caption: "modify d.ts file", + edit: func(sys *testSys) { + sys.appendFile("/home/src/workspaces/project/src/main.d.ts", "export const xy = 100;") + }, + }, + }, + }, + { + subScenario: "when passing rootDir is in the tsconfig", + files: FileMap{ + "/home/src/workspaces/project/src/main.ts": "export const x = 10;", + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + "outDir": "dist", + "rootDir": "./" + } + }`), + }, + edits: noChangeOnlyEdit, + }, + { + subScenario: "tsbuildinfo has error", + files: FileMap{ + "/home/src/workspaces/project/main.ts": "export const x = 10;", + "/home/src/workspaces/project/tsconfig.json": "{}", + "/home/src/workspaces/project/tsconfig.tsbuildinfo": "Some random string", + }, + commandLineArgs: []string{"-i"}, + edits: []*tscEdit{ + { + caption: "tsbuildinfo written has error", + edit: func(sys *testSys) { + sys.prependFile("/home/src/workspaces/project/tsconfig.tsbuildinfo", "Some random string") + }, + }, + }, + }, + { + subScenario: "when global file is added, the signatures are updated", + files: FileMap{ + "/home/src/workspaces/project/src/main.ts": stringtestutil.Dedent(` + /// + /// + function main() { } + `), + "/home/src/workspaces/project/src/anotherFileWithSameReferenes.ts": stringtestutil.Dedent(` + /// + /// + function anotherFileWithSameReferenes() { } + `), + "/home/src/workspaces/project/src/filePresent.ts": `function something() { return 10; }`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true }, + "include": ["src/**/*.ts"], + }`), + }, + commandLineArgs: []string{}, + edits: []*tscEdit{ + noChange, + { + caption: "Modify main file", + edit: func(sys *testSys) { + sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `something();`) + }, + }, + { + caption: "Modify main file again", + edit: func(sys *testSys) { + sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `something();`) + }, + }, + { + caption: "Add new file and update main file", + edit: func(sys *testSys) { + sys.writeFileNoError(`/home/src/workspaces/project/src/newFile.ts`, "function foo() { return 20; }", false) + sys.prependFile( + `/home/src/workspaces/project/src/main.ts`, + `/// +`, + ) + sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `foo();`) + }, + }, + { + caption: "Write file that could not be resolved", + edit: func(sys *testSys) { + sys.writeFileNoError(`/home/src/workspaces/project/src/fileNotFound.ts`, "function something2() { return 20; }", false) + }, + }, + { + caption: "Modify main file", + edit: func(sys *testSys) { + sys.appendFile(`/home/src/workspaces/project/src/main.ts`, `something();`) + }, + }, + }, + }, + { + subScenario: "react-jsx-emit-mode with no backing types found doesnt crash", + files: FileMap{ + "/home/src/workspaces/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result + "/home/src/workspaces/project/node_modules/@types/react/index.d.ts": stringtestutil.Dedent(` + export {}; + declare global { + namespace JSX { + interface Element {} + interface IntrinsicElements { + div: { + propA?: boolean; + }; + } + } + }`), // doesn't contain a jsx-runtime definition + "/home/src/workspaces/project/src/index.tsx": `export const App = () =>
;`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "commonjs", + "jsx": "react-jsx", + "incremental": true, + "jsxImportSource": "react" + } + }`), + }, + }, + { + subScenario: "react-jsx-emit-mode with no backing types found doesnt crash under --strict", + files: FileMap{ + "/home/src/workspaces/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result + "/home/src/workspaces/project/node_modules/@types/react/index.d.ts": stringtestutil.Dedent(` + export {}; + declare global { + namespace JSX { + interface Element {} + interface IntrinsicElements { + div: { + propA?: boolean; + }; + } + } + }`), // doesn't contain a jsx-runtime definition + "/home/src/workspaces/project/src/index.tsx": `export const App = () =>
;`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "commonjs", + "jsx": "react-jsx", + "incremental": true, + "jsxImportSource": "react" + } + }`), + }, + commandLineArgs: []string{"--strict"}, + }, + { + subScenario: "change to type that gets used as global through export in another file", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + "/home/src/workspaces/project/class1.ts": stringtestutil.Dedent(` + const a: MagicNumber = 1; + console.log(a);`), + "/home/src/workspaces/project/constants.ts": "export default 1;", + "/home/src/workspaces/project/types.d.ts": `type MagicNumber = typeof import('./constants').default`, + }, + edits: []*tscEdit{ + { + caption: "Modify imports used in global file", + edit: func(sys *testSys) { + sys.writeFileNoError("/home/src/workspaces/project/constants.ts", "export default 2;", false) + }, + expectedDiff: "Currently there is issue with d.ts emit for export default = 1 to widen in dts which is why we are not re-computing errors and results in incorrect error reporting", + }, + }, + }, + { + subScenario: "change to type that gets used as global through export in another file through indirect import", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + "/home/src/workspaces/project/class1.ts": stringtestutil.Dedent(` + const a: MagicNumber = 1; + console.log(a);`), + "/home/src/workspaces/project/constants.ts": "export default 1;", + "/home/src/workspaces/project/reexport.ts": `export { default as ConstantNumber } from "./constants"`, + "/home/src/workspaces/project/types.d.ts": `type MagicNumber = typeof import('./reexport').ConstantNumber`, + }, + edits: []*tscEdit{ + { + caption: "Modify imports used in global file", + edit: func(sys *testSys) { + sys.writeFileNoError("/home/src/workspaces/project/constants.ts", "export default 2;", false) + }, + expectedDiff: "Currently there is issue with d.ts emit for export default = 1 to widen in dts which is why we are not re-computing errors and results in incorrect error reporting", + }, + }, + }, + { + subScenario: "when file is deleted", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "outDir" + } + }`), + "/home/src/workspaces/project/file1.ts": `export class C { }`, + "/home/src/workspaces/project/file2.ts": `export class D { }`, + }, + edits: []*tscEdit{ + { + caption: "delete file with imports", + edit: func(sys *testSys) { + sys.removeNoError("/home/src/workspaces/project/file2.ts") + }, + }, + }, + }, + { + subScenario: "generates typerefs correctly", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "outDir", + "checkJs": true + }, + "include": ["src"], + }`), + "/home/src/workspaces/project/src/box.ts": stringtestutil.Dedent(` + export interface Box { + unbox(): T + } + `), + "/home/src/workspaces/project/src/bug.js": stringtestutil.Dedent(` + import * as B from "./box.js" + import * as W from "./wrap.js" + + /** + * @template {object} C + * @param {C} source + * @returns {W.Wrap} + */ + const wrap = source => { + throw source + } + + /** + * @returns {B.Box} + */ + const box = (n = 0) => ({ unbox: () => n }) + + export const bug = wrap({ n: box(1) }); + `), + "/home/src/workspaces/project/src/wrap.ts": stringtestutil.Dedent(` + export type Wrap = { + [K in keyof C]: { wrapped: C[K] } + } + `), + }, + edits: []*tscEdit{ + { + caption: "modify js file", + edit: func(sys *testSys) { + sys.appendFile("/home/src/workspaces/project/src/bug.js", `export const something = 1;`) + }, + }, + }, + }, + getConstEnumTest(` + export const enum A { + ONE = 1 + } + `, "/home/src/workspaces/project/b.d.ts", ""), + getConstEnumTest(` + export const enum AWorker { + ONE = 1 + } + export { AWorker as A }; + `, "/home/src/workspaces/project/b.d.ts", " aliased"), + getConstEnumTest(`export { AWorker as A } from "./worker";`, "/home/src/workspaces/project/worker.d.ts", " aliased in different file"), + { + subScenario: "option changes with composite", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + } + }`), + "/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;`, + }, + edits: []*tscEdit{ + { + caption: "with sourceMap", + commandLineArgs: []string{"--sourceMap"}, + }, + { + caption: "should re-emit only js so they dont contain sourcemap", + }, + { + caption: "with declaration should not emit anything", + commandLineArgs: []string{"--declaration"}, + // discrepancyExplanation: () => [ + // `Clean build tsbuildinfo will have compilerOptions with composite and ${option.replace(/-/g, "")}`, + // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option composite only`, + // ], + }, + noChange, + { + caption: "with declaration and declarationMap", + commandLineArgs: []string{"--declaration", "--declarationMap"}, + }, + { + caption: "should re-emit only dts so they dont contain sourcemap", + }, + { + caption: "with emitDeclarationOnly should not emit anything", + commandLineArgs: []string{"--emitDeclarationOnly"}, + // discrepancyExplanation: () => [ + // `Clean build tsbuildinfo will have compilerOptions with composite and ${option.replace(/-/g, "")}`, + // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option composite only`, + // ], + }, + 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{"--declaration"}, + // discrepancyExplanation: () => [ + // `Clean build tsbuildinfo will have compilerOptions with composite and ${option.replace(/-/g, "")}`, + // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option composite only`, + // ], + }, + { + caption: "with inlineSourceMap", + commandLineArgs: []string{"--inlineSourceMap"}, + }, + { + caption: "with sourceMap", + commandLineArgs: []string{"--sourceMap"}, + }, + { + caption: "declarationMap enabling", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/tsconfig.json", `"composite": true,`, `"composite": true, "declarationMap": true`) + }, + }, + { + caption: "with sourceMap should not emit d.ts", + commandLineArgs: []string{"--sourceMap"}, + }, + }, + }, + { + subScenario: "option changes with incremental", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + } + }`), + "/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;`, + }, + edits: []*tscEdit{ + { + caption: "with sourceMap", + commandLineArgs: []string{"--sourceMap"}, + }, + { + caption: "should re-emit only js so they dont contain sourcemap", + }, + { + caption: "with declaration, emit Dts and should not emit js", + commandLineArgs: []string{"--declaration"}, + }, + { + caption: "with declaration and declarationMap", + commandLineArgs: []string{"--declaration", "--declarationMap"}, + }, + { + caption: "no change", + // discrepancyExplanation: () => [ + // `Clean build tsbuildinfo will have compilerOptions {}`, + // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option declaration and declarationMap`, + // ], + }, + { + 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{"--declaration", "--declarationMap"}, + }, + { + caption: "no change", + // discrepancyExplanation: () => [ + // `Clean build tsbuildinfo will have compilerOptions {}`, + // `Incremental build will detect that it doesnt need to rebuild so tsbuild info is from before which has option declaration and declarationMap`, + // ], + }, + { + caption: "with inlineSourceMap", + commandLineArgs: []string{"--inlineSourceMap"}, + }, + { + caption: "with sourceMap", + commandLineArgs: []string{"--sourceMap"}, + }, + { + caption: "emit js files", + }, + { + caption: "with declaration and declarationMap", + commandLineArgs: []string{"--declaration", "--declarationMap"}, + }, + { + caption: "with declaration and declarationMap, should not re-emit", + commandLineArgs: []string{"--declaration", "--declarationMap"}, + }, + }, + }, + } + + for _, test := range testCases { + test.run(t, "incremental") + } +} + +func TestTscLibraryResolution(t *testing.T) { + t.Parallel() + getTscLibraryResolutionFileMap := func(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 + } + getTscLibResolutionTestCases := func(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, + }, + } + } + getTscLibraryResolutionUnknown := func() 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 { }", + } + } + 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 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 TestTscModuleResolution(t *testing.T) { + t.Parallel() + getBuildModuleResolutionInProjectRefTestCase := func(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"}, + } + } + getTscModuleResolutionSharingFileMap := func() 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"), + } + } + getTscModuleResolutionAlternateResultAtTypesPackageJson := func(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)) + } + getTscModuleResolutionAlternateResultPackageJson := func(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)) + } + getTscModuleResolutionAlternateResultDts := func(packageName string) string { + return fmt.Sprintf(`export declare const %s: number;`, packageName) + } + getTscModuleResolutionAlternateResultJs := func(packageName string) string { + return fmt.Sprintf(`module.exports = { %s: 1 };`, packageName) + } + getTscModuleResolutionAlternateResultMjs := func(packageName string) string { + return fmt.Sprintf(`export const %s = 1;`, packageName) + } + 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 TestTscNoCheck(t *testing.T) { + t.Parallel() + type noCheckScenario struct { + subScenario string + aText string + } + getTscNoCheckTestCase := func(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, + }, + addErrorNoCheck, + fixErrorNoCheck, + noChangeWithCheck, + noChange, // Should be no op + noChangeWithCheck, // Should be no op + }, + } + } + + cases := []noCheckScenario{ + {"syntax errors", `export const a = "hello`}, + {"semantic errors", `export const a: number = "hello";`}, + {"dts errors", `export const a = class { private p = 10; };`}, + } + 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 TestTscNoEmit(t *testing.T) { + t.Parallel() + type tscNoEmitScenario struct { + subScenario string + aText string + dtsEnabled bool + } + noEmitScenarios := []*tscNoEmitScenario{ + { + subScenario: "syntax errors", + aText: `const a = "hello`, + }, + { + subScenario: "semantic errors", + aText: `const a: number = "hello"`, + }, + { + subScenario: "dts errors", + aText: `const a = class { private p = 10; };`, + dtsEnabled: true, + }, + { + subScenario: "dts errors without dts enabled", + aText: `const a = class { private p = 10; };`, + }, + } + getTscNoEmitAndErrorsFileMap := func(scenario *tscNoEmitScenario, incremental bool, asModules bool) FileMap { + files := FileMap{ + "/home/src/projects/project/a.ts": core.IfElse(asModules, `export `, "") + scenario.aText, + "/home/src/projects/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(` + { + "compilerOptions": { + "incremental": %t, + "declaration": %t + } + } + `, incremental, scenario.dtsEnabled)), + } + if asModules { + files["/home/src/projects/project/b.ts"] = `export const b = 10;` + } + return files + } + getTscNoEmitAndErrorsEdits := func(scenario *tscNoEmitScenario, commandLineArgs []string, asModules bool) []*tscEdit { + fixedATsContent := core.IfElse(asModules, "export ", "") + `const a = "hello";` + return []*tscEdit{ + noChange, + { + caption: "Fix error", + edit: func(sys *testSys) { + sys.writeFileNoError("/home/src/projects/project/a.ts", fixedATsContent, false) + }, + }, + noChange, + { + caption: "Emit after fixing error", + commandLineArgs: commandLineArgs, + }, + noChange, + { + caption: "Introduce error", + edit: func(sys *testSys) { + sys.writeFileNoError("/home/src/projects/project/a.ts", scenario.aText, false) + }, + }, + { + caption: "Emit when error", + commandLineArgs: commandLineArgs, + }, + noChange, + } + } + getTscNoEmitAndErrorsTestCases := func(scenarios []*tscNoEmitScenario, commandLineArgs []string) []*tscInput { + testingCases := make([]*tscInput, 0, len(scenarios)*3) + for _, scenario := range scenarios { + testingCases = append( + testingCases, + &tscInput{ + subScenario: scenario.subScenario, + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), + files: getTscNoEmitAndErrorsFileMap(scenario, false, false), + cwd: "/home/src/projects/project", + edits: getTscNoEmitAndErrorsEdits(scenario, commandLineArgs, false), + }, + &tscInput{ + subScenario: scenario.subScenario + " with incremental", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), + files: getTscNoEmitAndErrorsFileMap(scenario, true, false), + cwd: "/home/src/projects/project", + edits: getTscNoEmitAndErrorsEdits(scenario, commandLineArgs, false), + }, + &tscInput{ + subScenario: scenario.subScenario + " with incremental as modules", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), + files: getTscNoEmitAndErrorsFileMap(scenario, true, true), + cwd: "/home/src/projects/project", + edits: getTscNoEmitAndErrorsEdits(scenario, commandLineArgs, true), + }, + ) + } + return testingCases + } + getTscNoEmitChangesFileMap := func(optionsStr string) FileMap { + return FileMap{ + "/home/src/workspaces/project/src/class.ts": stringtestutil.Dedent(` + export class classC { + prop = 1; + }`), + "/home/src/workspaces/project/src/indirectClass.ts": stringtestutil.Dedent(` + import { classC } from './class'; + export class indirectClass { + classC = new classC(); + }`), + "/home/src/workspaces/project/src/directUse.ts": stringtestutil.Dedent(` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`), + "/home/src/workspaces/project/src/indirectUse.ts": stringtestutil.Dedent(` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`), + "/home/src/workspaces/project/src/noChangeFile.ts": stringtestutil.Dedent(` + export function writeLog(s: string) { + }`), + "/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts": stringtestutil.Dedent(` + function someFunc(arguments: boolean, ...rest: any[]) { + }`), + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(` + { + "compilerOptions": { %s } + }`, optionsStr)), + } + } + + type tscNoEmitChangesScenario struct { + subScenario string + optionsString string + } + noEmitChangesScenarios := []*tscNoEmitChangesScenario{ + { + // !!! sheetal missing initial reporting of Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters is absent + subScenario: "composite", + optionsString: `"composite": true`, + }, + { + subScenario: "incremental declaration", + optionsString: `"incremental": true, "declaration": true`, + }, + { + subScenario: "incremental", + optionsString: `"incremental": true`, + }, + } + getTscNoEmitChangesTestCases := func(scenarios []*tscNoEmitChangesScenario, commandLineArgs []string) []*tscInput { + noChangeWithNoEmit := &tscEdit{ + caption: "No Change run with noEmit", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), + } + noChangeWithEmit := &tscEdit{ + caption: "No Change run with emit", + commandLineArgs: commandLineArgs, + } + introduceError := func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/src/class.ts", "prop", "prop1") + } + fixError := func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/src/class.ts", "prop1", "prop") + } + testCases := make([]*tscInput, 0, len(scenarios)) + for _, scenario := range scenarios { + testCases = append( + testCases, + &tscInput{ + subScenario: "changes " + scenario.subScenario, + commandLineArgs: commandLineArgs, + files: getTscNoEmitChangesFileMap(scenario.optionsString), + edits: []*tscEdit{ + noChangeWithNoEmit, + noChangeWithNoEmit, + { + caption: "Introduce error but still noEmit", + commandLineArgs: noChangeWithNoEmit.commandLineArgs, + edit: introduceError, + }, + { + caption: "Fix error and emit", + edit: fixError, + }, + noChangeWithEmit, + noChangeWithNoEmit, + noChangeWithNoEmit, + noChangeWithEmit, + { + caption: "Introduce error and emit", + edit: introduceError, + }, + noChangeWithEmit, + noChangeWithNoEmit, + noChangeWithNoEmit, + noChangeWithEmit, + { + caption: "Fix error and no emit", + commandLineArgs: noChangeWithNoEmit.commandLineArgs, + edit: fixError, + }, + noChangeWithEmit, + noChangeWithNoEmit, + noChangeWithNoEmit, + noChangeWithEmit, + }, + }, + &tscInput{ + subScenario: "changes with initial noEmit " + scenario.subScenario, + commandLineArgs: noChangeWithNoEmit.commandLineArgs, + files: getTscNoEmitChangesFileMap(scenario.optionsString), + edits: []*tscEdit{ + noChangeWithEmit, + { + caption: "Introduce error with emit", + commandLineArgs: commandLineArgs, + edit: introduceError, + }, + { + caption: "Fix error and no emit", + edit: fixError, + }, + noChangeWithEmit, + }, + }, + ) + } + return testCases + } + getTscNoEmitDtsChangesFileMap := func(incremental bool, asModules bool) FileMap { + files := FileMap{ + "/home/src/projects/project/a.ts": core.IfElse(asModules, `export const a = class { private p = 10; };`, `const a = class { private p = 10; };`), + "/home/src/projects/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(` + { + "compilerOptions": { + "incremental": %t, + } + } + `, incremental)), + } + if asModules { + files["/home/src/projects/project/b.ts"] = `export const b = 10;` + } + return files + } + getTscNoEmitDtsChangesEdits := func(commandLineArgs []string) []*tscEdit { + return []*tscEdit{ + noChange, + { + caption: "With declaration enabled noEmit - Should report errors", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit", "--declaration"}), + }, + { + caption: "With declaration and declarationMap noEmit - Should report errors", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit", "--declaration", "--declarationMap"}), + }, + noChange, + { + caption: "Dts Emit with error", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--declaration"}), + }, + { + caption: "Fix the error", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/projects/project/a.ts", "private", "public") + }, + }, + { + caption: "With declaration enabled noEmit", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit", "--declaration"}), + }, + { + caption: "With declaration and declarationMap noEmit", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit", "--declaration", "--declarationMap"}), + }, + } + } + getTscNoEmitDtsChangesTestCases := func() []*tscInput { + return []*tscInput{ + { + subScenario: "dts errors with declaration enable changes", + commandLineArgs: []string{"-b", "-v", "--noEmit"}, + files: getTscNoEmitDtsChangesFileMap(false, false), + cwd: "/home/src/projects/project", + edits: getTscNoEmitDtsChangesEdits([]string{"-b", "-v"}), + }, + { + subScenario: "dts errors with declaration enable changes with incremental", + commandLineArgs: []string{"-b", "-v", "--noEmit"}, + files: getTscNoEmitDtsChangesFileMap(true, false), + cwd: "/home/src/projects/project", + edits: getTscNoEmitDtsChangesEdits([]string{"-b", "-v"}), + }, + { + subScenario: "dts errors with declaration enable changes with incremental as modules", + commandLineArgs: []string{"-b", "-v", "--noEmit"}, + files: getTscNoEmitDtsChangesFileMap(true, true), + cwd: "/home/src/projects/project", + edits: getTscNoEmitDtsChangesEdits([]string{"-b", "-v"}), + }, + } + } + getTscNoEmitDtsChangesMultiFileErrorsTestCases := func(commandLineArgs []string) []*tscInput { + aContent := `export const a = class { private p = 10; };` + return []*tscInput{ + { + subScenario: "dts errors with declaration enable changes with multiple files", + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), + files: FileMap{ + "/home/src/projects/project/a.ts": aContent, + "/home/src/projects/project/b.ts": `export const b = 10;`, + "/home/src/projects/project/c.ts": strings.Replace(aContent, "a", "c", 1), + "/home/src/projects/project/d.ts": strings.Replace(aContent, "a", "d", 1), + "/home/src/projects/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + } + } + `), + }, + cwd: "/home/src/projects/project", + edits: slices.Concat( + getTscNoEmitDtsChangesEdits(commandLineArgs), + []*tscEdit{ + { + caption: "Fix the another ", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/projects/project/c.ts", "private", "public") + }, + commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit", "--declaration", "--declarationMap"}), + }, + }, + ), + }, + } + } + + testCases := slices.Concat( + []*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"}, + edits: noChangeOnlyEdit, + }, + }, + getTscNoEmitAndErrorsTestCases(noEmitScenarios, []string{}), + getTscNoEmitAndErrorsTestCases(noEmitScenarios, []string{"-b", "-v"}), + getTscNoEmitChangesTestCases(noEmitChangesScenarios, []string{}), + getTscNoEmitChangesTestCases(noEmitChangesScenarios, []string{"-b", "-v"}), + getTscNoEmitDtsChangesTestCases(), + getTscNoEmitDtsChangesMultiFileErrorsTestCases([]string{}), + getTscNoEmitDtsChangesMultiFileErrorsTestCases([]string{"-b", "-v"}), + ) + + for _, test := range testCases { + test.run(t, "noEmit") + } +} + +func TestTscNoEmitOnError(t *testing.T) { + t.Parallel() + type tscNoEmitOnErrorScenario struct { + subScenario string + mainErrorContent string + fixedErrorContent string + } + getTscNoEmitOnErrorFileMap := func(scenario *tscNoEmitOnErrorScenario, declaration bool, incremental bool) FileMap { + return FileMap{ + "/user/username/projects/noEmitOnError/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(` + { + "compilerOptions": { + "outDir": "./dev-build", + "declaration": %t, + "incremental": %t, + "noEmitOnError": true, + }, + }`, declaration, incremental)), + "/user/username/projects/noEmitOnError/shared/types/db.ts": stringtestutil.Dedent(` + export interface A { + name: string; + } + `), + "/user/username/projects/noEmitOnError/src/main.ts": scenario.mainErrorContent, + "/user/username/projects/noEmitOnError/src/other.ts": stringtestutil.Dedent(` + console.log("hi"); + export { } + `), + } + } + getTscNoEmitOnErrorTestCases := func(scenarios []*tscNoEmitOnErrorScenario, commandLineArgs []string) []*tscInput { + testCases := make([]*tscInput, 0, len(scenarios)*4) + for _, scenario := range scenarios { + edits := []*tscEdit{ + noChange, + { + caption: "Fix error", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/noEmitOnError/src/main.ts", scenario.fixedErrorContent, false) + }, + }, + noChange, + } + testCases = append( + testCases, + &tscInput{ + subScenario: scenario.subScenario, + files: getTscNoEmitOnErrorFileMap(scenario, false, false), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + &tscInput{ + subScenario: scenario.subScenario + " with declaration", + files: getTscNoEmitOnErrorFileMap(scenario, true, false), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + &tscInput{ + subScenario: scenario.subScenario + " with incremental", + files: getTscNoEmitOnErrorFileMap(scenario, false, true), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + &tscInput{ + subScenario: scenario.subScenario + " with declaration with incremental", + files: getTscNoEmitOnErrorFileMap(scenario, true, true), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + ) + } + return testCases + } + scenarios := []*tscNoEmitOnErrorScenario{ + { + subScenario: "syntax errors", + mainErrorContent: stringtestutil.Dedent(` + import { A } from "../shared/types/db"; + const a = { + lastName: 'sdsd' + ; + `), + fixedErrorContent: stringtestutil.Dedent(` + import { A } from "../shared/types/db"; + const a = { + lastName: 'sdsd' + };`), + }, + { + subScenario: "semantic errors", + mainErrorContent: stringtestutil.Dedent(` + import { A } from "../shared/types/db"; + const a: string = 10;`), + fixedErrorContent: stringtestutil.Dedent(` + import { A } from "../shared/types/db"; + const a: string = "hello";`), + }, + { + subScenario: "dts errors", + mainErrorContent: stringtestutil.Dedent(` + import { A } from "../shared/types/db"; + export const a = class { private p = 10; }; + `), + fixedErrorContent: stringtestutil.Dedent(` + import { A } from "../shared/types/db"; + export const a = class { p = 10; }; + `), + }, + } + testCases := slices.Concat( + getTscNoEmitOnErrorTestCases(scenarios, []string{}), + getTscNoEmitOnErrorTestCases(scenarios, []string{"-b", "-v"}), + []*tscInput{ + { + subScenario: `when declarationMap changes`, + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "noEmitOnError": true, + "declaration": true, + "composite": true, + }, + }`), + "/home/src/workspaces/project/a.ts": "const x = 10;", + "/home/src/workspaces/project/b.ts": "const y = 10;", + }, + edits: []*tscEdit{ + { + caption: "error and enable declarationMap", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/a.ts", "x", "x: 20") + }, + commandLineArgs: []string{"--declarationMap"}, + }, + { + caption: "fix error declarationMap", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/a.ts", "x: 20", "x") + }, + commandLineArgs: []string{"--declarationMap"}, + }, + }, + }, + { + subScenario: "file deleted before fixing error with noEmitOnError", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "outDir": "outDir", + "noEmitOnError": true, + }, + }`), + "/home/src/workspaces/project/file1.ts": `export const x: 30 = "hello";`, + "/home/src/workspaces/project/file2.ts": `export class D { }`, + }, + commandLineArgs: []string{"-i"}, + edits: []*tscEdit{ + { + caption: "delete file without error", + edit: func(sys *testSys) { + sys.removeNoError("/home/src/workspaces/project/file2.ts") + }, + }, + }, + }, + }, + ) + + for _, test := range testCases { + test.run(t, "noEmitOnError") + } +} + +func TestTscProjectReferences(t *testing.T) { + t.Parallel() + cases := []tscInput{ + { + subScenario: "when project references composite project with noEmit", + files: FileMap{ + "/home/src/workspaces/solution/utils/index.ts": "export const x = 10;", + "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "noEmit": true + } + }`), + "/home/src/workspaces/solution/project/index.ts": `import { x } from "../utils";`, + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` + { + "references": [ + { "path": "../utils" }, + ], + }`), + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "project"}, + }, + { + subScenario: "when project references composite", + files: FileMap{ + "/home/src/workspaces/solution/utils/index.ts": "export const x = 10;", + "/home/src/workspaces/solution/utils/index.d.ts": "export declare const x = 10;", + "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + "/home/src/workspaces/solution/project/index.ts": `import { x } from "../utils";`, + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` + { + "references": [ + { "path": "../utils" }, + ], + }`), + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "project"}, + }, + { + subScenario: "when project reference is not built", + files: FileMap{ + "/home/src/workspaces/solution/utils/index.ts": "export const x = 10;", + "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + "/home/src/workspaces/solution/project/index.ts": `import { x } from "../utils";`, + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` + { + "references": [ + { "path": "../utils" }, + ], + }`), + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "project"}, + }, + { + subScenario: "when project contains invalid project reference", + files: FileMap{ + "/home/src/workspaces/solution/project/index.ts": `export const x = 10;`, + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` + { + "references": [ + { "path": "../utils" }, + ], + }`), + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "project"}, + }, + { + subScenario: "default import interop uses referenced project settings", + files: FileMap{ + "/home/src/workspaces/project/node_modules/ambiguous-package/package.json": stringtestutil.Dedent(` + { + "name": "ambiguous-package" + }`), + "/home/src/workspaces/project/node_modules/ambiguous-package/index.d.ts": "export declare const ambiguous: number;", + "/home/src/workspaces/project/node_modules/esm-package/package.json": stringtestutil.Dedent(` + { + "name": "esm-package", + "type": "module" + }`), + "/home/src/workspaces/project/node_modules/esm-package/index.d.ts": "export declare const esm: number;", + "/home/src/workspaces/project/lib/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "src", + "outDir": "dist", + "module": "esnext", + "moduleResolution": "bundler", + }, + "include": ["src"], + }`), + "/home/src/workspaces/project/lib/src/a.ts": "export const a = 0;", + "/home/src/workspaces/project/lib/dist/a.d.ts": "export declare const a = 0;", + "/home/src/workspaces/project/app/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "esnext", + "moduleResolution": "bundler", + "rootDir": "src", + "outDir": "dist", + }, + "include": ["src"], + "references": [ + { "path": "../lib" }, + ], + }`), + "/home/src/workspaces/project/app/src/local.ts": "export const local = 0;", + "/home/src/workspaces/project/app/src/index.ts": stringtestutil.Dedent(` + import local from "./local"; // Error + import esm from "esm-package"; // Error + import referencedSource from "../../lib/src/a"; // Error + import referencedDeclaration from "../../lib/dist/a"; // Error + import ambiguous from "ambiguous-package"; // Ok`), + }, + commandLineArgs: []string{"--p", "app", "--pretty", "false"}, + }, + { + subScenario: "referencing ambient const enum from referenced project with preserveConstEnums", + files: FileMap{ + "/home/src/workspaces/solution/utils/index.ts": "export const enum E { A = 1 }", + "/home/src/workspaces/solution/utils/index.d.ts": "export declare const enum E { A = 1 }", + "/home/src/workspaces/solution/utils/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "preserveConstEnums": true, + }, + }`), + "/home/src/workspaces/solution/project/index.ts": `import { E } from "../utils"; E.A;`, + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "isolatedModules": true, + }, + "references": [ + { "path": "../utils" }, + ], + }`), + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "project"}, + }, + { + subScenario: "importing const enum from referenced project with preserveConstEnums and verbatimModuleSyntax", + files: FileMap{ + "/home/src/workspaces/solution/preserve/index.ts": "export const enum E { A = 1 }", + "/home/src/workspaces/solution/preserve/index.d.ts": "export declare const enum E { A = 1 }", + "/home/src/workspaces/solution/preserve/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "preserveConstEnums": true, + }, + }`), + "/home/src/workspaces/solution/no-preserve/index.ts": "export const enum E { A = 1 }", + "/home/src/workspaces/solution/no-preserve/index.d.ts": "export declare const enum F { A = 1 }", + "/home/src/workspaces/solution/no-preserve/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "preserveConstEnums": false, + }, + }`), + "/home/src/workspaces/solution/project/index.ts": stringtestutil.Dedent(` + import { E } from "../preserve"; + import { F } from "../no-preserve"; + E.A; + F.A;`), + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "preserve", + "verbatimModuleSyntax": true, + }, + "references": [ + { "path": "../preserve" }, + { "path": "../no-preserve" }, + ], + }`), + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "project", "--pretty", "false"}, + }, + { + subScenario: "rewriteRelativeImportExtensionsProjectReferences1", + files: FileMap{ + "/home/src/workspaces/packages/common/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "rootDir": "src", + "outDir": "dist", + "module": "nodenext" + } + }`), + "/home/src/workspaces/packages/common/package.json": stringtestutil.Dedent(` + { + "name": "common", + "version": "1.0.0", + "type": "module", + "exports": { + ".": { + "source": "./src/index.ts", + "default": "./dist/index.js" + } + } + }`), + "/home/src/workspaces/packages/common/src/index.ts": "export {};", + "/home/src/workspaces/packages/common/dist/index.d.ts": "export {};", + "/home/src/workspaces/packages/main/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "nodenext", + "rewriteRelativeImportExtensions": true, + "rootDir": "src", + "outDir": "dist" + }, + "references": [ + { "path": "../common" } + ] + }`), + "/home/src/workspaces/packages/main/package.json": stringtestutil.Dedent(` + { + "type": "module" + }`), + "/home/src/workspaces/packages/main/src/index.ts": `import {} from "../../common/src/index.ts";`, + }, + cwd: "/home/src/workspaces", + commandLineArgs: []string{"-p", "packages/main", "--pretty", "false"}, + }, + { + subScenario: "rewriteRelativeImportExtensionsProjectReferences2", + files: FileMap{ + "/home/src/workspaces/solution/src/tsconfig-base.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "nodenext", + "composite": true, + "rootDir": ".", + "outDir": "../dist", + "rewriteRelativeImportExtensions": true + } + }`), + "/home/src/workspaces/solution/src/compiler/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": {} + }`), + "/home/src/workspaces/solution/src/compiler/parser.ts": "export {};", + "/home/src/workspaces/solution/dist/compiler/parser.d.ts": "export {};", + "/home/src/workspaces/solution/src/services/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": {}, + "references": [ + { "path": "../compiler" } + ] + }`), + "/home/src/workspaces/solution/src/services/services.ts": `import {} from "../compiler/parser.ts";`, + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "src/services", "--pretty", "false"}, + }, + { + subScenario: "rewriteRelativeImportExtensionsProjectReferences3", + files: FileMap{ + "/home/src/workspaces/solution/src/tsconfig-base.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "module": "nodenext", + "composite": true, + "rewriteRelativeImportExtensions": true + } + }`), + "/home/src/workspaces/solution/src/compiler/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "../../dist/compiler" + } + }`), + "/home/src/workspaces/solution/src/compiler/parser.ts": "export {};", + "/home/src/workspaces/solution/dist/compiler/parser.d.ts": "export {};", + "/home/src/workspaces/solution/src/services/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "../../dist/services" + }, + "references": [ + { "path": "../compiler" } + ] + }`), + "/home/src/workspaces/solution/src/services/services.ts": `import {} from "../compiler/parser.ts";`, + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--p", "src/services", "--pretty", "false"}, + }, + { + subScenario: "default setup was created correctly", + files: FileMap{ + "/home/src/workspaces/project/primary/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + } + }`), + "/home/src/workspaces/project/primary/a.ts": "export { };", + "/home/src/workspaces/project/secondary/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [{ + "path": "../primary" + }] + }`), + "/home/src/workspaces/project/secondary/b.ts": `import * as mod_1 from "../primary/a";`, + }, + commandLineArgs: []string{"--p", "primary/tsconfig.json"}, + }, + { + subScenario: "errors when declaration = false", + files: FileMap{ + "/home/src/workspaces/project/primary/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + "declaration": false + } + }`), + "/home/src/workspaces/project/primary/a.ts": "export { };", + }, + commandLineArgs: []string{"--p", "primary/tsconfig.json"}, + }, + { + subScenario: "errors when the referenced project doesnt have composite", + files: FileMap{ + "/home/src/workspaces/project/primary/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": false, + "outDir": "bin", + } + }`), + "/home/src/workspaces/project/primary/a.ts": "export { };", + "/home/src/workspaces/project/reference/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "files": [ "b.ts" ], + "references": [ { "path": "../primary" } ] + }`), + "/home/src/workspaces/project/reference/b.ts": `import * as mod_1 from "../primary/a";`, + }, + commandLineArgs: []string{"--p", "reference/tsconfig.json"}, + }, + { + subScenario: "does not error when the referenced project doesnt have composite if its a container project", + files: FileMap{ + "/home/src/workspaces/project/primary/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": false, + "outDir": "bin", + } + }`), + "/home/src/workspaces/project/primary/a.ts": "export { };", + "/home/src/workspaces/project/reference/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "files": [ ], + "references": [{ + "path": "../primary" + }] + }`), + "/home/src/workspaces/project/reference/b.ts": `import * as mod_1 from "../primary/a";`, + }, + commandLineArgs: []string{"--p", "reference/tsconfig.json"}, + }, + { + subScenario: "errors when the file list is not exhaustive", + files: FileMap{ + "/home/src/workspaces/project/primary/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "files": [ "a.ts" ] + }`), + "/home/src/workspaces/project/primary/a.ts": "import * as b from './b'", + "/home/src/workspaces/project/primary/b.ts": "export {}", + }, + commandLineArgs: []string{"--p", "primary/tsconfig.json"}, + }, + { + subScenario: "errors when the referenced project doesnt exist", + files: FileMap{ + "/home/src/workspaces/project/primary/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [{ + "path": "../foo" + }] + }`), + "/home/src/workspaces/project/primary/a.ts": "export { };", + }, + commandLineArgs: []string{"--p", "primary/tsconfig.json"}, + }, + { + subScenario: "redirects to the output dts file", + files: FileMap{ + "/home/src/workspaces/project/alpha/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + } + }`), + "/home/src/workspaces/project/alpha/a.ts": "export const m: number = 3;", + "/home/src/workspaces/project/alpha/bin/a.d.ts": "export { };", + "/home/src/workspaces/project/beta/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [ { "path": "../alpha" } ] + }`), + "/home/src/workspaces/project/beta/b.ts": "import { m } from '../alpha/a'", + }, + commandLineArgs: []string{"--p", "beta/tsconfig.json", "--explainFiles"}, + }, + { + subScenario: "issues a nice error when the input file is missing", + files: FileMap{ + "/home/src/workspaces/project/alpha/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [] + }`), + "/home/src/workspaces/project/alpha/a.ts": "export const m: number = 3;", + "/home/src/workspaces/project/beta/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [ { "path": "../alpha" } ] + }`), + "/home/src/workspaces/project/beta/b.ts": "import { m } from '../alpha/a'", + }, + commandLineArgs: []string{"--p", "beta/tsconfig.json"}, + }, + { + subScenario: "issues a nice error when the input file is missing when module reference is not relative", + files: FileMap{ + "/home/src/workspaces/project/alpha/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + } + }`), + "/home/src/workspaces/project/alpha/a.ts": "export const m: number = 3;", + "/home/src/workspaces/project/beta/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + "paths": { + "@alpha/*": ["../alpha/*"], + }, + }, + "references": [ { "path": "../alpha" } ] + }`), + "/home/src/workspaces/project/beta/b.ts": "import { m } from '@alpha/a'", + }, + commandLineArgs: []string{"--p", "beta/tsconfig.json"}, + }, + { + subScenario: "doesnt infer the rootDir from source paths", + files: FileMap{ + "/home/src/workspaces/project/alpha/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [] + }`), + "/home/src/workspaces/project/alpha/src/a.ts": "export const m: number = 3;", + }, + commandLineArgs: []string{"--p", "alpha/tsconfig.json"}, + }, + { + // !!! sheetal rootDir error not reported + subScenario: "errors when a file is outside the rootdir", + files: FileMap{ + "/home/src/workspaces/project/alpha/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [] + }`), + "/home/src/workspaces/project/alpha/src/a.ts": "import * as b from '../../beta/b'", + "/home/src/workspaces/project/beta/b.ts": "export { }", + }, + commandLineArgs: []string{"--p", "alpha/tsconfig.json"}, + }, + } + + for _, c := range cases { + c.run(t, "projectReferences") + } +} + +func TestTypeAcquisition(t *testing.T) { + t.Parallel() + (&tscInput{ + subScenario: "parse tsconfig with typeAcquisition", + files: FileMap{ + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "noEmit": true, + }, + "typeAcquisition": { + "enable": true, + "include": ["0.d.ts", "1.d.ts"], + "exclude": ["0.js", "1.js"], + "disableFilenameBasedTypeAcquisition": true, + }, + }`), + }, + commandLineArgs: []string{}, + }).run(t, "typeAcquisition") +} diff --git a/internal/execute/tsctests/tscbuild_test.go b/internal/execute/tsctests/tscbuild_test.go new file mode 100644 index 0000000000..7e11b25f58 --- /dev/null +++ b/internal/execute/tsctests/tscbuild_test.go @@ -0,0 +1,2937 @@ +package tsctests + +import ( + "fmt" + "slices" + "strings" + "testing" + "time" + + "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/testutil/harnessutil" + "github.com/microsoft/typescript-go/internal/testutil/stringtestutil" + "github.com/microsoft/typescript-go/internal/tsoptions" + "github.com/microsoft/typescript-go/internal/vfs/vfstest" + "gotest.tools/v3/assert" +) + +func TestBuildCommandLine(t *testing.T) { + t.Parallel() + getBuildCommandLineDifferentOptionsMap := func(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;`, + } + } + getBuildCommandLineEmitDeclarationOnlyMap := func(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;`, + } + } + getBuildCommandLineEmitDeclarationOnlyTestCases := func(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"}, + }, + }, + }, + } + } + 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 TestBuildDemoProject(t *testing.T) { + t.Parallel() + + getBuildDemoFileMap := func(modify func(FileMap)) 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", + }, + ], + } + `), + } + if modify != nil { + modify(files) + } + return files + } + testCases := []*tscInput{ + { + subScenario: "in master branch with everything setup correctly and reports no error", + files: getBuildDemoFileMap(nil), + 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(func(files FileMap) { + files["/user/username/projects/demo/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + }, + "references": [ + { + "path": "../zoo", + } + ] + } + `) + }), + 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(func(files FileMap) { + files["/user/username/projects/demo/core/utilities.ts"] = `import * as A from '../animals' +` + files["/user/username/projects/demo/core/utilities.ts"].(string) + }), + cwd: "/user/username/projects/demo", + commandLineArgs: []string{"--b", "--verbose"}, + }, + { + subScenario: "in circular is set in the reference", + files: getBuildDemoFileMap(func(files FileMap) { + files["/user/username/projects/demo/a/tsconfig.json"] = stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/a", + "rootDir": "." + }, + "references": [ + { + "path": "../b", + "circular": true + } + ] + }`) + files["/user/username/projects/demo/b/tsconfig.json"] = stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/b", + "rootDir": "." + }, + "references": [ + { + "path": "../a", + } + ] + }`) + files["/user/username/projects/demo/a/index.ts"] = "export const a = 10;" + files["/user/username/projects/demo/b/index.ts"] = "export const b = 10;" + files["/user/username/projects/demo/tsconfig.json"] = stringtestutil.Dedent(` + { + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals", + }, + { + "path": "./zoo", + }, + { + "path": "./a", + }, + { + "path": "./b", + }, + ], + }`) + }), + cwd: "/user/username/projects/demo", + commandLineArgs: []string{"--b", "--verbose"}, + }, + } + + for _, test := range testCases { + test.run(t, "demo") + } +} + +func TestBuildEmitDeclarationOnly(t *testing.T) { + t.Parallel() + getBuildEmitDeclarationOnlyImportFileMap := func(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 + } + getBuildEmitDeclarationOnlyTestCase := func(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;") + }, + }, + }, + } + } + 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() + getBuildInferredTypeFromTransitiveModuleMap := func(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)), + } + } + 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 TestBuildOutputPaths(t *testing.T) { + t.Parallel() + type tscOutputPathScenario struct { + subScenario string + files FileMap + expectedDtsNames []string + } + runOutputPaths := func(s *tscOutputPathScenario) { + t.Helper() + input := &tscInput{ + subScenario: s.subScenario, + files: s.files, + commandLineArgs: []string{"-b", "-v"}, + edits: []*tscEdit{ + noChange, + { + caption: "Normal build without change, that does not block emit on error to show files that get emitted", + commandLineArgs: []string{"-p", "/home/src/workspaces/project/tsconfig.json"}, + }, + }, + } + input.run(t, "outputPaths") + t.Run("GetOutputFileNames/"+s.subScenario, func(t *testing.T) { + t.Parallel() + sys := newTestSys(input, false) + config, _ := tsoptions.GetParsedCommandLineOfConfigFile("/home/src/workspaces/project/tsconfig.json", &core.CompilerOptions{}, sys, nil) + assert.DeepEqual(t, slices.Collect(config.GetOutputFileNames()), s.expectedDtsNames) + }) + } + testCases := []*tscOutputPathScenario{ + { + subScenario: "when rootDir is not specified", + files: FileMap{ + "/home/src/workspaces/project/src/index.ts": "export const x = 10;", + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "outDir": "dist", + }, + }`), + }, + expectedDtsNames: []string{ + "/home/src/workspaces/project/dist/index.js", + }, + }, + { + subScenario: "when rootDir is not specified and is composite", + files: FileMap{ + "/home/src/workspaces/project/src/index.ts": "export const x = 10;", + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "outDir": "dist", + "composite": true, + }, + }`), + }, + expectedDtsNames: []string{ + "/home/src/workspaces/project/dist/src/index.js", + "/home/src/workspaces/project/dist/src/index.d.ts", + }, + }, + { + subScenario: "when rootDir is specified", + files: FileMap{ + "/home/src/workspaces/project/src/index.ts": "export const x = 10;", + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + }, + }`), + }, + expectedDtsNames: []string{ + "/home/src/workspaces/project/dist/index.js", + }, + }, + { + // !!! sheetal error missing as not yet implemented + subScenario: "when rootDir is specified but not all files belong to rootDir", + files: FileMap{ + "/home/src/workspaces/project/src/index.ts": "export const x = 10;", + "/home/src/workspaces/project/types/type.ts": "export type t = string;", + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + }, + }`), + }, + expectedDtsNames: []string{ + "/home/src/workspaces/project/dist/index.js", + "/home/src/workspaces/project/types/type.js", + }, + }, + { + // !!! sheetal error missing as not yet implemented + subScenario: "when rootDir is specified but not all files belong to rootDir and is composite", + files: FileMap{ + "/home/src/workspaces/project/src/index.ts": "export const x = 10;", + "/home/src/workspaces/project/types/type.ts": "export type t = string;", + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "composite": true + }, + }`), + }, + expectedDtsNames: []string{ + "/home/src/workspaces/project/dist/index.js", + "/home/src/workspaces/project/dist/index.d.ts", + "/home/src/workspaces/project/types/type.js", + "/home/src/workspaces/project/types/type.d.ts", + }, + }, + } + for _, test := range testCases { + runOutputPaths(test) + } +} + +func TestBuildProjectReferenceWithRootDirInParent(t *testing.T) { + t.Parallel() + getBuildProjectReferenceWithRootDirInParentFileMap := func(modify func(files FileMap)) FileMap { + files := FileMap{ + "/home/src/workspaces/solution/src/main/a.ts": stringtestutil.Dedent(` + import { b } from './b'; + const a = b; + `), + "/home/src/workspaces/solution/src/main/b.ts": stringtestutil.Dedent(` + export const b = 0; + `), + "/home/src/workspaces/solution/src/main/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" }, + ], + }`), + "/home/src/workspaces/solution/src/other/other.ts": stringtestutil.Dedent(` + export const Other = 0; + `), + "/home/src/workspaces/solution/src/other/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../../tsconfig.base.json", + } + `), + "/home/src/workspaces/solution/tsconfig.base.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true, + }, + "exclude": [ + "node_modules", + ], + }`), + } + if modify != nil { + modify(files) + } + return files + } + testCases := []*tscInput{ + { + subScenario: "builds correctly", + files: getBuildProjectReferenceWithRootDirInParentFileMap(nil), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "src/main", "/home/src/workspaces/solution/src/other"}, + }, + { + subScenario: "reports error for same tsbuildinfo file because no rootDir in the base", + files: getBuildProjectReferenceWithRootDirInParentFileMap( + func(files FileMap) { + text, _ := files["/home/src/workspaces/solution/tsconfig.base.json"] + files["/home/src/workspaces/solution/tsconfig.base.json"] = strings.Replace(text.(string), `"rootDir": "./src/",`, "", 1) + }, + ), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "src/main", "--verbose"}, + }, + { + subScenario: "reports error for same tsbuildinfo file", + files: getBuildProjectReferenceWithRootDirInParentFileMap( + func(files FileMap) { + files["/home/src/workspaces/solution/src/main/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + "references": [{ "path": "../other" }] + }`) + files["/home/src/workspaces/solution/src/other/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + }`) + }, + ), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "src/main", "--verbose"}, + edits: noChangeOnlyEdit, + }, + { + subScenario: "reports error for same tsbuildinfo file without incremental", + files: getBuildProjectReferenceWithRootDirInParentFileMap( + func(files FileMap) { + files["/home/src/workspaces/solution/src/main/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "outDir": "../../dist/" }, + "references": [{ "path": "../other" }] + }`) + files["/home/src/workspaces/solution/src/other/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + }`) + }, + ), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "src/main", "--verbose"}, + }, + { + subScenario: "reports error for same tsbuildinfo file without incremental with tsc", + files: getBuildProjectReferenceWithRootDirInParentFileMap( + func(files FileMap) { + files["/home/src/workspaces/solution/src/main/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "outDir": "../../dist/" }, + "references": [{ "path": "../other" }] + }`) + files["/home/src/workspaces/solution/src/other/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + }`) + }, + ), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "src/other", "--verbose"}, + edits: []*tscEdit{ + { + caption: "Running tsc on main", + commandLineArgs: []string{"-p", "src/main"}, + }, + }, + }, + { + subScenario: "reports no error when tsbuildinfo differ", + files: getBuildProjectReferenceWithRootDirInParentFileMap( + func(files FileMap) { + delete(files, "/home/src/workspaces/solution/src/main/tsconfig.json") + delete(files, "/home/src/workspaces/solution/src/other/tsconfig.json") + files["/home/src/workspaces/solution/src/main/tsconfig.main.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + "references": [{ "path": "../other/tsconfig.other.json" }] + }`) + files["/home/src/workspaces/solution/src/other/tsconfig.other.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + }`) + }, + ), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "src/main/tsconfig.main.json", "--verbose"}, + edits: noChangeOnlyEdit, + }, + } + + for _, test := range testCases { + test.run(t, "projectReferenceWithRootDirInParent") + } +} + +func TestBuildResolveJsonModule(t *testing.T) { + t.Parallel() + type buildResolveJsonModuleScenario struct { + subScenario string + tsconfigFiles string + additionalCompilerOptions string + skipOutdir bool + modifyFiles func(files FileMap) + edits []*tscEdit + } + getBuildResolveJsonModuleFileMap := func(composite bool, s *buildResolveJsonModuleScenario) FileMap { + var outDirStr string + if !s.skipOutdir { + outDirStr = `"outDir": "dist",` + } + files := FileMap{ + "/home/src/workspaces/solution/project/src/hello.json": stringtestutil.Dedent(` + { + "hello": "world" + }`), + "/home/src/workspaces/solution/project/src/index.ts": stringtestutil.Dedent(` + import hello from "./hello.json" + export default hello.hello + `), + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(` + { + "compilerOptions": { + "composite": %t, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + %s + "skipDefaultLibCheck": true, + %s + }, + %s + }`, composite, outDirStr, s.additionalCompilerOptions, s.tsconfigFiles)), + } + if s.modifyFiles != nil { + s.modifyFiles(files) + } + return files + } + getBuildResolveJsonModuleTestCases := func(scenarios []*buildResolveJsonModuleScenario) []*tscInput { + testCases := make([]*tscInput, 0, len(scenarios)*2) + for _, s := range scenarios { + testCases = append( + testCases, + &tscInput{ + subScenario: s.subScenario, + files: getBuildResolveJsonModuleFileMap(true, s), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "project", "--v", "--explainFiles", "--listEmittedFiles"}, + edits: s.edits, + }, + &tscInput{ + subScenario: s.subScenario + " non-composite", + files: getBuildResolveJsonModuleFileMap(false, s), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "project", "--v", "--explainFiles", "--listEmittedFiles"}, + edits: s.edits, + }, + ) + } + return testCases + } + scenarios := []*buildResolveJsonModuleScenario{ + { + subScenario: "include only", + tsconfigFiles: `"include": [ "src/**/*" ],`, + }, + { + subScenario: "include only without outDir", + tsconfigFiles: `"include": [ "src/**/*" ],`, + skipOutdir: true, + }, + { + subScenario: "include only with json not in rootDir", + tsconfigFiles: `"include": [ "src/**/*" ],`, + additionalCompilerOptions: `"rootDir": "src",`, + modifyFiles: func(files FileMap) { + text, _ := files["/home/src/workspaces/solution/project/src/hello.json"] + delete(files, "/home/src/workspaces/solution/project/src/hello.json") + files["/home/src/workspaces/solution/project/hello.json"] = text + text, _ = files["/home/src/workspaces/solution/project/src/index.ts"] + files["/home/src/workspaces/solution/project/src/index.ts"] = strings.Replace(text.(string), "./hello.json", "../hello.json", 1) + }, + }, + { + subScenario: "include only with json without rootDir but outside configDirectory", + tsconfigFiles: `"include": [ "src/**/*" ],`, + modifyFiles: func(files FileMap) { + text, _ := files["/home/src/workspaces/solution/project/src/hello.json"] + delete(files, "/home/src/workspaces/solution/project/src/hello.json") + files["/home/src/workspaces/solution/hello.json"] = text + text, _ = files["/home/src/workspaces/solution/project/src/index.ts"] + files["/home/src/workspaces/solution/project/src/index.ts"] = strings.Replace(text.(string), "./hello.json", "../../hello.json", 1) + }, + }, + { + subScenario: "include of json along with other include", + tsconfigFiles: `"include": [ "src/**/*", "src/**/*.json" ],`, + }, + { + subScenario: "include of json along with other include and file name matches ts file", + tsconfigFiles: `"include": [ "src/**/*", "src/**/*.json" ],`, + modifyFiles: func(files FileMap) { + text, _ := files["/home/src/workspaces/solution/project/src/hello.json"] + delete(files, "/home/src/workspaces/solution/project/src/hello.json") + files["/home/src/workspaces/solution/project/src/index.json"] = text + text, _ = files["/home/src/workspaces/solution/project/src/index.ts"] + files["/home/src/workspaces/solution/project/src/index.ts"] = strings.Replace(text.(string), "./hello.json", "./index.json", 1) + }, + }, + { + subScenario: "files containing json file", + tsconfigFiles: `"files": [ "src/index.ts", "src/hello.json", ],`, + }, + { + subScenario: "include and files", + tsconfigFiles: `"files": [ "src/hello.json" ], "include": [ "src/**/*" ],`, + }, + { + subScenario: "sourcemap", + tsconfigFiles: `"files": [ "src/index.ts", "src/hello.json", ],`, + additionalCompilerOptions: `"sourceMap": true,`, + edits: noChangeOnlyEdit, + }, + { + subScenario: "without outDir", + tsconfigFiles: `"files": [ "src/index.ts", "src/hello.json", ],`, + skipOutdir: true, + edits: noChangeOnlyEdit, + }, + } + testCases := slices.Concat( + getBuildResolveJsonModuleTestCases(scenarios), + []*tscInput{ + { + subScenario: "importing json module from project reference", + files: FileMap{ + "/home/src/workspaces/solution/project/strings/foo.json": stringtestutil.Dedent(` + { + "foo": "bar baz" + } + `), + "/home/src/workspaces/solution/project/strings/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../tsconfig.json", + "include": ["foo.json"], + "references": [], + } + `), + "/home/src/workspaces/solution/project/main/index.ts": stringtestutil.Dedent(` + import { foo } from '../strings/foo.json'; + console.log(foo); + `), + "/home/src/workspaces/solution/project/main/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../tsconfig.json", + "include": [ + "./**/*.ts", + ], + "references": [{ + "path": "../strings/tsconfig.json", + }], + } + `), + "/home/src/workspaces/solution/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "rootDir": "./", + "composite": true, + "resolveJsonModule": true, + "strict": true, + "esModuleInterop": true, + }, + "references": [ + { "path": "./strings/tsconfig.json" }, + { "path": "./main/tsconfig.json" }, + ], + "files": [], + } + `), + }, + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "project", "--verbose", "--explainFiles"}, + edits: noChangeOnlyEdit, + }, + }, + ) + + for _, test := range testCases { + test.run(t, "resolveJsonModule") + } +} + +func TestBuildRoots(t *testing.T) { + t.Parallel() + getBuildRootsFromProjectReferencedProjectFileMap := func(serverFirst bool) FileMap { + include := core.IfElse(serverFirst, `"src/**/*.ts", "../shared/src/**/*.ts"`, `"../shared/src/**/*.ts", "src/**/*.ts"`) + return FileMap{ + "/home/src/workspaces/solution/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "projects/server" }, + { "path": "projects/shared" }, + ], + }`), + "/home/src/workspaces/solution/projects/shared/src/myClass.ts": `export class MyClass { }`, + "/home/src/workspaces/solution/projects/shared/src/logging.ts": stringtestutil.Dedent(` + export function log(str: string) { + console.log(str); + } + `), + "/home/src/workspaces/solution/projects/shared/src/random.ts": stringtestutil.Dedent(` + export function randomFn(str: string) { + console.log(str); + } + `), + "/home/src/workspaces/solution/projects/shared/tsconfig.json": stringtestutil.Dedent(` + { + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + }, + "include": ["src/**/*.ts"], + }`), + "/home/src/workspaces/solution/projects/server/src/server.ts": stringtestutil.Dedent(` + import { MyClass } from ':shared/myClass.js'; + console.log('Hello, world!'); + `), + "/home/src/workspaces/solution/projects/server/tsconfig.json": stringtestutil.Dedent(fmt.Sprintf(` + { + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "..", + "outDir": "./dist", + "paths": { + ":shared/*": ["./src/../../shared/src/*"], + }, + }, + "include": [ %s ], + "references": [ + { "path": "../shared" }, + ], + }`, include)), + } + } + getBuildRootsFromProjectReferencedProjectTestEdits := func() []*tscEdit { + return []*tscEdit{ + noChange, + { + caption: "edit logging file", + edit: func(sys *testSys) { + sys.appendFile("/home/src/workspaces/solution/projects/shared/src/logging.ts", "export const x = 10;") + }, + }, + noChange, + { + caption: "delete random file", + edit: func(sys *testSys) { + sys.removeNoError("/home/src/workspaces/solution/projects/shared/src/random.ts") + }, + }, + noChange, + } + } + testCases := []*tscInput{ + { + subScenario: `when two root files are consecutive`, + files: FileMap{ + "/home/src/workspaces/project/file1.ts": `export const x = "hello";`, + "/home/src/workspaces/project/file2.ts": `export const y = "world";`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true }, + "include": ["*.ts"], + }`), + }, + commandLineArgs: []string{"--b", "-v"}, + edits: []*tscEdit{ + { + caption: "delete file1", + edit: func(sys *testSys) { + sys.removeNoError("/home/src/workspaces/project/file1.ts") + sys.removeNoError("/home/src/workspaces/project/file1.js") + sys.removeNoError("/home/src/workspaces/project/file1.d.ts") + }, + }, + }, + }, + { + subScenario: `when multiple root files are consecutive`, + files: FileMap{ + "/home/src/workspaces/project/file1.ts": `export const x = "hello";`, + "/home/src/workspaces/project/file2.ts": `export const y = "world";`, + "/home/src/workspaces/project/file3.ts": `export const y = "world";`, + "/home/src/workspaces/project/file4.ts": `export const y = "world";`, + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true }, + "include": ["*.ts"], + }`), + }, + commandLineArgs: []string{"--b", "-v"}, + edits: []*tscEdit{ + { + caption: "delete file1", + edit: func(sys *testSys) { + sys.removeNoError("/home/src/workspaces/project/file1.ts") + sys.removeNoError("/home/src/workspaces/project/file1.js") + sys.removeNoError("/home/src/workspaces/project/file1.d.ts") + }, + }, + }, + }, + { + subScenario: `when files are not consecutive`, + files: FileMap{ + "/home/src/workspaces/project/file1.ts": `export const x = "hello";`, + "/home/src/workspaces/project/random.d.ts": `export const random = "world";`, + "/home/src/workspaces/project/file2.ts": stringtestutil.Dedent(` + import { random } from "./random"; + export const y = "world"; + `), + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true }, + "include": ["file*.ts"], + }`), + }, + commandLineArgs: []string{"--b", "-v"}, + edits: []*tscEdit{ + { + caption: "delete file1", + edit: func(sys *testSys) { + sys.removeNoError("/home/src/workspaces/project/file1.ts") + sys.removeNoError("/home/src/workspaces/project/file1.js") + sys.removeNoError("/home/src/workspaces/project/file1.d.ts") + }, + }, + }, + }, + { + subScenario: `when consecutive and non consecutive are mixed`, + files: FileMap{ + "/home/src/workspaces/project/file1.ts": `export const x = "hello";`, + "/home/src/workspaces/project/file2.ts": `export const y = "world";`, + "/home/src/workspaces/project/random.d.ts": `export const random = "hello";`, + "/home/src/workspaces/project/nonconsecutive.ts": stringtestutil.Dedent(` + import { random } from "./random"; + export const nonConsecutive = "hello"; + `), + "/home/src/workspaces/project/random1.d.ts": `export const random = "hello";`, + "/home/src/workspaces/project/asArray1.ts": stringtestutil.Dedent(` + import { random } from "./random1"; + export const x = "hello"; + `), + "/home/src/workspaces/project/asArray2.ts": `export const x = "hello";`, + "/home/src/workspaces/project/asArray3.ts": `export const x = "hello";`, + "/home/src/workspaces/project/random2.d.ts": `export const random = "hello";`, + "/home/src/workspaces/project/anotherNonConsecutive.ts": stringtestutil.Dedent(` + import { random } from "./random2"; + export const nonConsecutive = "hello"; + `), + "/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true }, + "include": ["file*.ts", "nonconsecutive*.ts", "asArray*.ts", "anotherNonConsecutive.ts"], + }`), + }, + commandLineArgs: []string{"--b", "-v"}, + edits: []*tscEdit{ + { + caption: "delete file1", + edit: func(sys *testSys) { + sys.removeNoError("/home/src/workspaces/project/file1.ts") + sys.removeNoError("/home/src/workspaces/project/file1.js") + sys.removeNoError("/home/src/workspaces/project/file1.d.ts") + }, + }, + }, + }, + { + subScenario: "when root file is from referenced project", + files: getBuildRootsFromProjectReferencedProjectFileMap(true), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "projects/server", "-v", "--traceResolution", "--explainFiles"}, + edits: getBuildRootsFromProjectReferencedProjectTestEdits(), + }, + { + subScenario: "when root file is from referenced project and shared is first", + files: getBuildRootsFromProjectReferencedProjectFileMap(false), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "projects/server", "-v", "--traceResolution", "--explainFiles"}, + edits: getBuildRootsFromProjectReferencedProjectTestEdits(), + }, + } + + for _, test := range testCases { + test.run(t, "roots") + } +} + +func TestBuildSample(t *testing.T) { + t.Parallel() + + getBuildSampleFileMap := func(modify func(files FileMap)) FileMap { + files := FileMap{ + "/user/username/projects/sample1/core/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, + }`), + "/user/username/projects/sample1/core/index.ts": stringtestutil.Dedent(` + export const someString: string = "HELLO WORLD"; + export function leftPad(s: string, n: number) { return s + n; } + export function multiply(a: number, b: number) { return a * b; } + `), + "/user/username/projects/sample1/core/some_decl.d.ts": `declare const dts: any;`, + "/user/username/projects/sample1/core/anotherModule.ts": `export const World = "hello";`, + "/user/username/projects/sample1/logic/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], + }`), + "/user/username/projects/sample1/logic/index.ts": stringtestutil.Dedent(` + import * as c from '../core/index'; + export function getSecondsInDay() { + return c.multiply(10, 15); + } + import * as mod from '../core/anotherModule'; + export const m = mod; + `), + "/user/username/projects/sample1/tests/tsconfig.json": stringtestutil.Dedent(` + { + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, + }`), + "/user/username/projects/sample1/tests/index.ts": stringtestutil.Dedent(` + import * as c from '../core/index'; + import * as logic from '../logic/index'; + + c.leftPad("", 10); + logic.getSecondsInDay(); + + import * as mod from '../core/anotherModule'; + export const m = mod; + `), + } + if modify != nil { + modify(files) + } + return files + } + getBuildSampleCoreChangeEdits := func() []*tscEdit { + return []*tscEdit{ + { + caption: "incremental-declaration-changes", + edit: func(sys *testSys) { + sys.appendFile( + "/user/username/projects/sample1/core/index.ts", + ` +export class someClass { }`, + ) + }, + }, + { + caption: "incremental-declaration-doesnt-change", + edit: func(sys *testSys) { + sys.appendFile( + "/user/username/projects/sample1/core/index.ts", + ` +class someClass2 { }`, + ) + }, + }, + noChange, + } + } + testCases := []*tscInput{ + { + subScenario: "builds correctly when outDir is specified", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/logic/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "outDir": "outDir", + }, + "references": [ + { "path": "../core" }, + ], + }`) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests"}, + }, + { + subScenario: "builds correctly when declarationDir is specified", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/logic/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "declarationDir": "out/decls", + }, + "references": [ + { "path": "../core" }, + ], + }`) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests"}, + }, + { + subScenario: "builds correctly when project is not composite or doesnt have any references", + files: getBuildSampleFileMap(func(files FileMap) { + text, _ := files["/user/username/projects/sample1/core/tsconfig.json"] + files["/user/username/projects/sample1/core/tsconfig.json"] = strings.Replace(text.(string), `"composite": true,`, "", 1) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "core", "--verbose"}, + }, + { + subScenario: "does not write any files in a dry build", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--dry"}, + }, + { + subScenario: "removes all files it built", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests"}, + edits: []*tscEdit{ + { + caption: "removes all files it built", + commandLineArgs: []string{"--b", "tests", "--clean"}, + }, + { + caption: "no change --clean", + commandLineArgs: []string{"--b", "tests", "--clean"}, + }, + }, + }, + { + subScenario: "cleaning project in not build order doesnt throw error", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "logic2", "--clean"}, + }, + { + subScenario: "always builds under with force option", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--force"}, + edits: noChangeOnlyEdit, + }, + { + subScenario: "can detect when and what to rebuild", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: []*tscEdit{ + noChange, + { + // Update a file in the leaf node (tests), only it should rebuild the last one + caption: "Only builds the leaf node project", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/sample1/tests/index.ts", "const m = 10;", false) + }, + }, + { + // Update a file in the parent (without affecting types), should get fast downstream builds + caption: "Detects type-only changes in upstream projects", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/index.ts", "HELLO WORLD", "WELCOME PLANET") + }, + }, + { + caption: "rebuilds when tsconfig changes", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/tests/tsconfig.json", `"composite": true`, `"composite": true, "target": "es2020"`) + }, + }, + }, + }, + { + subScenario: "when input file text does not change but its modified time changes", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: []*tscEdit{ + { + caption: "upstream project changes without changing file text", + edit: func(sys *testSys) { + err := sys.FS().Chtimes("/user/username/projects/sample1/core/index.ts", time.Time{}, sys.Now()) + if err != nil { + panic(err) + } + }, + }, + }, + }, + { + subScenario: "when declarationMap changes", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: []*tscEdit{ + { + caption: "Disable declarationMap", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/tsconfig.json", `"declarationMap": true,`, `"declarationMap": false,`) + }, + }, + { + caption: "Enable declarationMap", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/tsconfig.json", `"declarationMap": false,`, `"declarationMap": true,`) + }, + }, + }, + }, + { + subScenario: "indicates that it would skip builds during a dry build", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests"}, + edits: []*tscEdit{ + { + caption: "--dry", + commandLineArgs: []string{"--b", "tests", "--dry"}, + }, + }, + }, + { + subScenario: "rebuilds from start if force option is set", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests"}, + edits: []*tscEdit{ + { + caption: "--force build", + commandLineArgs: []string{"--b", "tests", "--verbose", "--force"}, + }, + }, + }, + { + subScenario: "tsbuildinfo has error", + files: FileMap{ + "/home/src/workspaces/project/main.ts": "export const x = 10;", + "/home/src/workspaces/project/tsconfig.json": "{}", + "/home/src/workspaces/project/tsconfig.tsbuildinfo": "Some random string", + }, + commandLineArgs: []string{"--b", "-i", "-v"}, + edits: []*tscEdit{ + { + caption: "tsbuildinfo written has error", + edit: func(sys *testSys) { + // This is to ensure the non incremental doesnt crash - as it wont have tsbuildInfo + if !sys.forIncrementalCorrectness { + sys.prependFile("/home/src/workspaces/project/tsconfig.tsbuildinfo", "Some random string") + sys.replaceFileText("/home/src/workspaces/project/tsconfig.tsbuildinfo", fmt.Sprintf(`"version":"%s"`, core.Version()), fmt.Sprintf(`"version":"%s"`, harnessutil.FakeTSVersion)) // build info won't parse, need to manually sterilize for baseline + } + }, + }, + }, + }, + { + subScenario: "rebuilds completely when version in tsbuildinfo doesnt match ts version", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: []*tscEdit{ + { + caption: "convert tsbuildInfo version to something that is say to previous version", + edit: func(sys *testSys) { + // This is to ensure the non incremental doesnt crash - as it wont have tsbuildInfo + if !sys.forIncrementalCorrectness { + sys.replaceFileText("/user/username/projects/sample1/core/tsconfig.tsbuildinfo", fmt.Sprintf(`"version":"%s"`, harnessutil.FakeTSVersion), fmt.Sprintf(`"version":"%s"`, "FakeTsPreviousVersion")) + sys.replaceFileText("/user/username/projects/sample1/logic/tsconfig.tsbuildinfo", fmt.Sprintf(`"version":"%s"`, harnessutil.FakeTSVersion), fmt.Sprintf(`"version":"%s"`, "FakeTsPreviousVersion")) + sys.replaceFileText("/user/username/projects/sample1/tests/tsconfig.tsbuildinfo", fmt.Sprintf(`"version":"%s"`, harnessutil.FakeTSVersion), fmt.Sprintf(`"version":"%s"`, "FakeTsPreviousVersion")) + } + }, + }, + }, + }, + { + subScenario: "rebuilds when extended config file changes", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/tests/tsconfig.base.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "target": "es5" + } + }`) + text, _ := files["/user/username/projects/sample1/tests/tsconfig.json"] + files["/user/username/projects/sample1/tests/tsconfig.json"] = strings.Replace(text.(string), `"references": [`, `"extends": "./tsconfig.base.json", "references": [`, 1) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: []*tscEdit{ + { + caption: "change extended file", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/sample1/tests/tsconfig.base.json", stringtestutil.Dedent(` + { + "compilerOptions": { } + }`), false) + }, + }, + }, + }, + { + subScenario: "building project in not build order doesnt throw error", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "logic2/tsconfig.json", "--verbose"}, + }, + { + subScenario: "builds downstream projects even if upstream projects have errors", + files: getBuildSampleFileMap(func(files FileMap) { + text, _ := files["/user/username/projects/sample1/logic/index.ts"] + files["/user/username/projects/sample1/logic/index.ts"] = strings.Replace(text.(string), "c.multiply(10, 15)", `c.muitply()`, 1) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: noChangeOnlyEdit, + }, + { + subScenario: "skips builds downstream projects if upstream projects have errors with stopBuildOnErrors", + files: getBuildSampleFileMap(func(files FileMap) { + text, _ := files["/user/username/projects/sample1/core/index.ts"] + files["/user/username/projects/sample1/core/index.ts"] = text.(string) + `multiply();` + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose", "--stopBuildOnErrors"}, + edits: []*tscEdit{ + noChange, + { + caption: "fix error", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/index.ts", "multiply();", "") + }, + }, + }, + }, + { + subScenario: "skips builds downstream projects if upstream projects have errors with stopBuildOnErrors when test does not reference core", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/tests/tsconfig.json"] = stringtestutil.Dedent(` + { + "references": [ + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, + }`) + text, _ := files["/user/username/projects/sample1/core/index.ts"] + files["/user/username/projects/sample1/core/index.ts"] = text.(string) + `multiply();` + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose", "--stopBuildOnErrors"}, + edits: []*tscEdit{ + noChange, + { + caption: "fix error", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/index.ts", "multiply();", "") + }, + }, + }, + }, + { + subScenario: "listFiles", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--listFiles"}, + edits: getBuildSampleCoreChangeEdits(), + }, + { + subScenario: "listEmittedFiles", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--listEmittedFiles"}, + edits: getBuildSampleCoreChangeEdits(), + }, + { + subScenario: "explainFiles", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--explainFiles", "--v"}, + edits: getBuildSampleCoreChangeEdits(), + }, + { + subScenario: "sample", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: slices.Concat( + getBuildSampleCoreChangeEdits(), + []*tscEdit{ + { + caption: "when logic config changes declaration dir", + edit: func(sys *testSys) { + sys.replaceFileText( + "/user/username/projects/sample1/logic/tsconfig.json", + `"declaration": true,`, + `"declaration": true, + "declarationDir": "decls",`, + ) + }, + }, + noChange, + }, + ), + }, + { + subScenario: "when logic specifies tsBuildInfoFile", + files: getBuildSampleFileMap(func(files FileMap) { + text, _ := files["/user/username/projects/sample1/logic/tsconfig.json"] + files["/user/username/projects/sample1/logic/tsconfig.json"] = strings.Replace( + text.(string), + `"composite": true,`, + `"composite": true, + "tsBuildInfoFile": "ownFile.tsbuildinfo",`, + 1, + ) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + }, + { + subScenario: "when declaration option changes", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + "skipDefaultLibCheck": true, + }, + }`) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "core", "--verbose"}, + edits: []*tscEdit{ + { + caption: "incremental-declaration-changes", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/tsconfig.json", `"incremental": true,`, `"incremental": true, "declaration": true,`) + }, + }, + }, + }, + { + subScenario: "when target option changes", + files: getBuildSampleFileMap(func(files FileMap) { + files[getTestLibPathFor("esnext.full")] = `/// +/// ` + files[tscLibPath+"/lib.d.ts"] = `/// +/// ` + files["/user/username/projects/sample1/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + "listFiles": true, + "listEmittedFiles": true, + "target": "esnext", + }, + }`) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "core", "--verbose"}, + edits: []*tscEdit{ + { + caption: "incremental-declaration-changes", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/tsconfig.json", `esnext`, `es5`) + }, + }, + }, + }, + { + subScenario: "when module option changes", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + "module": "node18", + }, + }`) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "core", "--verbose"}, + edits: []*tscEdit{ + { + caption: "incremental-declaration-changes", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/tsconfig.json", `node18`, `nodenext`) + }, + }, + }, + }, + { + subScenario: "when esModuleInterop option changes", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/tests/tsconfig.json"] = stringtestutil.Dedent(` + { + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "esModuleInterop": false, + }, + }`) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + edits: []*tscEdit{ + { + caption: "incremental-declaration-changes", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/tests/tsconfig.json", `"esModuleInterop": false`, `"esModuleInterop": true`) + }, + }, + }, + }, + { + // !!! sheetal this is not reporting error as file not found is not yet implemented + subScenario: "reports error if input file is missing", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true }, + "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"], + }`) + delete(files, "/user/username/projects/sample1/core/anotherModule.ts") + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose"}, + }, + { + // !!! sheetal this is not reporting error as file not found is not yet implemented + subScenario: "reports error if input file is missing with force", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { "composite": true }, + "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"], + }`) + delete(files, "/user/username/projects/sample1/core/anotherModule.ts") + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "tests", "--verbose", "--force"}, + }, + } + + for _, test := range testCases { + test.run(t, "sample") + } +} + +func TestBuildTransitiveReferences(t *testing.T) { + t.Parallel() + + getBuildTransitiveReferencesFileMap := func(modify func(files FileMap)) FileMap { + files := FileMap{ + "/user/username/projects/transitiveReferences/refs/a.d.ts": stringtestutil.Dedent(` + export class X {} + export class A {} + `), + "/user/username/projects/transitiveReferences/a.ts": stringtestutil.Dedent(` + export class A {} + `), + "/user/username/projects/transitiveReferences/b.ts": stringtestutil.Dedent(` + import {A} from '@ref/a'; + export const b = new A(); + `), + "/user/username/projects/transitiveReferences/c.ts": stringtestutil.Dedent(` + import {b} from './b'; + import {X} from "@ref/a"; + b; + X; + `), + "/user/username/projects/transitiveReferences/tsconfig.a.json": stringtestutil.Dedent(` + { + "files": ["a.ts"], + "compilerOptions": { + "composite": true, + }, + }`), + "/user/username/projects/transitiveReferences/tsconfig.b.json": stringtestutil.Dedent(` + { + "files": ["b.ts"], + "compilerOptions": { + "composite": true, + "paths": { + "@ref/*": ["./*"], + }, + }, + "references": [{ "path": "tsconfig.a.json" }], + }`), + "/user/username/projects/transitiveReferences/tsconfig.c.json": stringtestutil.Dedent(` + { + "files": ["c.ts"], + "compilerOptions": { + "paths": { + "@ref/*": ["./refs/*"], + }, + }, + "references": [{ "path": "tsconfig.b.json" }], + }`), + } + if modify != nil { + modify(files) + } + return files + } + testCases := []*tscInput{ + { + subScenario: "builds correctly", + files: getBuildTransitiveReferencesFileMap(nil), + cwd: "/user/username/projects/transitiveReferences", + commandLineArgs: []string{"--b", "tsconfig.c.json", "--listFiles"}, + }, + { + subScenario: "reports error about module not found with node resolution with external module name", + files: getBuildTransitiveReferencesFileMap(func(files FileMap) { + files["/user/username/projects/transitiveReferences/b.ts"] = `import {A} from 'a'; +export const b = new A();` + files["/user/username/projects/transitiveReferences/tsconfig.b.json"] = stringtestutil.Dedent(` + { + "files": ["b.ts"], + "compilerOptions": { + "composite": true, + "module": "nodenext", + }, + "references": [{ "path": "tsconfig.a.json" }], + }`) + }), + cwd: "/user/username/projects/transitiveReferences", + commandLineArgs: []string{"--b", "tsconfig.c.json", "--listFiles"}, + }, + } + + for _, test := range testCases { + test.run(t, "transitiveReferences") + } +} + +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") + } +} diff --git a/internal/execute/tscwatch_test.go b/internal/execute/tsctests/tscwatch_test.go similarity index 99% rename from internal/execute/tscwatch_test.go rename to internal/execute/tsctests/tscwatch_test.go index eabb675791..58517bdb35 100644 --- a/internal/execute/tscwatch_test.go +++ b/internal/execute/tsctests/tscwatch_test.go @@ -1,4 +1,4 @@ -package execute_test +package tsctests import ( "strings" diff --git a/internal/execute/watcher.go b/internal/execute/watcher.go index 738c24ae17..aec6179600 100644 --- a/internal/execute/watcher.go +++ b/internal/execute/watcher.go @@ -9,17 +9,19 @@ import ( "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/incremental" + "github.com/microsoft/typescript-go/internal/execute/incremental" + "github.com/microsoft/typescript-go/internal/execute/tsc" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" ) type Watcher struct { - sys System - configFileName string - options *tsoptions.ParsedCommandLine - reportDiagnostic diagnosticReporter - testing CommandLineTesting + sys tsc.System + configFileName string + options *tsoptions.ParsedCommandLine + reportDiagnostic tsc.DiagnosticReporter + reportErrorSummary tsc.DiagnosticsReporter + testing tsc.CommandLineTesting host compiler.CompilerHost program *incremental.Program @@ -27,12 +29,15 @@ type Watcher struct { configModified bool } -func createWatcher(sys System, configParseResult *tsoptions.ParsedCommandLine, reportDiagnostic diagnosticReporter, testing CommandLineTesting) *Watcher { +var _ tsc.Watcher = (*Watcher)(nil) + +func createWatcher(sys tsc.System, configParseResult *tsoptions.ParsedCommandLine, reportDiagnostic tsc.DiagnosticReporter, reportErrorSummary tsc.DiagnosticsReporter, testing tsc.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 { @@ -72,13 +77,13 @@ func (w *Watcher) DoCycle() { Config: w.options, Host: w.host, JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors, - }), w.program, w.testing != nil) + }), w.program, nil, 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 +93,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) + tsc.EmitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.reportErrorSummary, w.sys.Writer(), tsc.CompileTimes{}, w.testing) } func (w *Watcher) hasErrorsInTsConfig() bool { 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/modulespecifiers/specifiers.go b/internal/modulespecifiers/specifiers.go index 588f5a8b5c..8cdcfc6b7d 100644 --- a/internal/modulespecifiers/specifiers.go +++ b/internal/modulespecifiers/specifiers.go @@ -203,7 +203,7 @@ func getEachFileNameOfModule( cwd := host.GetCurrentDirectory() importedPath := tspath.ToPath(importedFileName, cwd, host.UseCaseSensitiveFileNames()) var referenceRedirect string - outputAndReference := host.GetOutputAndProjectReference(importedPath) + outputAndReference := host.GetProjectReferenceFromSource(importedPath) if outputAndReference != nil && outputAndReference.OutputDts != "" { referenceRedirect = outputAndReference.OutputDts } diff --git a/internal/modulespecifiers/types.go b/internal/modulespecifiers/types.go index 309fc8ab6c..eb9881f656 100644 --- a/internal/modulespecifiers/types.go +++ b/internal/modulespecifiers/types.go @@ -52,7 +52,7 @@ type ModuleSpecifierGenerationHost interface { UseCaseSensitiveFileNames() bool GetCurrentDirectory() string - GetOutputAndProjectReference(path tspath.Path) *tsoptions.OutputDtsAndProjectReference + GetProjectReferenceFromSource(path tspath.Path) *tsoptions.SourceOutputAndProjectReference GetRedirectTargets(path tspath.Path) []string GetSourceOfProjectReferenceIfOutputIncluded(file ast.HasFileName) string 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 8378b7abb6..67bb38207c 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -6380,7 +6380,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, @@ -6390,13 +6390,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/printer/emithost.go b/internal/printer/emithost.go index 901598392f..410729570c 100644 --- a/internal/printer/emithost.go +++ b/internal/printer/emithost.go @@ -18,6 +18,6 @@ type EmitHost interface { WriteFile(fileName string, text string, writeByteOrderMark bool) error GetEmitModuleFormatOfFile(file ast.HasFileName) core.ModuleKind GetEmitResolver() EmitResolver - GetOutputAndProjectReference(path tspath.Path) *tsoptions.OutputDtsAndProjectReference + GetProjectReferenceFromSource(path tspath.Path) *tsoptions.SourceOutputAndProjectReference IsSourceFileFromExternalLibrary(file *ast.SourceFile) bool } 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/transformers/tstransforms/importelision_test.go b/internal/transformers/tstransforms/importelision_test.go index 6818a6dc08..3dc5c227cd 100644 --- a/internal/transformers/tstransforms/importelision_test.go +++ b/internal/transformers/tstransforms/importelision_test.go @@ -81,7 +81,7 @@ func (p *fakeProgram) GetSourceOfProjectReferenceIfOutputIncluded(file ast.HasFi return "" } -func (p *fakeProgram) GetOutputAndProjectReference(path tspath.Path) *tsoptions.OutputDtsAndProjectReference { +func (p *fakeProgram) GetProjectReferenceFromSource(path tspath.Path) *tsoptions.SourceOutputAndProjectReference { return nil } @@ -89,7 +89,7 @@ func (p *fakeProgram) IsSourceFromProjectReference(path tspath.Path) bool { return false } -func (p *fakeProgram) GetSourceAndProjectReference(path tspath.Path) *tsoptions.SourceAndProjectReference { +func (p *fakeProgram) GetProjectReferenceFromOutputDts(path tspath.Path) *tsoptions.SourceOutputAndProjectReference { return nil } 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..725b68dc3e 100644 --- a/internal/tsoptions/declscompiler.go +++ b/internal/tsoptions/declscompiler.go @@ -10,8 +10,8 @@ import ( var OptionsDeclarations = slices.Concat(commonOptionsWithBuild, optionsForCompiler) -var optionsForCompiler = []*CommandLineOption{ - //******* commandOptionsWithoutBuild ******* +var commonOptionsWithBuild = []*CommandLineOption{ + //******* commonOptionsWithBuild ******* { Name: "help", ShortName: "h", @@ -235,8 +235,8 @@ var optionsForCompiler = []*CommandLineOption{ }, } -var commonOptionsWithBuild = []*CommandLineOption{ - //******* commandOptionsWithoutBuild ******* +var optionsForCompiler = []*CommandLineOption{ + //******* compilerOptions not common with --build ******* // 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..68e8d46e6b 100644 --- a/internal/tsoptions/parsedcommandline.go +++ b/internal/tsoptions/parsedcommandline.go @@ -27,9 +27,9 @@ type ParsedCommandLine struct { wildcardDirectories map[string]bool extraFileExtensions []FileExtensionInfo - sourceAndOutputMapsOnce sync.Once - sourceToOutput map[tspath.Path]*OutputDtsAndProjectReference - outputDtsToSource map[tspath.Path]*SourceAndProjectReference + sourceAndOutputMapsOnce sync.Once + sourceToProjectReference map[tspath.Path]*SourceOutputAndProjectReference + outputDtsToProjectReference map[tspath.Path]*SourceOutputAndProjectReference commonSourceDirectory string commonSourceDirectoryOnce sync.Once @@ -38,12 +38,8 @@ type ParsedCommandLine struct { resolvedProjectReferencePathsOnce sync.Once } -type SourceAndProjectReference struct { - Source string - Resolved *ParsedCommandLine -} - -type OutputDtsAndProjectReference struct { +type SourceOutputAndProjectReference struct { + Source string OutputDts string Resolved *ParsedCommandLine } @@ -60,34 +56,33 @@ func (p *ParsedCommandLine) ConfigName() string { return p.ConfigFile.SourceFile.FileName() } -func (p *ParsedCommandLine) SourceToOutput() map[tspath.Path]*OutputDtsAndProjectReference { - return p.sourceToOutput +func (p *ParsedCommandLine) SourceToProjectReference() map[tspath.Path]*SourceOutputAndProjectReference { + return p.sourceToProjectReference } -func (p *ParsedCommandLine) OutputDtsToSource() map[tspath.Path]*SourceAndProjectReference { - return p.outputDtsToSource +func (p *ParsedCommandLine) OutputDtsToProjectReference() map[tspath.Path]*SourceOutputAndProjectReference { + return p.outputDtsToProjectReference } func (p *ParsedCommandLine) ParseInputOutputNames() { p.sourceAndOutputMapsOnce.Do(func() { - sourceToOutput := map[tspath.Path]*OutputDtsAndProjectReference{} - outputDtsToSource := map[tspath.Path]*SourceAndProjectReference{} + sourceToOutput := map[tspath.Path]*SourceOutputAndProjectReference{} + outputDtsToSource := map[tspath.Path]*SourceOutputAndProjectReference{} for outputDts, source := range p.GetOutputDeclarationFileNames() { path := tspath.ToPath(source, p.GetCurrentDirectory(), p.UseCaseSensitiveFileNames()) - if outputDts != "" { - outputDtsToSource[tspath.ToPath(outputDts, p.GetCurrentDirectory(), p.UseCaseSensitiveFileNames())] = &SourceAndProjectReference{ - Source: source, - Resolved: p, - } - } - sourceToOutput[path] = &OutputDtsAndProjectReference{ + projectReference := &SourceOutputAndProjectReference{ + Source: source, OutputDts: outputDts, Resolved: p, } + if outputDts != "" { + outputDtsToSource[tspath.ToPath(outputDts, p.GetCurrentDirectory(), p.UseCaseSensitiveFileNames())] = projectReference + } + sourceToOutput[path] = projectReference } - p.outputDtsToSource = outputDtsToSource - p.sourceToOutput = sourceToOutput + p.outputDtsToProjectReference = outputDtsToSource + p.sourceToProjectReference = sourceToOutput }) } @@ -135,6 +130,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 +220,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 +239,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 81edaf6bd1..79e5cbbbb1 100644 --- a/internal/tsoptions/tsconfigparsing.go +++ b/internal/tsoptions/tsconfigparsing.go @@ -1282,9 +1282,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:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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-/// \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, + "inlineSourceMap": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1786 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [11]:: with sourceMap + +tsgo --build --verbose --sourceMap +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] 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":{"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": "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, + "sourceMap": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1780 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js new file mode 100644 index 0000000000..878d6fc9d9 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js @@ -0,0 +1,1085 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project1/src/a.ts] *new* +export const a = 10;const aLocal = 10; +//// [/home/src/workspaces/solution/project1/src/b.ts] *new* +export const b = 10;const bLocal = 10; +//// [/home/src/workspaces/solution/project1/src/c.ts] *new* +import { a } from "./a";export const c = a; +//// [/home/src/workspaces/solution/project1/src/d.ts] *new* +import { b } from "./b";export const d = b; +//// [/home/src/workspaces/solution/project1/src/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true, "emitDeclarationOnly": true } +} +//// [/home/src/workspaces/solution/project2/src/e.ts] *new* +export const e = 10; +//// [/home/src/workspaces/solution/project2/src/f.ts] *new* +import { a } from "../../project1/src/a"; export const f = a; +//// [/home/src/workspaces/solution/project2/src/g.ts] *new* +import { b } from "../../project1/src/b"; export const g = b; +//// [/home/src/workspaces/solution/project2/src/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true, "emitDeclarationOnly": true }, + "references": [{ "path": "../../project1/src" }] +} + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output file 'project2/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/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/project1/src/a.d.ts] *new* +export declare const a = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *new* +export declare const c = 10; + +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *new* +export declare const d = 10; + +//// [/home/src/workspaces/solution/project1/src/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":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1757 +} +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *new* +export declare const e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *new* +export declare const f = 10; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *new* +export declare const g = 10; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[6,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "size": 1825 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [0]:: no change + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/d.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [1]:: change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10; + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1771 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/a.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [2]:: emit js files + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because buildinfo file 'project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; +const aLocal = 10; +const aa = 10; + +//// [/home/src/workspaces/solution/project1/src/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/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/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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":{"emitDeclarationOnly":false,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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": { + "emitDeclarationOnly": false, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1772 +} +//// [/home/src/workspaces/solution/project2/src/e.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.e = void 0; +exports.e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +const a_1 = require("../../project1/src/a"); +exports.f = a_1.a; + +//// [/home/src/workspaces/solution/project2/src/g.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.g = void 0; +const b_1 = require("../../project1/src/b"); +exports.g = b_1.b; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"emitDeclarationOnly":false,"declaration":true},"referencedMap":[[4,1],[6,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": false, + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "size": 1826 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [3]:: no change + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [4]:: no change run with js emit + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [5]:: js emit with change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const blocal = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const blocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"faa2f145f8fb2df488a27873cf169a9a-export const b = 10;const bLocal = 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":{"emitDeclarationOnly":false,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "faa2f145f8fb2df488a27873cf169a9a-export const b = 10;const bLocal = 10;const blocal = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "faa2f145f8fb2df488a27873cf169a9a-export const b = 10;const bLocal = 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": { + "emitDeclarationOnly": false, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1790 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration.js b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration.js new file mode 100644 index 0000000000..df03c5ccdd --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration.js @@ -0,0 +1,572 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project1/src/a.ts] *new* +export const a = 10;const aLocal = 10; +//// [/home/src/workspaces/solution/project1/src/b.ts] *new* +export const b = 10;const bLocal = 10; +//// [/home/src/workspaces/solution/project1/src/c.ts] *new* +import { a } from "./a";export const c = a; +//// [/home/src/workspaces/solution/project1/src/d.ts] *new* +import { b } from "./b";export const d = b; +//// [/home/src/workspaces/solution/project1/src/tsconfig.json] *new* +{ + "compilerOptions": { "declaration": true, "emitDeclarationOnly": true } +} +//// [/home/src/workspaces/solution/project2/src/e.ts] *new* +export const e = 10; +//// [/home/src/workspaces/solution/project2/src/f.ts] *new* +import { a } from "../../project1/src/a"; export const f = a; +//// [/home/src/workspaces/solution/project2/src/g.ts] *new* +import { b } from "../../project1/src/b"; export const g = b; +//// [/home/src/workspaces/solution/project2/src/tsconfig.json] *new* +{ + "compilerOptions": { "declaration": true, "emitDeclarationOnly": true }, + "references": [{ "path": "../../project1/src" }] +} + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output file 'project2/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/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/project1/src/a.d.ts] *new* +export declare const a = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *new* +export declare const c = 10; + +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *new* +export declare const d = 10; + +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts","./d.ts"]} +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + }, + { + "files": [ + "./d.ts" + ], + "original": "./d.ts" + } + ], + "size": 72 +} +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *new* +export declare const e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *new* +export declare const f = 10; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *new* +export declare const g = 10; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["./e.ts","./f.ts","./g.ts"]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": "./e.ts" + }, + { + "files": [ + "./f.ts" + ], + "original": "./f.ts" + }, + { + "files": [ + "./g.ts" + ], + "original": "./g.ts" + } + ], + "size": 77 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [0]:: no change + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/d.ts' is older than output 'project1/src/a.d.ts' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [1]:: change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10; + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [2]:: emit js files + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/a.js' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; +const aLocal = 10; +const aa = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.e = void 0; +exports.e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +const a_1 = require("../../project1/src/a"); +exports.f = a_1.a; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.g = void 0; +const b_1 = require("../../project1/src/b"); +exports.g = b_1.b; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [3]:: no change + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/a.d.ts' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [4]:: no change run with js emit + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/a.js' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [5]:: js emit with change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const blocal = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/a.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const blocal = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/c.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts diff --git a/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline.js b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline.js new file mode 100644 index 0000000000..af6c17224a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline.js @@ -0,0 +1,958 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project1/src/a.ts] *new* +export const a = 10;const aLocal = 10; +//// [/home/src/workspaces/solution/project1/src/b.ts] *new* +export const b = 10;const bLocal = 10; +//// [/home/src/workspaces/solution/project1/src/c.ts] *new* +import { a } from "./a";export const c = a; +//// [/home/src/workspaces/solution/project1/src/d.ts] *new* +import { b } from "./b";export const d = b; +//// [/home/src/workspaces/solution/project1/src/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true, "emitDeclarationOnly": true } +} +//// [/home/src/workspaces/solution/project2/src/e.ts] *new* +export const e = 10; +//// [/home/src/workspaces/solution/project2/src/f.ts] *new* +import { a } from "../../project1/src/a"; export const f = a; +//// [/home/src/workspaces/solution/project2/src/g.ts] *new* +import { b } from "../../project1/src/b"; export const g = b; +//// [/home/src/workspaces/solution/project2/src/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true, "emitDeclarationOnly": true }, + "references": [{ "path": "../../project1/src" }] +} + +tsgo --b project2/src --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output file 'project2/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/src/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/project1/src/a.d.ts] *new* +export declare const a = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *new* +export declare const c = 10; + +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *new* +export declare const d = 10; + +//// [/home/src/workspaces/solution/project1/src/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,"emitDeclarationOnly":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1789 +} +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *new* +export declare const e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *new* +export declare const f = 10; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *new* +export declare const g = 10; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"composite":true,"emitDeclarationOnly":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./g.d.ts"} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "latestChangedDtsFile": "./g.d.ts", + "size": 1800 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project2/src/e.ts +*refresh* /home/src/workspaces/solution/project1/src/a.d.ts +*refresh* /home/src/workspaces/solution/project2/src/f.ts +*refresh* /home/src/workspaces/solution/project1/src/b.d.ts +*refresh* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [0]:: no change + +tsgo --b project2/src --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/d.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date because newest input 'project2/src/g.ts' is older than output 'project2/src/tsconfig.tsbuildinfo' + + + + +Edit [1]:: change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10; + +tsgo --b project2/src --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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,"emitDeclarationOnly":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1803 +} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *mTime changed* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/a.ts + + +Edit [2]:: emit js files + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because buildinfo file 'project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; +const aLocal = 10; +const aa = 10; + +//// [/home/src/workspaces/solution/project1/src/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/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/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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,"emitDeclarationOnly":false},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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, + "emitDeclarationOnly": false + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1804 +} +//// [/home/src/workspaces/solution/project2/src/e.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.e = void 0; +exports.e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +const a_1 = require("../../project1/src/a"); +exports.f = a_1.a; + +//// [/home/src/workspaces/solution/project2/src/g.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.g = void 0; +const b_1 = require("../../project1/src/b"); +exports.g = b_1.b; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"composite":true,"emitDeclarationOnly":false},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./g.d.ts"} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": false + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "latestChangedDtsFile": "./g.d.ts", + "size": 1801 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: no change + +tsgo --b project2/src --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date because newest input 'project2/src/g.ts' is older than output 'project2/src/tsconfig.tsbuildinfo' + + + + +Edit [4]:: no change run with js emit + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date because newest input 'project2/src/g.ts' is older than output 'project2/src/tsconfig.tsbuildinfo' + + + + +Edit [5]:: js emit with change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const blocal = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly false +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const blocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1},{"version":"faa2f145f8fb2df488a27873cf169a9a-export const b = 10;const bLocal = 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,"emitDeclarationOnly":false},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "faa2f145f8fb2df488a27873cf169a9a-export const b = 10;const bLocal = 10;const blocal = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "faa2f145f8fb2df488a27873cf169a9a-export const b = 10;const bLocal = 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, + "emitDeclarationOnly": false + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1822 +} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *mTime changed* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts diff --git a/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js new file mode 100644 index 0000000000..da82286972 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js @@ -0,0 +1,2068 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project1/src/a.ts] *new* +export const a = 10;const aLocal = 10; +//// [/home/src/workspaces/solution/project1/src/b.ts] *new* +export const b = 10;const bLocal = 10; +//// [/home/src/workspaces/solution/project1/src/c.ts] *new* +import { a } from "./a";export const c = a; +//// [/home/src/workspaces/solution/project1/src/d.ts] *new* +import { b } from "./b";export const d = b; +//// [/home/src/workspaces/solution/project1/src/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true } +} +//// [/home/src/workspaces/solution/project2/src/e.ts] *new* +export const e = 10; +//// [/home/src/workspaces/solution/project2/src/f.ts] *new* +import { a } from "../../project1/src/a"; export const f = a; +//// [/home/src/workspaces/solution/project2/src/g.ts] *new* +import { b } from "../../project1/src/b"; export const g = b; +//// [/home/src/workspaces/solution/project2/src/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true }, + "references": [{ "path": "../../project1/src" }] +} + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output file 'project2/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/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/project1/src/a.d.ts] *new* +export declare const a = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *new* +export declare const c = 10; + +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *new* +export declare const d = 10; + +//// [/home/src/workspaces/solution/project1/src/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":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1757 +} +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *new* +export declare const e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *new* +export declare const f = 10; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *new* +export declare const g = 10; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[6,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "size": 1825 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [0]:: no change + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/d.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [1]:: local change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1771 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/a.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [2]:: non local change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *modified* +export declare const a = 10; +export declare const aaa = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1825 +} +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[6,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "size": 1857 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/a.ts +(computed .d.ts) /home/src/workspaces/solution/project1/src/c.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(used version) /home/src/workspaces/solution/project1/src/a.d.ts +(computed .d.ts) /home/src/workspaces/solution/project2/src/f.ts + + +Edit [3]:: emit js files + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because buildinfo file 'project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.aaa = exports.a = void 0; +exports.a = 10; +const aLocal = 10; +const aa = 10; +exports.aaa = 10; + +//// [/home/src/workspaces/solution/project1/src/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/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/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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": 1798 +} +//// [/home/src/workspaces/solution/project2/src/e.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.e = void 0; +exports.e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +const a_1 = require("../../project1/src/a"); +exports.f = a_1.a; + +//// [/home/src/workspaces/solution/project2/src/g.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.g = void 0; +const b_1 = require("../../project1/src/b"); +exports.g = b_1.b; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"declaration":true},"referencedMap":[[4,1],[6,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "size": 1830 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [4]:: no change + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [5]:: js emit with change without emitDeclarationOnly +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10; + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const alocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"f386e1d064172e4046fcc4616723f508-export const b = 10;const bLocal = 10;const alocal = 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/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "f386e1d064172e4046fcc4616723f508-export const b = 10;const bLocal = 10;const alocal = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f386e1d064172e4046fcc4616723f508-export const b = 10;const bLocal = 10;const alocal = 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": 1816 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [6]:: local change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"aaade84f46dfd556c2424cda559cceb1-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 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":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "aaade84f46dfd556c2424cda559cceb1-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aaade84f46dfd556c2424cda559cceb1-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 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": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1859 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: + + +Edit [7]:: non local change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *modified* +export declare const b = 10; +export declare const aaaaa = 10; + +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"5ec434ed3f5c4b5bf474f907d0251bc7-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;","signature":"b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 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":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[5,2]]} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "5ec434ed3f5c4b5bf474f907d0251bc7-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;", + "signature": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5ec434ed3f5c4b5bf474f907d0251bc7-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;", + "signature": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 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": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "size": 1917 +} +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"emitDeclarationOnly":true,"declaration":true},"referencedMap":[[4,1],[6,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n", + "signature": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": true, + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "size": 1891 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts +(computed .d.ts) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(used version) /home/src/workspaces/solution/project1/src/b.d.ts +(computed .d.ts) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [8]:: js emit with change without emitDeclarationOnly +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10; + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because buildinfo file 'project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *modified* +export declare const b = 10; +export declare const aaaaa = 10; +export declare const a2 = 10; + +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a2 = exports.aaaaa = exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const alocal = 10; +const aaaa = 10; +exports.aaaaa = 10; +exports.a2 = 10; + +//// [/home/src/workspaces/solution/project1/src/c.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"5bfdbc5e13f033397af0ab302f42fdf2-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10;","signature":"c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 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/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "5bfdbc5e13f033397af0ab302f42fdf2-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10;", + "signature": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5bfdbc5e13f033397af0ab302f42fdf2-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10;", + "signature": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 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": 1942 +} +//// [/home/src/workspaces/solution/project2/src/e.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"declaration":true},"referencedMap":[[4,1],[6,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n", + "signature": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.ts" + ], + "size": 1895 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts +(computed .d.ts) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(used version) /home/src/workspaces/solution/project1/src/b.d.ts +(computed .d.ts) /home/src/workspaces/solution/project2/src/g.ts diff --git a/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration.js b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration.js new file mode 100644 index 0000000000..3c0d414b7b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration.js @@ -0,0 +1,818 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project1/src/a.ts] *new* +export const a = 10;const aLocal = 10; +//// [/home/src/workspaces/solution/project1/src/b.ts] *new* +export const b = 10;const bLocal = 10; +//// [/home/src/workspaces/solution/project1/src/c.ts] *new* +import { a } from "./a";export const c = a; +//// [/home/src/workspaces/solution/project1/src/d.ts] *new* +import { b } from "./b";export const d = b; +//// [/home/src/workspaces/solution/project1/src/tsconfig.json] *new* +{ + "compilerOptions": { "declaration": true } +} +//// [/home/src/workspaces/solution/project2/src/e.ts] *new* +export const e = 10; +//// [/home/src/workspaces/solution/project2/src/f.ts] *new* +import { a } from "../../project1/src/a"; export const f = a; +//// [/home/src/workspaces/solution/project2/src/g.ts] *new* +import { b } from "../../project1/src/b"; export const g = b; +//// [/home/src/workspaces/solution/project2/src/tsconfig.json] *new* +{ + "compilerOptions": { "declaration": true }, + "references": [{ "path": "../../project1/src" }] +} + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output file 'project2/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/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/project1/src/a.d.ts] *new* +export declare const a = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *new* +export declare const c = 10; + +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *new* +export declare const d = 10; + +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts","./d.ts"]} +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + }, + { + "files": [ + "./d.ts" + ], + "original": "./d.ts" + } + ], + "size": 72 +} +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *new* +export declare const e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *new* +export declare const f = 10; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *new* +export declare const g = 10; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["./e.ts","./f.ts","./g.ts"]} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./e.ts" + ], + "original": "./e.ts" + }, + { + "files": [ + "./f.ts" + ], + "original": "./f.ts" + }, + { + "files": [ + "./g.ts" + ], + "original": "./g.ts" + } + ], + "size": 77 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [0]:: no change + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/d.ts' is older than output 'project1/src/a.d.ts' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [1]:: local change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [2]:: non local change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *modified* +export declare const a = 10; +export declare const aaa = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [3]:: emit js files + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/a.js' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.aaa = exports.a = void 0; +exports.a = 10; +const aLocal = 10; +const aa = 10; +exports.aaa = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.e = void 0; +exports.e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +const a_1 = require("../../project1/src/a"); +exports.f = a_1.a; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.g = void 0; +const b_1 = require("../../project1/src/b"); +exports.g = b_1.b; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [4]:: no change + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/a.d.ts' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [5]:: js emit with change without emitDeclarationOnly +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10; + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/a.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const alocal = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/c.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [6]:: local change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [7]:: non local change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *modified* +export declare const b = 10; +export declare const aaaaa = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [8]:: js emit with change without emitDeclarationOnly +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10; + +tsgo --b project2/src --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +project2/src/tsconfig.json:3:20 - error TS6306: Referenced project '/home/src/workspaces/solution/project1/src' must have setting "composite": true. + +3 "references": [{ "path": "../../project1/src" }] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in project2/src/tsconfig.json:3 + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/a.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *modified* +export declare const b = 10; +export declare const aaaaa = 10; +export declare const a2 = 10; + +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a2 = exports.aaaaa = exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const alocal = 10; +const aaaa = 10; +exports.aaaaa = 10; +exports.a2 = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/c.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/e.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project2/src/e.ts +*not cached* /home/src/workspaces/solution/project1/src/a.d.ts +*not cached* /home/src/workspaces/solution/project2/src/f.ts +*not cached* /home/src/workspaces/solution/project1/src/b.d.ts +*not cached* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts diff --git a/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline.js b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline.js new file mode 100644 index 0000000000..33c144bd20 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline.js @@ -0,0 +1,1880 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project1/src/a.ts] *new* +export const a = 10;const aLocal = 10; +//// [/home/src/workspaces/solution/project1/src/b.ts] *new* +export const b = 10;const bLocal = 10; +//// [/home/src/workspaces/solution/project1/src/c.ts] *new* +import { a } from "./a";export const c = a; +//// [/home/src/workspaces/solution/project1/src/d.ts] *new* +import { b } from "./b";export const d = b; +//// [/home/src/workspaces/solution/project1/src/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} +//// [/home/src/workspaces/solution/project2/src/e.ts] *new* +export const e = 10; +//// [/home/src/workspaces/solution/project2/src/f.ts] *new* +import { a } from "../../project1/src/a"; export const f = a; +//// [/home/src/workspaces/solution/project2/src/g.ts] *new* +import { b } from "../../project1/src/b"; export const g = b; +//// [/home/src/workspaces/solution/project2/src/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [{ "path": "../../project1/src" }] +} + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output file 'project1/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output file 'project2/src/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/src/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/project1/src/a.d.ts] *new* +export declare const a = 10; + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/workspaces/solution/project1/src/c.d.ts] *new* +export declare const c = 10; + +//// [/home/src/workspaces/solution/project1/src/d.d.ts] *new* +export declare const d = 10; + +//// [/home/src/workspaces/solution/project1/src/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,"emitDeclarationOnly":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1789 +} +//// [/home/src/workspaces/solution/project2/src/e.d.ts] *new* +export declare const e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.d.ts] *new* +export declare const f = 10; + +//// [/home/src/workspaces/solution/project2/src/g.d.ts] *new* +export declare const g = 10; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"composite":true,"emitDeclarationOnly":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./g.d.ts"} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "latestChangedDtsFile": "./g.d.ts", + "size": 1800 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project1/src/a.ts +(stored at emit) /home/src/workspaces/solution/project1/src/b.ts +(stored at emit) /home/src/workspaces/solution/project1/src/c.ts +(stored at emit) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project2/src/e.ts +*refresh* /home/src/workspaces/solution/project1/src/a.d.ts +*refresh* /home/src/workspaces/solution/project2/src/f.ts +*refresh* /home/src/workspaces/solution/project1/src/b.d.ts +*refresh* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/e.ts +(stored at emit) /home/src/workspaces/solution/project2/src/f.ts +(stored at emit) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [0]:: no change + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/d.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date because newest input 'project2/src/g.ts' is older than output 'project2/src/tsconfig.tsbuildinfo' + + + + +Edit [1]:: local change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/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":"6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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,"emitDeclarationOnly":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6c5c8e86bc8b70be4222f71e05b56f78-export const a = 10;const aLocal = 10;const aa = 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, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./d.d.ts", + "size": 1803 +} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *mTime changed* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/a.ts + + +Edit [2]:: non local change +//// [/home/src/workspaces/solution/project1/src/a.ts] *modified* +export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/a.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output 'project2/src/tsconfig.tsbuildinfo' is older than input 'project1/src' + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/a.d.ts] *modified* +export declare const a = 10; +export declare const aaa = 10; + +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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,"emitDeclarationOnly":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1857 +} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"composite":true,"emitDeclarationOnly":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./g.d.ts"} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "latestChangedDtsFile": "./g.d.ts", + "size": 1832 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/a.ts +*refresh* /home/src/workspaces/solution/project1/src/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/a.ts +(computed .d.ts) /home/src/workspaces/solution/project1/src/c.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/a.d.ts +*refresh* /home/src/workspaces/solution/project2/src/f.ts +Signatures:: +(used version) /home/src/workspaces/solution/project1/src/a.d.ts +(computed .d.ts) /home/src/workspaces/solution/project2/src/f.ts + + +Edit [3]:: emit js files + +tsgo --b project2/src --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because buildinfo file 'project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.aaa = exports.a = void 0; +exports.a = 10; +const aLocal = 10; +const aa = 10; +exports.aaa = 10; + +//// [/home/src/workspaces/solution/project1/src/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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/solution/project1/src/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/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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":"./a.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 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": "./a.d.ts", + "size": 1830 +} +//// [/home/src/workspaces/solution/project2/src/e.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.e = void 0; +exports.e = 10; + +//// [/home/src/workspaces/solution/project2/src/f.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +const a_1 = require("../../project1/src/a"); +exports.f = a_1.a; + +//// [/home/src/workspaces/solution/project2/src/g.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.g = void 0; +const b_1 = require("../../project1/src/b"); +exports.g = b_1.b; + +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"composite":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./g.d.ts"} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "latestChangedDtsFile": "./g.d.ts", + "size": 1805 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is up to date because newest input 'project1/src/a.ts' is older than output 'project1/src/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date because newest input 'project2/src/g.ts' is older than output 'project2/src/tsconfig.tsbuildinfo' + + + + +Edit [5]:: js emit with change without emitDeclarationOnly +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10; + +tsgo --b project2/src --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const alocal = 10; + +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"f386e1d064172e4046fcc4616723f508-export const b = 10;const bLocal = 10;const alocal = 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":"./a.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "f386e1d064172e4046fcc4616723f508-export const b = 10;const bLocal = 10;const alocal = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f386e1d064172e4046fcc4616723f508-export const b = 10;const bLocal = 10;const alocal = 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": "./a.d.ts", + "size": 1848 +} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *mTime changed* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts + + +Edit [6]:: local change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"aaade84f46dfd556c2424cda559cceb1-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 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,"emitDeclarationOnly":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "aaade84f46dfd556c2424cda559cceb1-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aaade84f46dfd556c2424cda559cceb1-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 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, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1891 +} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *mTime changed* + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts + + +Edit [7]:: non local change +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10; + +tsgo --b project2/src --verbose --emitDeclarationOnly +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because output 'project1/src/tsconfig.tsbuildinfo' is older than input 'project1/src/b.ts' + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because output 'project2/src/tsconfig.tsbuildinfo' is older than input 'project1/src' + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *modified* +export declare const b = 10; +export declare const aaaaa = 10; + +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"5ec434ed3f5c4b5bf474f907d0251bc7-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;","signature":"b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 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,"emitDeclarationOnly":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "5ec434ed3f5c4b5bf474f907d0251bc7-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;", + "signature": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5ec434ed3f5c4b5bf474f907d0251bc7-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;", + "signature": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 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, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./c.ts": [ + "./a.ts" + ], + "./d.ts": [ + "./b.ts" + ] + }, + "latestChangedDtsFile": "./b.d.ts", + "size": 1949 +} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"composite":true,"emitDeclarationOnly":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./g.d.ts"} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n", + "signature": "b41428b0658a7579227ae092a39341d9-export declare const b = 10;\nexport declare const aaaaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "latestChangedDtsFile": "./g.d.ts", + "size": 1866 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts +(computed .d.ts) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.d.ts +*refresh* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(used version) /home/src/workspaces/solution/project1/src/b.d.ts +(computed .d.ts) /home/src/workspaces/solution/project2/src/g.ts + + +Edit [8]:: js emit with change without emitDeclarationOnly +//// [/home/src/workspaces/solution/project1/src/b.ts] *modified* +export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10; + +tsgo --b project2/src --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/src/tsconfig.json + * project2/src/tsconfig.json + +[HH:MM:SS AM] Project 'project1/src/tsconfig.json' is out of date because buildinfo file 'project1/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project1/src/tsconfig.json'... + +[HH:MM:SS AM] Project 'project2/src/tsconfig.json' is out of date because buildinfo file 'project2/src/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'project2/src/tsconfig.json'... + +//// [/home/src/workspaces/solution/project1/src/a.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/b.d.ts] *modified* +export declare const b = 10; +export declare const aaaaa = 10; +export declare const a2 = 10; + +//// [/home/src/workspaces/solution/project1/src/b.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a2 = exports.aaaaa = exports.b = void 0; +exports.b = 10; +const bLocal = 10; +const alocal = 10; +const aaaa = 10; +exports.aaaaa = 10; +exports.a2 = 10; + +//// [/home/src/workspaces/solution/project1/src/c.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/d.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project1/src/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":"c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;","signature":"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n","impliedNodeFormat":1},{"version":"5bfdbc5e13f033397af0ab302f42fdf2-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10;","signature":"c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 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":"./b.d.ts"} +//// [/home/src/workspaces/solution/project1/src/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": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7d25266cf9b041c81c1bb9d74e21155-export const a = 10;const aLocal = 10;const aa = 10;export const aaa = 10;", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "5bfdbc5e13f033397af0ab302f42fdf2-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10;", + "signature": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5bfdbc5e13f033397af0ab302f42fdf2-export const b = 10;const bLocal = 10;const alocal = 10;const aaaa = 10;export const aaaaa = 10;export const a2 = 10;", + "signature": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 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": "./b.d.ts", + "size": 1974 +} +//// [/home/src/workspaces/solution/project2/src/e.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/f.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/g.js] *rewrite with same content* +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2,4,6],"fileNames":["lib.d.ts","./e.ts","../../project1/src/a.d.ts","./f.ts","../../project1/src/b.d.ts","./g.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":"26403a4711355fb137eef9a25ce87785-export const e = 10;","signature":"f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n","impliedNodeFormat":1},"5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n",{"version":"e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;","signature":"17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n","impliedNodeFormat":1},"c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n",{"version":"06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;","signature":"4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[5]],"options":{"composite":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./g.d.ts"} +//// [/home/src/workspaces/solution/project2/src/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./e.ts" + ], + "original": 2 + }, + { + "files": [ + "./f.ts" + ], + "original": 4 + }, + { + "files": [ + "./g.ts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.d.ts", + "./e.ts", + "../../project1/src/a.d.ts", + "./f.ts", + "../../project1/src/b.d.ts", + "./g.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": "./e.ts", + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "26403a4711355fb137eef9a25ce87785-export const e = 10;", + "signature": "f994d14efb4fce4ea854d5cfd729fc0d-export declare const e = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/a.d.ts", + "version": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "signature": "5e35917ffa37324af3ace0b179493b37-export declare const a = 10;\nexport declare const aaa = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./f.ts", + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7c04a1af5b0f6d8541b63ff23aca1e3-import { a } from \"../../project1/src/a\"; export const f = a;", + "signature": "17442bcc150c3a3dd19c25d5affcc9fa-export declare const f = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../project1/src/b.d.ts", + "version": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n", + "signature": "c354a25014e4712419cbd9266c28e943-export declare const b = 10;\nexport declare const aaaaa = 10;\nexport declare const a2 = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./g.ts", + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06b9b3562579ebca65e399849c2a6a3a-import { b } from \"../../project1/src/b\"; export const g = b;", + "signature": "4b3f5082fb1783241d51fa14c76e770a-export declare const g = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../project1/src/a.d.ts" + ], + [ + "../../project1/src/b.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./f.ts": [ + "../../project1/src/a.d.ts" + ], + "./g.ts": [ + "../../project1/src/b.d.ts" + ] + }, + "latestChangedDtsFile": "./g.d.ts", + "size": 1870 +} + +project1/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.ts +*refresh* /home/src/workspaces/solution/project1/src/d.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project1/src/b.ts +(computed .d.ts) /home/src/workspaces/solution/project1/src/d.ts + +project2/src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project1/src/b.d.ts +*refresh* /home/src/workspaces/solution/project2/src/g.ts +Signatures:: +(used version) /home/src/workspaces/solution/project1/src/b.d.ts +(computed .d.ts) /home/src/workspaces/solution/project2/src/g.ts diff --git a/testdata/baselines/reference/tsbuild/commandLine/help.js b/testdata/baselines/reference/tsbuild/commandLine/help.js new file mode 100644 index 0000000000..8c6e197bcd --- /dev/null +++ b/testdata/baselines/reference/tsbuild/commandLine/help.js @@ -0,0 +1,144 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: + +tsgo --build --help +ExitStatus:: Success +Output:: +Version FakeTSVersion +tsc: The TypeScript Compiler - Version FakeTSVersion + +BUILD OPTIONS + +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 https://aka.ms/tsc-composite-builds + +--help, -h +Print this message. + +--help, -? + + +--watch, -w +Watch input files. + +--preserveWatchOutput +Disable wiping the console in watch mode. +type: boolean +default: false + +--listFiles +Print all of the files read during the compilation. +type: boolean +default: false + +--explainFiles +Print files read during the compilation including why it was included. +type: boolean +default: false + +--listEmittedFiles +Print the names of emitted files after a compilation. +type: boolean +default: false + +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--traceResolution +Log paths used during the 'moduleResolution' process. +type: boolean +default: false + +--diagnostics +Output compiler performance information after building. +type: boolean +default: false + +--extendedDiagnostics +Output more detailed compiler performance information after building. +type: boolean +default: false + +--generateCpuProfile +Emit a v8 CPU profile of the compiler run for debugging. +type: string +default: profile.cpuprofile + +--generateTrace +Generates an event trace and a list of types. + +--incremental, -i +Save .tsbuildinfo files to allow for incremental compilation of projects. +type: boolean +default: `false`, unless `composite` is set + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--inlineSourceMap +Include sourcemap files inside the emitted JavaScript. +type: boolean +default: false + +--noCheck +Disable full type checking (only critical parse and emit errors will be reported). +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + +--assumeChangesOnlyAffectDirectDependencies +Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it. +type: boolean +default: false + +--locale +Set the language of the messaging from TypeScript. This does not affect emit. + +--quiet, -q +Do not print diagnostics. + +--singleThreaded +Run in single threaded mode. + +--pprofDir +Generate pprof CPU/memory profiles to the given directory. + +--verbose, -v +Enable verbose logging. + +--dry, -d +Show what would be built (or deleted, if specified with '--clean') + +--force, -f +Build all projects, including those that appear to be up to date. + +--clean +Delete the outputs of all projects. + +--stopBuildOnErrors +Skip building downstream projects on error in upstream project. + + diff --git a/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js b/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js new file mode 100644 index 0000000000..c194821e7e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js @@ -0,0 +1,12 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: + +tsgo --b bogus.json +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +error TS6053: File '/home/src/workspaces/project/bogus.json' not found. + +Found 1 error. + + diff --git a/testdata/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js b/testdata/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js new file mode 100644 index 0000000000..23310d06e4 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js @@ -0,0 +1,400 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export function foo() { } +//// [/home/src/workspaces/project/b.ts] *new* +export function bar() { } +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "files": [ + "a.ts" + "b.ts" + ] +} + +tsgo --b +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +tsconfig.json:7:9 - error TS1005: ',' expected. + +7 "b.ts" +   ~~~~~~ + + +Found 1 error in tsconfig.json:7 + +//// [/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 function foo(): void; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +function foo() { } + +//// [/home/src/workspaces/project/b.d.ts] *new* +export declare function bar(): void; + +//// [/home/src/workspaces/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bar = bar; +function bar() { } + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"b8af959ef8294c415b0415508643e446-export function foo() { }","signature":"7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n","impliedNodeFormat":1},{"version":"492f7ec5be310332dc7e2ef503772d24-export function bar() { }","signature":"2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n","impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "b8af959ef8294c415b0415508643e446-export function foo() { }", + "signature": "7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "b8af959ef8294c415b0415508643e446-export function foo() { }", + "signature": "7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }", + "signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }", + "signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "latestChangedDtsFile": "./b.d.ts", + "size": 1345 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: reports syntax errors after change to config file +//// [/home/src/workspaces/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "composite": true, "declaration": true + }, + "files": [ + "a.ts" + "b.ts" + ] +} + +tsgo --b +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +tsconfig.json:7:9 - error TS1005: ',' expected. + +7 "b.ts" +   ~~~~~~ + + +Found 1 error in tsconfig.json:7 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [1]:: reports syntax errors after change to ts file +//// [/home/src/workspaces/project/a.ts] *modified* +export function foo() { }export function fooBar() { } + +tsgo --b +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +tsconfig.json:7:9 - error TS1005: ',' expected. + +7 "b.ts" +   ~~~~~~ + + +Found 1 error in tsconfig.json:7 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare function foo(): void; +export declare function fooBar(): void; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.foo = foo; +exports.fooBar = fooBar; +function foo() { } +function fooBar() { } + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }","signature":"f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n","impliedNodeFormat":1},{"version":"492f7ec5be310332dc7e2ef503772d24-export function bar() { }","signature":"2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true},"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }", + "signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }", + "signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }", + "signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }", + "signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "latestChangedDtsFile": "./a.d.ts", + "size": 1433 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [2]:: no change + +tsgo --b +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +tsconfig.json:7:9 - error TS1005: ',' expected. + +7 "b.ts" +   ~~~~~~ + + +Found 1 error in tsconfig.json:7 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [3]:: builds after fixing config file errors +//// [/home/src/workspaces/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "composite": true, "declaration": true + }, + "files": [ + "a.ts", + "b.ts" + ] +} + +tsgo --b +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }","signature":"f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n","impliedNodeFormat":1},{"version":"492f7ec5be310332dc7e2ef503772d24-export function bar() { }","signature":"2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true},"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }", + "signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12981c250647eb82bb45c5fb79732976-export function foo() { }export function fooBar() { }", + "signature": "f3ff291f5185ac75eeeb6de19fc28a01-export declare function foo(): void;\nexport declare function fooBar(): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }", + "signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "492f7ec5be310332dc7e2ef503772d24-export function bar() { }", + "signature": "2f1e9992435d5724d3e1da8bdbc17eae-export declare function bar(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1382 +} + +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 +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js b/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js new file mode 100644 index 0000000000..04120bd116 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js @@ -0,0 +1,70 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/tsconfig.first.json] *new* +{ + "extends": "./foobar.json", + "compilerOptions": { + "composite": true + } +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./tsconfig.first.json" }, + { "path": "./tsconfig.second.json" } + ] +} +//// [/home/src/workspaces/project/tsconfig.second.json] *new* +{ + "extends": "./foobar.json", + "compilerOptions": { + "composite": true + } +} + +tsgo --b +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +error TS5083: Cannot read file '/home/src/workspaces/project/foobar.json'. +error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.first.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. +error TS5083: Cannot read file '/home/src/workspaces/project/foobar.json'. +error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.second.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + +Found 4 errors. + +//// [/home/src/workspaces/project/tsconfig.first.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"fileInfos":[],"options":{"composite":true}} +//// [/home/src/workspaces/project/tsconfig.first.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "fileInfos": [], + "options": { + "composite": true + }, + "size": 85 +} +//// [/home/src/workspaces/project/tsconfig.second.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"fileInfos":[],"options":{"composite":true}} +//// [/home/src/workspaces/project/tsconfig.second.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "fileInfos": [], + "options": { + "composite": true + }, + "size": 85 +} + +tsconfig.first.json:: +SemanticDiagnostics:: +Signatures:: + +tsconfig.second.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors-with-incremental.js new file mode 100644 index 0000000000..2af5eb59ab --- /dev/null +++ b/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors-with-incremental.js @@ -0,0 +1,227 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/index.ts] *new* +import ky from 'ky'; +export const api = ky.extend({}); +//// [/home/src/workspaces/project/node_modules/ky/distribution/index.d.ts] *new* +type KyInstance = { + extend(options: Record): KyInstance; +} +declare const ky: KyInstance; +export default ky; +//// [/home/src/workspaces/project/node_modules/ky/package.json] *new* +{ + "name": "ky", + "type": "module", + "main": "./distribution/index.js" +} +//// [/home/src/workspaces/project/package.json] *new* +{ + "type": "module" +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "composite": false, + "incremental": true, + "declaration": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo -b --explainFiles --listEmittedFiles --v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/index.js +TSFILE: /home/src/workspaces/project/index.d.ts +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.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/index.d.ts] *new* +export declare const api: { + extend(options: Record): KyInstance; +}; + +//// [/home/src/workspaces/project/index.js] *new* +import ky from 'ky'; +export const api = ky.extend({}); + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","./node_modules/ky/distribution/index.d.ts","./index.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":"b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;","impliedNodeFormat":99},{"version":"0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});","signature":"5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":false,"declaration":true,"module":199,"skipLibCheck":true,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":34,"end":37,"code":4023,"category":1,"message":"Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.esnext.full.d.ts", + "./node_modules/ky/distribution/index.d.ts", + "./index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.full.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": "./node_modules/ky/distribution/index.d.ts", + "version": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;", + "signature": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./index.ts", + "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", + "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "impliedNodeFormat": "ESNext", + "original": { + "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", + "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./node_modules/ky/distribution/index.d.ts" + ] + ], + "options": { + "composite": false, + "declaration": true, + "module": 199, + "skipLibCheck": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "./index.ts": [ + "./node_modules/ky/distribution/index.d.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 34, + "end": 37, + "code": 4023, + "category": 1, + "message": "Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named." + } + ] + ] + ], + "size": 1983 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/node_modules/ky/distribution/index.d.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [0]:: no change + +tsgo -b --explainFiles --listEmittedFiles --v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors.js b/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors.js new file mode 100644 index 0000000000..f166f7e552 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/declarationEmit/reports-dts-generation-errors.js @@ -0,0 +1,165 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/index.ts] *new* +import ky from 'ky'; +export const api = ky.extend({}); +//// [/home/src/workspaces/project/node_modules/ky/distribution/index.d.ts] *new* +type KyInstance = { + extend(options: Record): KyInstance; +} +declare const ky: KyInstance; +export default ky; +//// [/home/src/workspaces/project/node_modules/ky/package.json] *new* +{ + "name": "ky", + "type": "module", + "main": "./distribution/index.js" +} +//// [/home/src/workspaces/project/package.json] *new* +{ + "type": "module" +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "composite": false, + "incremental": false, + "declaration": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo -b --explainFiles --listEmittedFiles --v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/index.js +TSFILE: /home/src/workspaces/project/index.d.ts +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.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/index.d.ts] *new* +export declare const api: { + extend(options: Record): KyInstance; +}; + +//// [/home/src/workspaces/project/index.js] *new* +import ky from 'ky'; +export const api = ky.extend({}); + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["./index.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./index.ts" + ], + "original": "./index.ts" + } + ], + "size": 63 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/node_modules/ky/distribution/index.d.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [0]:: no change + +tsgo -b --explainFiles --listEmittedFiles --v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/index.js +TSFILE: /home/src/workspaces/project/index.d.ts +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/workspaces/project/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/index.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/node_modules/ky/distribution/index.d.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/index.ts diff --git a/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js b/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js new file mode 100644 index 0000000000..2d0353fd02 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js @@ -0,0 +1,257 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/common/nominal.ts] *new* +/// +export declare type Nominal = MyNominal; +//// [/home/src/workspaces/solution/src/common/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { "composite": true }, + "include": ["./nominal.ts"], +} +//// [/home/src/workspaces/solution/src/common/types.d.ts] *new* +declare type MyNominal = T & { + specialKey: Name; +}; +//// [/home/src/workspaces/solution/src/subProject/index.ts] *new* +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; +//// [/home/src/workspaces/solution/src/subProject/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { "composite": true }, + "references": [{ "path": "../common" }], + "include": ["./index.ts"], +} +//// [/home/src/workspaces/solution/src/subProject2/index.ts] *new* +import { MyNominal } from '../subProject/index'; +const variable = { + key: 'value' as MyNominal, +}; +export function getVar(): keyof typeof variable { + return 'key'; +} +//// [/home/src/workspaces/solution/src/subProject2/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { "composite": true }, + "references": [{ "path": "../subProject" }], + "include": ["./index.ts"], +} +//// [/home/src/workspaces/solution/src/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [{ "path": "./subProject" }, { "path": "./subProject2" }], + "include": [], +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "rootDir": "./", + "outDir": "lib", + }, +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { "composite": true }, + "include": ["./src/**/*.ts"], +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'lib/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/solution/lib/src/common/nominal.d.ts] *new* +/// +export declare type Nominal = MyNominal; + +//// [/home/src/workspaces/solution/lib/src/common/nominal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// + +//// [/home/src/workspaces/solution/lib/src/subProject/index.d.ts] *new* +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; + +//// [/home/src/workspaces/solution/lib/src/subProject/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/solution/lib/src/subProject2/index.d.ts] *new* +import { MyNominal } from '../subProject/index'; +declare const variable: { + key: MyNominal; +}; +export declare function getVar(): keyof typeof variable; +export {}; + +//// [/home/src/workspaces/solution/lib/src/subProject2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getVar = getVar; +const variable = { + key: 'value', +}; +function getVar() { + return 'key'; +} + +//// [/home/src/workspaces/solution/lib/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","../src/common/types.d.ts","../src/common/nominal.ts","../src/subProject/index.ts","../src/subProject2/index.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":"364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02b2be40ad0c54e8b7965b3b3a70cf4d-/// \nexport declare type Nominal = MyNominal;","signature":"87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n","impliedNodeFormat":1},{"version":"f3259c501eab7f535f47f925d1b0ad90-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;","signature":"ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n","impliedNodeFormat":1},{"version":"8da8251ddcb1a6ba7d3777c22bdb0c2f-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}","signature":"94380a791d16e2a4caa75d34b4c1d230-import { MyNominal } from '../subProject/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3],[4]],"options":{"composite":true,"outDir":"./","rootDir":".."},"referencedMap":[[3,1],[4,2],[5,3]],"latestChangedDtsFile":"./src/subProject2/index.d.ts"} +//// [/home/src/workspaces/solution/lib/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/common/types.d.ts", + "../src/common/nominal.ts", + "../src/subProject/index.ts", + "../src/subProject2/index.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/common/types.d.ts", + "../src/common/nominal.ts", + "../src/subProject/index.ts", + "../src/subProject2/index.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": "../src/common/types.d.ts", + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/common/nominal.ts", + "version": "02b2be40ad0c54e8b7965b3b3a70cf4d-/// \nexport declare type Nominal = MyNominal;", + "signature": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02b2be40ad0c54e8b7965b3b3a70cf4d-/// \nexport declare type Nominal = MyNominal;", + "signature": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/subProject/index.ts", + "version": "f3259c501eab7f535f47f925d1b0ad90-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f3259c501eab7f535f47f925d1b0ad90-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/subProject2/index.ts", + "version": "8da8251ddcb1a6ba7d3777c22bdb0c2f-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "94380a791d16e2a4caa75d34b4c1d230-import { MyNominal } from '../subProject/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8da8251ddcb1a6ba7d3777c22bdb0c2f-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "94380a791d16e2a4caa75d34b4c1d230-import { MyNominal } from '../subProject/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/common/types.d.ts" + ], + [ + "../src/common/nominal.ts" + ], + [ + "../src/subProject/index.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./", + "rootDir": ".." + }, + "referencedMap": { + "../src/common/nominal.ts": [ + "../src/common/types.d.ts" + ], + "../src/subProject/index.ts": [ + "../src/common/nominal.ts" + ], + "../src/subProject2/index.ts": [ + "../src/subProject/index.ts" + ] + }, + "latestChangedDtsFile": "./src/subProject2/index.d.ts", + "size": 2504 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/common/types.d.ts +*refresh* /home/src/workspaces/solution/src/common/nominal.ts +*refresh* /home/src/workspaces/solution/src/subProject/index.ts +*refresh* /home/src/workspaces/solution/src/subProject2/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/common/nominal.ts +(stored at emit) /home/src/workspaces/solution/src/subProject/index.ts +(stored at emit) /home/src/workspaces/solution/src/subProject2/index.ts diff --git a/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js b/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js new file mode 100644 index 0000000000..3f45be7275 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js @@ -0,0 +1,427 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/common/nominal.ts] *new* +/// +export declare type Nominal = MyNominal; +//// [/home/src/workspaces/solution/src/common/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { "composite": true }, + "include": ["./nominal.ts"], +} +//// [/home/src/workspaces/solution/src/common/types.d.ts] *new* +declare type MyNominal = T & { + specialKey: Name; +}; +//// [/home/src/workspaces/solution/src/subProject/index.ts] *new* +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; +//// [/home/src/workspaces/solution/src/subProject/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { "composite": true }, + "references": [{ "path": "../common" }], + "include": ["./index.ts"], +} +//// [/home/src/workspaces/solution/src/subProject2/index.ts] *new* +import { MyNominal } from '../subProject/index'; +const variable = { + key: 'value' as MyNominal, +}; +export function getVar(): keyof typeof variable { + return 'key'; +} +//// [/home/src/workspaces/solution/src/subProject2/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { "composite": true }, + "references": [{ "path": "../subProject" }], + "include": ["./index.ts"], +} +//// [/home/src/workspaces/solution/src/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [{ "path": "./subProject" }, { "path": "./subProject2" }], + "include": [], +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "rootDir": "./", + "outDir": "lib", + }, +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [{ "path": "./src" }], + "include": [], +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src/common/tsconfig.json + * src/subProject/tsconfig.json + * src/subProject2/tsconfig.json + * src/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'src/common/tsconfig.json' is out of date because output file 'lib/src/common/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/common/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/subProject/tsconfig.json' is out of date because output file 'lib/src/subProject/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/subProject/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/subProject2/tsconfig.json' is out of date because output file 'lib/src/subProject2/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/subProject2/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/lib/src/common/nominal.d.ts] *new* +/// +export declare type Nominal = MyNominal; + +//// [/home/src/workspaces/solution/lib/src/common/nominal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// + +//// [/home/src/workspaces/solution/lib/src/common/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../../../src/common/types.d.ts","../../../src/common/nominal.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":"364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02b2be40ad0c54e8b7965b3b3a70cf4d-/// \nexport declare type Nominal = MyNominal;","signature":"87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"referencedMap":[[3,1]],"latestChangedDtsFile":"./nominal.d.ts"} +//// [/home/src/workspaces/solution/lib/src/common/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../src/common/nominal.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../../../src/common/types.d.ts", + "../../../src/common/nominal.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": "../../../src/common/types.d.ts", + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../../src/common/nominal.ts", + "version": "02b2be40ad0c54e8b7965b3b3a70cf4d-/// \nexport declare type Nominal = MyNominal;", + "signature": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02b2be40ad0c54e8b7965b3b3a70cf4d-/// \nexport declare type Nominal = MyNominal;", + "signature": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../../src/common/types.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "../..", + "rootDir": "../../.." + }, + "referencedMap": { + "../../../src/common/nominal.ts": [ + "../../../src/common/types.d.ts" + ] + }, + "latestChangedDtsFile": "./nominal.d.ts", + "size": 1643 +} +//// [/home/src/workspaces/solution/lib/src/subProject/index.d.ts] *new* +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; + +//// [/home/src/workspaces/solution/lib/src/subProject/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/solution/lib/src/subProject/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../../../src/common/types.d.ts","../common/nominal.d.ts","../../../src/subProject/index.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":"364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true,"impliedNodeFormat":1},"87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n",{"version":"f3259c501eab7f535f47f925d1b0ad90-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;","signature":"ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"referencedMap":[[3,1],[4,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/lib/src/subProject/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../src/subProject/index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../../../src/common/types.d.ts", + "../common/nominal.d.ts", + "../../../src/subProject/index.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": "../../../src/common/types.d.ts", + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../common/nominal.d.ts", + "version": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "signature": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../src/subProject/index.ts", + "version": "f3259c501eab7f535f47f925d1b0ad90-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f3259c501eab7f535f47f925d1b0ad90-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../../src/common/types.d.ts" + ], + [ + "../common/nominal.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "../..", + "rootDir": "../../.." + }, + "referencedMap": { + "../common/nominal.d.ts": [ + "../../../src/common/types.d.ts" + ], + "../../../src/subProject/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1782 +} +//// [/home/src/workspaces/solution/lib/src/subProject2/index.d.ts] *new* +import { MyNominal } from '../subProject/index'; +declare const variable: { + key: MyNominal; +}; +export declare function getVar(): keyof typeof variable; +export {}; + +//// [/home/src/workspaces/solution/lib/src/subProject2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getVar = getVar; +const variable = { + key: 'value', +}; +function getVar() { + return 'key'; +} + +//// [/home/src/workspaces/solution/lib/src/subProject2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../../../src/common/types.d.ts","../common/nominal.d.ts","../subProject/index.d.ts","../../../src/subProject2/index.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":"364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true,"impliedNodeFormat":1},"87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n","ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n",{"version":"8da8251ddcb1a6ba7d3777c22bdb0c2f-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}","signature":"94380a791d16e2a4caa75d34b4c1d230-import { MyNominal } from '../subProject/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3],[4]],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"referencedMap":[[3,1],[4,2],[5,3]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/lib/src/subProject2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../src/subProject2/index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../../../src/common/types.d.ts", + "../common/nominal.d.ts", + "../subProject/index.d.ts", + "../../../src/subProject2/index.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": "../../../src/common/types.d.ts", + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "signature": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "364cbcda81a2b382e1f50a8c4ab62993-declare type MyNominal = T & {\n specialKey: Name;\n};", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../common/nominal.d.ts", + "version": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "signature": "87033119a9b5a8355ed894292b93ddfc-/// \nexport declare type Nominal = MyNominal;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../subProject/index.d.ts", + "version": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../src/subProject2/index.ts", + "version": "8da8251ddcb1a6ba7d3777c22bdb0c2f-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "94380a791d16e2a4caa75d34b4c1d230-import { MyNominal } from '../subProject/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8da8251ddcb1a6ba7d3777c22bdb0c2f-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "94380a791d16e2a4caa75d34b4c1d230-import { MyNominal } from '../subProject/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../../src/common/types.d.ts" + ], + [ + "../common/nominal.d.ts" + ], + [ + "../subProject/index.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "../..", + "rootDir": "../../.." + }, + "referencedMap": { + "../common/nominal.d.ts": [ + "../../../src/common/types.d.ts" + ], + "../subProject/index.d.ts": [ + "../common/nominal.d.ts" + ], + "../../../src/subProject2/index.ts": [ + "../subProject/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2106 +} + +src/common/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/common/types.d.ts +*refresh* /home/src/workspaces/solution/src/common/nominal.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/common/nominal.ts + +src/subProject/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/common/types.d.ts +*refresh* /home/src/workspaces/solution/lib/src/common/nominal.d.ts +*refresh* /home/src/workspaces/solution/src/subProject/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/subProject/index.ts + +src/subProject2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/common/types.d.ts +*refresh* /home/src/workspaces/solution/lib/src/common/nominal.d.ts +*refresh* /home/src/workspaces/solution/lib/src/subProject/index.d.ts +*refresh* /home/src/workspaces/solution/src/subProject2/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/subProject2/index.ts diff --git a/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js b/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js new file mode 100644 index 0000000000..739155b881 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js @@ -0,0 +1,229 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/packages/pkg1/src/index.ts] *new* +export interface IThing { + a: string; +} +export interface IThings { + thing1: IThing; +} +//// [/home/src/workspaces/project/packages/pkg1/tsconfig.json] *new* +{ + "extends": "../../tsconfig", + "compilerOptions": { "outDir": "lib" }, + "include": ["src"], +} +//// [/home/src/workspaces/project/packages/pkg2/src/index.ts] *new* +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] *new* +{ + "extends": "../../tsconfig", + "compilerOptions": { "outDir": "lib" }, + "include": ["src"], + "references": [{ "path": "../pkg1" }], +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "paths": { "@fluentui/*": ["./packages/*/src"] }, + }, +} + +tsgo --b packages/pkg2/tsconfig.json --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * packages/pkg1/tsconfig.json + * packages/pkg2/tsconfig.json + +[HH:MM:SS AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/lib/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg1/tsconfig.json'... + +[HH:MM:SS AM] Project 'packages/pkg2/tsconfig.json' is out of date because output file 'packages/pkg2/lib/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg2/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/packages/pkg1/lib/src/index.d.ts] *new* +export interface IThing { + a: string; +} +export interface IThings { + thing1: IThing; +} + +//// [/home/src/workspaces/project/packages/pkg1/lib/src/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/packages/pkg1/lib/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/index.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":"f611077efa7cfdd7e90bebd6aef8d21e-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}","signature":"a9c3ba42ffd025bdbe473878c71e06db-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/project/packages/pkg1/lib/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/index.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": "../src/index.ts", + "version": "f611077efa7cfdd7e90bebd6aef8d21e-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}", + "signature": "a9c3ba42ffd025bdbe473878c71e06db-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f611077efa7cfdd7e90bebd6aef8d21e-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}", + "signature": "a9c3ba42ffd025bdbe473878c71e06db-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1262 +} +//// [/home/src/workspaces/project/packages/pkg2/lib/src/index.d.ts] *new* +export declare function fn4(): import("@fluentui/pkg1/lib").IThing; + +//// [/home/src/workspaces/project/packages/pkg2/lib/src/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fn4 = fn4; +function fn4() { + const a = { thing1: { a: 'b' } }; + return a.thing1; +} + +//// [/home/src/workspaces/project/packages/pkg2/lib/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../../pkg1/lib/src/index.d.ts","../src/index.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},"a9c3ba42ffd025bdbe473878c71e06db-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}\n",{"version":"4d4febb98ed4514d6d06322111030719-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}","signature":"f536bf864c731ec3cb58961dede15c18-export declare function fn4(): import(\"@fluentui/pkg1/lib\").IThing;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/project/packages/pkg2/lib/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../../pkg1/lib/src/index.d.ts", + "../src/index.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": "../../pkg1/lib/src/index.d.ts", + "version": "a9c3ba42ffd025bdbe473878c71e06db-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}\n", + "signature": "a9c3ba42ffd025bdbe473878c71e06db-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/index.ts", + "version": "4d4febb98ed4514d6d06322111030719-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}", + "signature": "f536bf864c731ec3cb58961dede15c18-export declare function fn4(): import(\"@fluentui/pkg1/lib\").IThing;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4d4febb98ed4514d6d06322111030719-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}", + "signature": "f536bf864c731ec3cb58961dede15c18-export declare function fn4(): import(\"@fluentui/pkg1/lib\").IThing;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../pkg1/lib/src/index.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../src/index.ts": [ + "../../pkg1/lib/src/index.d.ts" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1488 +} + +packages/pkg1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/packages/pkg1/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/packages/pkg1/src/index.ts + +packages/pkg2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/packages/pkg1/lib/src/index.d.ts +*refresh* /home/src/workspaces/project/packages/pkg2/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/packages/pkg2/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js b/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js new file mode 100644 index 0000000000..ea4b9dff00 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js @@ -0,0 +1,692 @@ +currentDirectory::/user/username/projects/demo +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/demo/animals/animal.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} +//// [/user/username/projects/demo/animals/dog.ts] *new* +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] *new* +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; +//// [/user/username/projects/demo/animals/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": "." + }, + "references": [ + { "path": "../core" } + ] +} +//// [/user/username/projects/demo/core/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + }, +} +//// [/user/username/projects/demo/core/utilities.ts] *new* +import * as A from '../animals' +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/tsconfig-base.json] *new* +{ + "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] *new* +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals", + }, + { + "path": "./zoo", + }, + ], +} +//// [/user/username/projects/demo/zoo/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} +//// [/user/username/projects/demo/zoo/zoo.ts] *new* +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * animals/tsconfig.json + * zoo/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +animals/index.ts:1:20 - error TS6307: File '/user/username/projects/demo/animals/animal.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern. + +1 import Animal from './animal'; +   ~~~~~~~~~~ + +animals/index.ts:4:32 - error TS6307: File '/user/username/projects/demo/animals/dog.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern. + +4 import { createDog, Dog } from './dog'; +   ~~~~~~~ + +core/utilities.ts:1:20 - error TS6307: File '/user/username/projects/demo/animals/index.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern. + The file is in the program because: + Imported via '../animals' from file '/user/username/projects/demo/core/utilities.ts' + Imported via '.' from file '/user/username/projects/demo/animals/dog.ts' + +1 import * as A from '../animals' +   ~~~~~~~~~~~~ + + animals/dog.ts:1:20 - File is included via import here. + 1 import Animal from '.'; +    ~~~ + +[HH:MM:SS AM] Project 'animals/tsconfig.json' is out of date because output file 'lib/animals/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'animals/tsconfig.json'... + +[HH:MM:SS AM] Project 'zoo/tsconfig.json' is out of date because output file 'lib/zoo/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'zoo/tsconfig.json'... + + +Found 3 errors in 2 files. + +Errors Files + 2 animals/index.ts:1 + 1 core/utilities.ts:1 + +//// [/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; }; +//// [/user/username/projects/demo/animals/animal.d.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + +//// [/user/username/projects/demo/animals/animal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/demo/animals/dog.d.ts] *new* +import Animal from '.'; +export interface Dog extends Animal { + woof(): void; + name: string; +} +export declare function createDog(): Dog; + +//// [/user/username/projects/demo/animals/dog.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = createDog; +const utilities_1 = require("../core/utilities"); +function createDog() { + return ({ + size: "medium", + woof: function () { + console.log(`${this.name} says "Woof"!`); + }, + name: (0, utilities_1.makeRandomName)() + }); +} + +//// [/user/username/projects/demo/animals/index.d.ts] *new* +import Animal from './animal'; +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + +//// [/user/username/projects/demo/animals/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = void 0; +const dog_1 = require("./dog"); +Object.defineProperty(exports, "createDog", { enumerable: true, get: function () { return dog_1.createDog; } }); + +//// [/user/username/projects/demo/lib/animals/animal.d.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + +//// [/user/username/projects/demo/lib/animals/animal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/demo/lib/animals/dog.d.ts] *new* +import Animal from '.'; +export interface Dog extends Animal { + woof(): void; + name: string; +} +export declare function createDog(): Dog; + +//// [/user/username/projects/demo/lib/animals/dog.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = createDog; +const utilities_1 = require("../core/utilities"); +function createDog() { + return ({ + size: "medium", + woof: function () { + console.log(`${this.name} says "Woof"!`); + }, + name: (0, utilities_1.makeRandomName)() + }); +} + +//// [/user/username/projects/demo/lib/animals/index.d.ts] *new* +import Animal from './animal'; +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + +//// [/user/username/projects/demo/lib/animals/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = void 0; +const dog_1 = require("./dog"); +Object.defineProperty(exports, "createDog", { enumerable: true, get: function () { return dog_1.createDog; } }); + +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3],5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.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":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n",{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1}],"fileIdsList":[[3,4],[2,5]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"referencedMap":[[5,1],[3,2]],"latestChangedDtsFile":"./dog.d.ts"} +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../animals/animal.ts", + "../../animals/index.ts" + ], + "original": [ + 2, + 3 + ] + }, + { + "files": [ + "../../animals/dog.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../../animals/animal.ts", + "../../animals/index.ts", + "../core/utilities.d.ts", + "../../animals/dog.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": "../../animals/animal.ts", + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../animals/index.ts", + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../core/utilities.d.ts", + "version": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../animals/dog.ts", + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../animals", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "latestChangedDtsFile": "./dog.d.ts", + "size": 2794 +} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/dog.ts","../../animals/index.ts","../../core/utilities.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":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},{"version":"c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"fileIdsList":[[4,5],[2,3],[4]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[1,2,3,4,5],"latestChangedDtsFile":"./utilities.d.ts"} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../../core/utilities.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../../animals/animal.ts", + "../../animals/dog.ts", + "../../animals/index.ts", + "../../core/utilities.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": "../../animals/animal.ts", + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../animals/dog.ts", + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../animals/index.ts", + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../core/utilities.ts", + "version": "c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c71a99e072793c29cda49dd3fea04661-import * as A from '../animals'\nexport function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../animals/index.ts", + "../../core/utilities.ts" + ], + [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ], + [ + "../../animals/index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../core", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../../core/utilities.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ], + "../../core/utilities.ts": [ + "../../animals/index.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../../animals/animal.ts", + "../../animals/dog.ts", + "../../animals/index.ts", + "../../core/utilities.ts" + ], + "latestChangedDtsFile": "./utilities.d.ts", + "size": 3178 +} +//// [/user/username/projects/demo/lib/core/utilities.d.ts] *new* +export declare function makeRandomName(): string; +export declare function lastElementOf(arr: T[]): T | undefined; + +//// [/user/username/projects/demo/lib/core/utilities.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeRandomName = makeRandomName; +exports.lastElementOf = lastElementOf; +function makeRandomName() { + return "Bob!?! "; +} +function lastElementOf(arr) { + if (arr.length === 0) + return undefined; + return arr[arr.length - 1]; +} + +//// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../animals/animal.d.ts","../animals/dog.d.ts","../animals/index.d.ts","../../zoo/zoo.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},"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n",{"version":"90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}","signature":"f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n","impliedNodeFormat":1}],"fileIdsList":[[4],[2,3]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../zoo","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,1]],"latestChangedDtsFile":"./zoo.d.ts"} +//// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../zoo/zoo.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../animals/animal.d.ts", + "../animals/dog.d.ts", + "../animals/index.d.ts", + "../../zoo/zoo.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": "../animals/animal.d.ts", + "version": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../animals/dog.d.ts", + "version": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../animals/index.d.ts", + "version": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../zoo/zoo.ts", + "version": "90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}", + "signature": "f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}", + "signature": "f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../animals/index.d.ts" + ], + [ + "../animals/animal.d.ts", + "../animals/dog.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../zoo", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../animals/dog.d.ts": [ + "../animals/index.d.ts" + ], + "../animals/index.d.ts": [ + "../animals/animal.d.ts", + "../animals/dog.d.ts" + ], + "../../zoo/zoo.ts": [ + "../animals/index.d.ts" + ] + }, + "latestChangedDtsFile": "./zoo.d.ts", + "size": 2104 +} +//// [/user/username/projects/demo/lib/zoo/zoo.d.ts] *new* +import { Dog } from '../animals/index'; +export declare function createZoo(): Array; + +//// [/user/username/projects/demo/lib/zoo/zoo.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createZoo = createZoo; +const index_1 = require("../animals/index"); +function createZoo() { + return [ + (0, index_1.createDog)() + ]; +} + + +core/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/demo/animals/animal.ts +*not cached* /user/username/projects/demo/animals/dog.ts +*not cached* /user/username/projects/demo/animals/index.ts +*not cached* /user/username/projects/demo/core/utilities.ts +Signatures:: +(stored at emit) /user/username/projects/demo/animals/animal.ts +(stored at emit) /user/username/projects/demo/animals/dog.ts +(stored at emit) /user/username/projects/demo/animals/index.ts +(stored at emit) /user/username/projects/demo/core/utilities.ts + +animals/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/animals/animal.ts +*refresh* /user/username/projects/demo/animals/index.ts +*refresh* /user/username/projects/demo/lib/core/utilities.d.ts +*refresh* /user/username/projects/demo/animals/dog.ts +Signatures:: +(stored at emit) /user/username/projects/demo/animals/animal.ts +(stored at emit) /user/username/projects/demo/animals/index.ts +(stored at emit) /user/username/projects/demo/animals/dog.ts + +zoo/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/lib/animals/animal.d.ts +*refresh* /user/username/projects/demo/lib/animals/dog.d.ts +*refresh* /user/username/projects/demo/lib/animals/index.d.ts +*refresh* /user/username/projects/demo/zoo/zoo.ts +Signatures:: +(stored at emit) /user/username/projects/demo/zoo/zoo.ts diff --git a/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js b/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js new file mode 100644 index 0000000000..6753102212 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js @@ -0,0 +1,133 @@ +currentDirectory::/user/username/projects/demo +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/demo/animals/animal.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} +//// [/user/username/projects/demo/animals/dog.ts] *new* +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] *new* +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; +//// [/user/username/projects/demo/animals/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": "." + }, + "references": [ + { "path": "../core" } + ] +} +//// [/user/username/projects/demo/core/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + }, + "references": [ + { + "path": "../zoo", + } + ] +} +//// [/user/username/projects/demo/core/utilities.ts] *new* +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/tsconfig-base.json] *new* +{ + "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] *new* +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals", + }, + { + "path": "./zoo", + }, + ], +} +//// [/user/username/projects/demo/zoo/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} +//// [/user/username/projects/demo/zoo/zoo.ts] *new* +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + +tsgo --b --verbose +ExitStatus:: ProjectReferenceCycle_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * animals/tsconfig.json + * zoo/tsconfig.json + * core/tsconfig.json + * tsconfig.json + +error TS6202: Project references may not form a circular graph. Cycle detected: /user/username/projects/demo/tsconfig.json +/user/username/projects/demo/core/tsconfig.json +/user/username/projects/demo/zoo/tsconfig.json +/user/username/projects/demo/animals/tsconfig.json + +Found 1 error. + + diff --git a/testdata/baselines/reference/tsbuild/demo/in-circular-is-set-in-the-reference.js b/testdata/baselines/reference/tsbuild/demo/in-circular-is-set-in-the-reference.js new file mode 100644 index 0000000000..21246b8f74 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/demo/in-circular-is-set-in-the-reference.js @@ -0,0 +1,735 @@ +currentDirectory::/user/username/projects/demo +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/demo/a/index.ts] *new* +export const a = 10; +//// [/user/username/projects/demo/a/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/a", + "rootDir": "." + }, + "references": [ + { + "path": "../b", + "circular": true + } + ] +} +//// [/user/username/projects/demo/animals/animal.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} +//// [/user/username/projects/demo/animals/dog.ts] *new* +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] *new* +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; +//// [/user/username/projects/demo/animals/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": "." + }, + "references": [ + { "path": "../core" } + ] +} +//// [/user/username/projects/demo/b/index.ts] *new* +export const b = 10; +//// [/user/username/projects/demo/b/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/b", + "rootDir": "." + }, + "references": [ + { + "path": "../a", + } + ] +} +//// [/user/username/projects/demo/core/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + }, +} +//// [/user/username/projects/demo/core/utilities.ts] *new* +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/tsconfig-base.json] *new* +{ + "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] *new* +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals", + }, + { + "path": "./zoo", + }, + { + "path": "./a", + }, + { + "path": "./b", + }, + ], +} +//// [/user/username/projects/demo/zoo/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} +//// [/user/username/projects/demo/zoo/zoo.ts] *new* +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * animals/tsconfig.json + * zoo/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'animals/tsconfig.json' is out of date because output file 'lib/animals/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'animals/tsconfig.json'... + +[HH:MM:SS AM] Project 'zoo/tsconfig.json' is out of date because output file 'lib/zoo/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'zoo/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output file 'lib/b/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output file 'lib/a/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'a/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; }; +//// [/user/username/projects/demo/lib/a/index.d.ts] *new* +export declare const a = 10; + +//// [/user/username/projects/demo/lib/a/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 10; + +//// [/user/username/projects/demo/lib/a/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../../a/index.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":"3a1e9965f8602302ee6ae53756eac8be-export const a = 10;","signature":"5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../a","strict":true,"target":1},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/demo/lib/a/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../a/index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../../a/index.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/index.ts", + "version": "3a1e9965f8602302ee6ae53756eac8be-export const a = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3a1e9965f8602302ee6ae53756eac8be-export const a = 10;", + "signature": "5d46ba05302682a2bc47daa29368141f-export declare const a = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../a", + "strict": true, + "target": 1 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1297 +} +//// [/user/username/projects/demo/lib/animals/animal.d.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + +//// [/user/username/projects/demo/lib/animals/animal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/demo/lib/animals/dog.d.ts] *new* +import Animal from '.'; +export interface Dog extends Animal { + woof(): void; + name: string; +} +export declare function createDog(): Dog; + +//// [/user/username/projects/demo/lib/animals/dog.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = createDog; +const utilities_1 = require("../core/utilities"); +function createDog() { + return ({ + size: "medium", + woof: function () { + console.log(`${this.name} says "Woof"!`); + }, + name: (0, utilities_1.makeRandomName)() + }); +} + +//// [/user/username/projects/demo/lib/animals/index.d.ts] *new* +import Animal from './animal'; +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + +//// [/user/username/projects/demo/lib/animals/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = void 0; +const dog_1 = require("./dog"); +Object.defineProperty(exports, "createDog", { enumerable: true, get: function () { return dog_1.createDog; } }); + +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3],5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.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":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n",{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1}],"fileIdsList":[[3,4],[2,5]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"referencedMap":[[5,1],[3,2]],"latestChangedDtsFile":"./dog.d.ts"} +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../animals/animal.ts", + "../../animals/index.ts" + ], + "original": [ + 2, + 3 + ] + }, + { + "files": [ + "../../animals/dog.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../../animals/animal.ts", + "../../animals/index.ts", + "../core/utilities.d.ts", + "../../animals/dog.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": "../../animals/animal.ts", + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../animals/index.ts", + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../core/utilities.d.ts", + "version": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../animals/dog.ts", + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../animals", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "latestChangedDtsFile": "./dog.d.ts", + "size": 2794 +} +//// [/user/username/projects/demo/lib/b/index.d.ts] *new* +export declare const b = 10; + +//// [/user/username/projects/demo/lib/b/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/user/username/projects/demo/lib/b/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../../b/index.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":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../b","strict":true,"target":1},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/demo/lib/b/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../b/index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../../b/index.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": "../../b/index.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../b", + "strict": true, + "target": 1 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1297 +} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../../core/utilities.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":"43144ca7c82db0f51f0d56a2b3e2f565-export function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"latestChangedDtsFile":"./utilities.d.ts"} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../core/utilities.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../../core/utilities.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": "../../core/utilities.ts", + "version": "43144ca7c82db0f51f0d56a2b3e2f565-export function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "43144ca7c82db0f51f0d56a2b3e2f565-export function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../core", + "strict": true, + "target": 1 + }, + "latestChangedDtsFile": "./utilities.d.ts", + "size": 1586 +} +//// [/user/username/projects/demo/lib/core/utilities.d.ts] *new* +export declare function makeRandomName(): string; +export declare function lastElementOf(arr: T[]): T | undefined; + +//// [/user/username/projects/demo/lib/core/utilities.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeRandomName = makeRandomName; +exports.lastElementOf = lastElementOf; +function makeRandomName() { + return "Bob!?! "; +} +function lastElementOf(arr) { + if (arr.length === 0) + return undefined; + return arr[arr.length - 1]; +} + +//// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../animals/animal.d.ts","../animals/dog.d.ts","../animals/index.d.ts","../../zoo/zoo.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},"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n",{"version":"90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}","signature":"f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n","impliedNodeFormat":1}],"fileIdsList":[[4],[2,3]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../zoo","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,1]],"latestChangedDtsFile":"./zoo.d.ts"} +//// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../zoo/zoo.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../animals/animal.d.ts", + "../animals/dog.d.ts", + "../animals/index.d.ts", + "../../zoo/zoo.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": "../animals/animal.d.ts", + "version": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../animals/dog.d.ts", + "version": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../animals/index.d.ts", + "version": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../zoo/zoo.ts", + "version": "90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}", + "signature": "f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}", + "signature": "f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../animals/index.d.ts" + ], + [ + "../animals/animal.d.ts", + "../animals/dog.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../zoo", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../animals/dog.d.ts": [ + "../animals/index.d.ts" + ], + "../animals/index.d.ts": [ + "../animals/animal.d.ts", + "../animals/dog.d.ts" + ], + "../../zoo/zoo.ts": [ + "../animals/index.d.ts" + ] + }, + "latestChangedDtsFile": "./zoo.d.ts", + "size": 2104 +} +//// [/user/username/projects/demo/lib/zoo/zoo.d.ts] *new* +import { Dog } from '../animals/index'; +export declare function createZoo(): Array; + +//// [/user/username/projects/demo/lib/zoo/zoo.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createZoo = createZoo; +const index_1 = require("../animals/index"); +function createZoo() { + return [ + (0, index_1.createDog)() + ]; +} + + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/core/utilities.ts +Signatures:: +(stored at emit) /user/username/projects/demo/core/utilities.ts + +animals/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/animals/animal.ts +*refresh* /user/username/projects/demo/animals/index.ts +*refresh* /user/username/projects/demo/lib/core/utilities.d.ts +*refresh* /user/username/projects/demo/animals/dog.ts +Signatures:: +(stored at emit) /user/username/projects/demo/animals/animal.ts +(stored at emit) /user/username/projects/demo/animals/index.ts +(stored at emit) /user/username/projects/demo/animals/dog.ts + +zoo/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/lib/animals/animal.d.ts +*refresh* /user/username/projects/demo/lib/animals/dog.d.ts +*refresh* /user/username/projects/demo/lib/animals/index.d.ts +*refresh* /user/username/projects/demo/zoo/zoo.ts +Signatures:: +(stored at emit) /user/username/projects/demo/zoo/zoo.ts + +b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/b/index.ts +Signatures:: +(stored at emit) /user/username/projects/demo/b/index.ts + +a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/a/index.ts +Signatures:: +(stored at emit) /user/username/projects/demo/a/index.ts diff --git a/testdata/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js b/testdata/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js new file mode 100644 index 0000000000..51cfcbbfd6 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js @@ -0,0 +1,560 @@ +currentDirectory::/user/username/projects/demo +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/demo/animals/animal.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} +//// [/user/username/projects/demo/animals/dog.ts] *new* +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] *new* +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; +//// [/user/username/projects/demo/animals/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": "." + }, + "references": [ + { "path": "../core" } + ] +} +//// [/user/username/projects/demo/core/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + }, +} +//// [/user/username/projects/demo/core/utilities.ts] *new* +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/tsconfig-base.json] *new* +{ + "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] *new* +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals", + }, + { + "path": "./zoo", + }, + ], +} +//// [/user/username/projects/demo/zoo/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} +//// [/user/username/projects/demo/zoo/zoo.ts] *new* +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * animals/tsconfig.json + * zoo/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'animals/tsconfig.json' is out of date because output file 'lib/animals/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'animals/tsconfig.json'... + +[HH:MM:SS AM] Project 'zoo/tsconfig.json' is out of date because output file 'lib/zoo/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'zoo/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; }; +//// [/user/username/projects/demo/lib/animals/animal.d.ts] *new* +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + +//// [/user/username/projects/demo/lib/animals/animal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/demo/lib/animals/dog.d.ts] *new* +import Animal from '.'; +export interface Dog extends Animal { + woof(): void; + name: string; +} +export declare function createDog(): Dog; + +//// [/user/username/projects/demo/lib/animals/dog.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = createDog; +const utilities_1 = require("../core/utilities"); +function createDog() { + return ({ + size: "medium", + woof: function () { + console.log(`${this.name} says "Woof"!`); + }, + name: (0, utilities_1.makeRandomName)() + }); +} + +//// [/user/username/projects/demo/lib/animals/index.d.ts] *new* +import Animal from './animal'; +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + +//// [/user/username/projects/demo/lib/animals/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDog = void 0; +const dog_1 = require("./dog"); +Object.defineProperty(exports, "createDog", { enumerable: true, get: function () { return dog_1.createDog; } }); + +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3],5],"fileNames":["lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.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":"47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}","signature":"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","impliedNodeFormat":1},{"version":"d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };","signature":"a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","impliedNodeFormat":1},"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n",{"version":"39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}","signature":"4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","impliedNodeFormat":1}],"fileIdsList":[[3,4],[2,5]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"referencedMap":[[5,1],[3,2]],"latestChangedDtsFile":"./dog.d.ts"} +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../animals/animal.ts", + "../../animals/index.ts" + ], + "original": [ + 2, + 3 + ] + }, + { + "files": [ + "../../animals/dog.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../../animals/animal.ts", + "../../animals/index.ts", + "../core/utilities.d.ts", + "../../animals/dog.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": "../../animals/animal.ts", + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "47f086fff365b1e8b96a6df2c4313c1a-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../animals/index.ts", + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d6a6b65b86b0330b1a1bd96b1738d5a4-import Animal from './animal';\n\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../core/utilities.d.ts", + "version": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../animals/dog.ts", + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "39dbb9b755eef022e56879989968e5cf-import Animal from '.';\nimport { makeRandomName } from '../core/utilities';\n\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\n\nexport function createDog(): Dog {\n return ({\n size: \"medium\",\n woof: function(this: Dog) {\n console.log(`${ this.name } says \"Woof\"!`);\n },\n name: makeRandomName()\n });\n}", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../animals", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "latestChangedDtsFile": "./dog.d.ts", + "size": 2794 +} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../../core/utilities.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":"43144ca7c82db0f51f0d56a2b3e2f565-export function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}","signature":"096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"latestChangedDtsFile":"./utilities.d.ts"} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../core/utilities.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../../core/utilities.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": "../../core/utilities.ts", + "version": "43144ca7c82db0f51f0d56a2b3e2f565-export function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "43144ca7c82db0f51f0d56a2b3e2f565-export function makeRandomName() {\n return \"Bob!?! \";\n}\n\nexport function lastElementOf(arr: T[]): T | undefined {\n if (arr.length === 0) return undefined;\n return arr[arr.length - 1];\n}", + "signature": "096c311e7aecdb577f7b613fbf1716e5-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../core", + "strict": true, + "target": 1 + }, + "latestChangedDtsFile": "./utilities.d.ts", + "size": 1586 +} +//// [/user/username/projects/demo/lib/core/utilities.d.ts] *new* +export declare function makeRandomName(): string; +export declare function lastElementOf(arr: T[]): T | undefined; + +//// [/user/username/projects/demo/lib/core/utilities.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeRandomName = makeRandomName; +exports.lastElementOf = lastElementOf; +function makeRandomName() { + return "Bob!?! "; +} +function lastElementOf(arr) { + if (arr.length === 0) + return undefined; + return arr[arr.length - 1]; +} + +//// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../animals/animal.d.ts","../animals/dog.d.ts","../animals/index.d.ts","../../zoo/zoo.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},"1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n",{"version":"90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}","signature":"f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n","impliedNodeFormat":1}],"fileIdsList":[[4],[2,3]],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../zoo","strict":true,"target":1},"referencedMap":[[3,1],[4,2],[5,1]],"latestChangedDtsFile":"./zoo.d.ts"} +//// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../zoo/zoo.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../animals/animal.d.ts", + "../animals/dog.d.ts", + "../animals/index.d.ts", + "../../zoo/zoo.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": "../animals/animal.d.ts", + "version": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "signature": "1d76529d4652ddf9ebdfa65e748240fb-export type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../animals/dog.d.ts", + "version": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "signature": "4dc4bc559452869bfd0d92b5ed5d604f-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../animals/index.d.ts", + "version": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "signature": "a3e41a5ccafc3d07a201f0603e28edcf-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../zoo/zoo.ts", + "version": "90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}", + "signature": "f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "90c7a8cea6924c55890fba84da3398f3-import { Dog, createDog } from '../animals/index';\n\nexport function createZoo(): Array {\n return [\n createDog()\n ];\n}", + "signature": "f9be246631fc3123a90a7f2cf5f5a1a2-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../animals/index.d.ts" + ], + [ + "../animals/animal.d.ts", + "../animals/dog.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../zoo", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../animals/dog.d.ts": [ + "../animals/index.d.ts" + ], + "../animals/index.d.ts": [ + "../animals/animal.d.ts", + "../animals/dog.d.ts" + ], + "../../zoo/zoo.ts": [ + "../animals/index.d.ts" + ] + }, + "latestChangedDtsFile": "./zoo.d.ts", + "size": 2104 +} +//// [/user/username/projects/demo/lib/zoo/zoo.d.ts] *new* +import { Dog } from '../animals/index'; +export declare function createZoo(): Array; + +//// [/user/username/projects/demo/lib/zoo/zoo.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createZoo = createZoo; +const index_1 = require("../animals/index"); +function createZoo() { + return [ + (0, index_1.createDog)() + ]; +} + + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/core/utilities.ts +Signatures:: +(stored at emit) /user/username/projects/demo/core/utilities.ts + +animals/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/animals/animal.ts +*refresh* /user/username/projects/demo/animals/index.ts +*refresh* /user/username/projects/demo/lib/core/utilities.d.ts +*refresh* /user/username/projects/demo/animals/dog.ts +Signatures:: +(stored at emit) /user/username/projects/demo/animals/animal.ts +(stored at emit) /user/username/projects/demo/animals/index.ts +(stored at emit) /user/username/projects/demo/animals/dog.ts + +zoo/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/demo/lib/animals/animal.d.ts +*refresh* /user/username/projects/demo/lib/animals/dog.d.ts +*refresh* /user/username/projects/demo/lib/animals/index.d.ts +*refresh* /user/username/projects/demo/zoo/zoo.ts +Signatures:: +(stored at emit) /user/username/projects/demo/zoo/zoo.ts + + +Edit [0]:: no change + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * animals/tsconfig.json + * zoo/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/utilities.ts' is older than output 'lib/core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'animals/tsconfig.json' is up to date because newest input 'animals/index.ts' is older than output 'lib/animals/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'zoo/tsconfig.json' is up to date because newest input 'zoo/zoo.ts' is older than output 'lib/zoo/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js new file mode 100644 index 0000000000..ce09890b25 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -0,0 +1,431 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/a.ts] *new* +import { B } from "./b"; + +export interface A { + b: B; +} +//// [/home/src/workspaces/project/src/b.ts] *new* +import { C } from "./c"; + +export interface B { + b: C; +} +//// [/home/src/workspaces/project/src/c.ts] *new* +import { A } from "./a"; + +export interface C { + a: A; +} +//// [/home/src/workspaces/project/src/index.ts] *new* +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "target": "es5", + "module": "commonjs", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true, + }, +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/lib/a.d.ts] *new* +import { B } from "./b"; +export interface A { + b: B; +} +//# sourceMappingURL=a.d.ts.map +//// [/home/src/workspaces/project/lib/a.d.ts.map] *new* +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;CACR"} +//// [/home/src/workspaces/project/lib/b.d.ts] *new* +import { C } from "./c"; +export interface B { + b: C; +} +//# sourceMappingURL=b.d.ts.map +//// [/home/src/workspaces/project/lib/b.d.ts.map] *new* +{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["../src/b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;CACR"} +//// [/home/src/workspaces/project/lib/c.d.ts] *new* +import { A } from "./a"; +export interface C { + a: A; +} +//# sourceMappingURL=c.d.ts.map +//// [/home/src/workspaces/project/lib/c.d.ts.map] *new* +{"version":3,"file":"c.d.ts","sourceRoot":"","sources":["../src/c.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;CACR"} +//// [/home/src/workspaces/project/lib/index.d.ts] *new* +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; +//# sourceMappingURL=index.d.ts.map +//// [/home/src/workspaces/project/lib/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.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":"e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}","signature":"57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n","impliedNodeFormat":1},{"version":"635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}","signature":"2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n","impliedNodeFormat":1},{"version":"0c094e56b7619bf6cde26939daf7a796-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}","signature":"2904de9e1ae84b014654eae6ae9d57b8-import { B } from \"./b\";\nexport interface A {\n b: B;\n}\n","impliedNodeFormat":1},{"version":"9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";","signature":"c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2],[4],[2,3,4]],"options":{"alwaysStrict":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","strict":true,"sourceMap":true,"target":1},"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"latestChangedDtsFile":"./lib/index.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.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": "./src/c.ts", + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/b.ts", + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/a.ts", + "version": "0c094e56b7619bf6cde26939daf7a796-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}", + "signature": "2904de9e1ae84b014654eae6ae9d57b8-import { B } from \"./b\";\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0c094e56b7619bf6cde26939daf7a796-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}", + "signature": "2904de9e1ae84b014654eae6ae9d57b8-import { B } from \"./b\";\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/index.ts", + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/b.ts" + ], + [ + "./src/c.ts" + ], + [ + "./src/a.ts" + ], + [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + ], + "options": { + "alwaysStrict": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "sourceMap": true, + "target": 1 + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + }, + "latestChangedDtsFile": "./lib/index.d.ts", + "size": 2277 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/c.ts +*refresh* /home/src/workspaces/project/src/b.ts +*refresh* /home/src/workspaces/project/src/a.ts +*refresh* /home/src/workspaces/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/c.ts +(stored at emit) /home/src/workspaces/project/src/b.ts +(stored at emit) /home/src/workspaces/project/src/a.ts +(stored at emit) /home/src/workspaces/project/src/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/home/src/workspaces/project/src/a.ts] *modified* +import { B } from "./b"; + +export interface A { + b: B; foo: any; +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/lib/a.d.ts] *modified* +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} +//# sourceMappingURL=a.d.ts.map +//// [/home/src/workspaces/project/lib/a.d.ts.map] *modified* +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAClB"} +//// [/home/src/workspaces/project/lib/b.d.ts.map] *rewrite with same content* +//// [/home/src/workspaces/project/lib/c.d.ts.map] *rewrite with same content* +//// [/home/src/workspaces/project/lib/index.d.ts.map] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.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":"e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}","signature":"57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n","impliedNodeFormat":1},{"version":"635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}","signature":"2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n","impliedNodeFormat":1},{"version":"078c59719381373c2fc227a7b5ee0f0b-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}","signature":"ddf8205c0552214926ecdcce4664e925-import { B } from \"./b\";\nexport interface A {\n b: B;\n foo: any;\n}\n","impliedNodeFormat":1},{"version":"9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";","signature":"c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2],[4],[2,3,4]],"options":{"alwaysStrict":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","strict":true,"sourceMap":true,"target":1},"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"latestChangedDtsFile":"./lib/a.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.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": "./src/c.ts", + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/b.ts", + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/a.ts", + "version": "078c59719381373c2fc227a7b5ee0f0b-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}", + "signature": "ddf8205c0552214926ecdcce4664e925-import { B } from \"./b\";\nexport interface A {\n b: B;\n foo: any;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "078c59719381373c2fc227a7b5ee0f0b-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}", + "signature": "ddf8205c0552214926ecdcce4664e925-import { B } from \"./b\";\nexport interface A {\n b: B;\n foo: any;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/index.ts", + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/b.ts" + ], + [ + "./src/c.ts" + ], + [ + "./src/a.ts" + ], + [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + ], + "options": { + "alwaysStrict": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "sourceMap": true, + "target": 1 + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + }, + "latestChangedDtsFile": "./lib/a.d.ts", + "size": 2298 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/c.ts +*refresh* /home/src/workspaces/project/src/b.ts +*refresh* /home/src/workspaces/project/src/a.ts +*refresh* /home/src/workspaces/project/src/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/c.ts +(stored at emit) /home/src/workspaces/project/src/b.ts +(computed .d.ts) /home/src/workspaces/project/src/a.ts +(computed .d.ts) /home/src/workspaces/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js new file mode 100644 index 0000000000..4ff576fa8a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -0,0 +1,418 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/a.ts] *new* +import { B } from "./b"; + +export interface A { + b: B; +} +//// [/home/src/workspaces/project/src/b.ts] *new* +import { C } from "./c"; + +export interface B { + b: C; +} +//// [/home/src/workspaces/project/src/c.ts] *new* +import { A } from "./a"; + +export interface C { + a: A; +} +//// [/home/src/workspaces/project/src/index.ts] *new* +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "target": "es5", + "module": "commonjs", + "declaration": true, + "declarationMap": false, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true, + }, +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/lib/a.d.ts] *new* +import { B } from "./b"; +export interface A { + b: B; +} + +//// [/home/src/workspaces/project/lib/b.d.ts] *new* +import { C } from "./c"; +export interface B { + b: C; +} + +//// [/home/src/workspaces/project/lib/c.d.ts] *new* +import { A } from "./a"; +export interface C { + a: A; +} + +//// [/home/src/workspaces/project/lib/index.d.ts] *new* +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.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":"e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}","signature":"57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n","impliedNodeFormat":1},{"version":"635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}","signature":"2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n","impliedNodeFormat":1},{"version":"0c094e56b7619bf6cde26939daf7a796-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}","signature":"2904de9e1ae84b014654eae6ae9d57b8-import { B } from \"./b\";\nexport interface A {\n b: B;\n}\n","impliedNodeFormat":1},{"version":"9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";","signature":"c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2],[4],[2,3,4]],"options":{"alwaysStrict":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":false,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","strict":true,"sourceMap":true,"target":1},"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"latestChangedDtsFile":"./lib/index.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.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": "./src/c.ts", + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/b.ts", + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/a.ts", + "version": "0c094e56b7619bf6cde26939daf7a796-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}", + "signature": "2904de9e1ae84b014654eae6ae9d57b8-import { B } from \"./b\";\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0c094e56b7619bf6cde26939daf7a796-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}", + "signature": "2904de9e1ae84b014654eae6ae9d57b8-import { B } from \"./b\";\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/index.ts", + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/b.ts" + ], + [ + "./src/c.ts" + ], + [ + "./src/a.ts" + ], + [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + ], + "options": { + "alwaysStrict": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": false, + "esModuleInterop": true, + "module": 1, + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "sourceMap": true, + "target": 1 + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + }, + "latestChangedDtsFile": "./lib/index.d.ts", + "size": 2278 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/c.ts +*refresh* /home/src/workspaces/project/src/b.ts +*refresh* /home/src/workspaces/project/src/a.ts +*refresh* /home/src/workspaces/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/c.ts +(stored at emit) /home/src/workspaces/project/src/b.ts +(stored at emit) /home/src/workspaces/project/src/a.ts +(stored at emit) /home/src/workspaces/project/src/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/home/src/workspaces/project/src/a.ts] *modified* +import { B } from "./b"; + +export interface A { + b: B; foo: any; +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/lib/a.d.ts] *modified* +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.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":"e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}","signature":"57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n","impliedNodeFormat":1},{"version":"635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}","signature":"2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n","impliedNodeFormat":1},{"version":"078c59719381373c2fc227a7b5ee0f0b-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}","signature":"ddf8205c0552214926ecdcce4664e925-import { B } from \"./b\";\nexport interface A {\n b: B;\n foo: any;\n}\n","impliedNodeFormat":1},{"version":"9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";","signature":"c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2],[4],[2,3,4]],"options":{"alwaysStrict":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":false,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","strict":true,"sourceMap":true,"target":1},"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"latestChangedDtsFile":"./lib/a.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/c.ts", + "./src/b.ts", + "./src/a.ts", + "./src/index.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": "./src/c.ts", + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/b.ts", + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/a.ts", + "version": "078c59719381373c2fc227a7b5ee0f0b-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}", + "signature": "ddf8205c0552214926ecdcce4664e925-import { B } from \"./b\";\nexport interface A {\n b: B;\n foo: any;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "078c59719381373c2fc227a7b5ee0f0b-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}", + "signature": "ddf8205c0552214926ecdcce4664e925-import { B } from \"./b\";\nexport interface A {\n b: B;\n foo: any;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/index.ts", + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9752277022f460184d673fd343fe2c3f-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";", + "signature": "c689f6bb5a7ac5a812528f5b6ccb6872-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/b.ts" + ], + [ + "./src/c.ts" + ], + [ + "./src/a.ts" + ], + [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + ], + "options": { + "alwaysStrict": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": false, + "esModuleInterop": true, + "module": 1, + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "sourceMap": true, + "target": 1 + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/c.ts", + "./src/b.ts", + "./src/a.ts" + ] + }, + "latestChangedDtsFile": "./lib/a.d.ts", + "size": 2299 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/c.ts +*refresh* /home/src/workspaces/project/src/b.ts +*refresh* /home/src/workspaces/project/src/a.ts +*refresh* /home/src/workspaces/project/src/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/c.ts +(stored at emit) /home/src/workspaces/project/src/b.ts +(computed .d.ts) /home/src/workspaces/project/src/a.ts +(computed .d.ts) /home/src/workspaces/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js new file mode 100644 index 0000000000..5e816fb977 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -0,0 +1,495 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/a.ts] *new* +export class B { prop = "hello"; } + +export interface A { + b: B; +} +//// [/home/src/workspaces/project/src/b.ts] *new* +import { C } from "./c"; + +export interface B { + b: C; +} +//// [/home/src/workspaces/project/src/c.ts] *new* +import { A } from "./a"; + +export interface C { + a: A; +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "target": "es5", + "module": "commonjs", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true, + }, +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/lib/a.d.ts] *new* +export declare class B { + prop: string; +} +export interface A { + b: B; +} +//# sourceMappingURL=a.d.ts.map +//// [/home/src/workspaces/project/lib/a.d.ts.map] *new* +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAElC,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;CACR"} +//// [/home/src/workspaces/project/lib/b.d.ts] *new* +import { C } from "./c"; +export interface B { + b: C; +} +//# sourceMappingURL=b.d.ts.map +//// [/home/src/workspaces/project/lib/b.d.ts.map] *new* +{"version":3,"file":"b.d.ts","sourceRoot":"","sources":["../src/b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;CACR"} +//// [/home/src/workspaces/project/lib/c.d.ts] *new* +import { A } from "./a"; +export interface C { + a: A; +} +//# sourceMappingURL=c.d.ts.map +//// [/home/src/workspaces/project/lib/c.d.ts.map] *new* +{"version":3,"file":"c.d.ts","sourceRoot":"","sources":["../src/c.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;CACR"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/a.ts","./src/c.ts","./src/b.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":"665f99944701507453d40566cb1ae14c-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}","signature":"99c00a9e07d33f360f88c1625460e5f4-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n}\n","impliedNodeFormat":1},{"version":"e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}","signature":"57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n","impliedNodeFormat":1},{"version":"635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}","signature":"2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"alwaysStrict":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","strict":true,"sourceMap":true,"target":1},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./lib/b.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/a.ts", + "./src/c.ts", + "./src/b.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/a.ts", + "./src/c.ts", + "./src/b.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": "./src/a.ts", + "version": "665f99944701507453d40566cb1ae14c-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}", + "signature": "99c00a9e07d33f360f88c1625460e5f4-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "665f99944701507453d40566cb1ae14c-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}", + "signature": "99c00a9e07d33f360f88c1625460e5f4-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/c.ts", + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/b.ts", + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/c.ts" + ], + [ + "./src/a.ts" + ] + ], + "options": { + "alwaysStrict": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "sourceMap": true, + "target": 1 + }, + "referencedMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "latestChangedDtsFile": "./lib/b.d.ts", + "size": 1978 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/a.ts +*refresh* /home/src/workspaces/project/src/c.ts +*refresh* /home/src/workspaces/project/src/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/a.ts +(stored at emit) /home/src/workspaces/project/src/c.ts +(stored at emit) /home/src/workspaces/project/src/b.ts + + +Edit [0]:: incremental-declaration-doesnt-change +//// [/home/src/workspaces/project/src/a.ts] *modified* +export class B { prop = "hello"; } + +class C { } +export interface A { + b: B; +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/lib/a.d.ts.map] *modified* +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;CACR"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/a.ts","./src/c.ts","./src/b.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":"d6b87c1d5c5dc8a828f29d0ccdf50a96-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}","signature":"99c00a9e07d33f360f88c1625460e5f4-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n}\n","impliedNodeFormat":1},{"version":"e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}","signature":"57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n","impliedNodeFormat":1},{"version":"635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}","signature":"2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"alwaysStrict":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","strict":true,"sourceMap":true,"target":1},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./lib/b.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/a.ts", + "./src/c.ts", + "./src/b.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/a.ts", + "./src/c.ts", + "./src/b.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": "./src/a.ts", + "version": "d6b87c1d5c5dc8a828f29d0ccdf50a96-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}", + "signature": "99c00a9e07d33f360f88c1625460e5f4-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d6b87c1d5c5dc8a828f29d0ccdf50a96-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}", + "signature": "99c00a9e07d33f360f88c1625460e5f4-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/c.ts", + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/b.ts", + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/c.ts" + ], + [ + "./src/a.ts" + ] + ], + "options": { + "alwaysStrict": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "sourceMap": true, + "target": 1 + }, + "referencedMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "latestChangedDtsFile": "./lib/b.d.ts", + "size": 1991 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/a.ts + + +Edit [1]:: incremental-declaration-changes +//// [/home/src/workspaces/project/src/a.ts] *modified* +export class B { prop = "hello"; } + +class C { } +export interface A { + b: B; foo: any; +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/lib/a.d.ts] *modified* +export declare class B { + prop: string; +} +export interface A { + b: B; + foo: any; +} +//# sourceMappingURL=a.d.ts.map +//// [/home/src/workspaces/project/lib/a.d.ts.map] *modified* +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IACd,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAClB"} +//// [/home/src/workspaces/project/lib/b.d.ts.map] *rewrite with same content* +//// [/home/src/workspaces/project/lib/c.d.ts.map] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/a.ts","./src/c.ts","./src/b.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":"f2ea1f64003c617e4826031e7133d22d-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B; foo: any;\n}","signature":"1bd611ec5b00f8f076ed030967bcfa3e-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n foo: any;\n}\n","impliedNodeFormat":1},{"version":"e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}","signature":"57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n","impliedNodeFormat":1},{"version":"635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}","signature":"2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"alwaysStrict":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","strict":true,"sourceMap":true,"target":1},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./lib/a.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/a.ts", + "./src/c.ts", + "./src/b.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/a.ts", + "./src/c.ts", + "./src/b.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": "./src/a.ts", + "version": "f2ea1f64003c617e4826031e7133d22d-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B; foo: any;\n}", + "signature": "1bd611ec5b00f8f076ed030967bcfa3e-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n foo: any;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f2ea1f64003c617e4826031e7133d22d-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B; foo: any;\n}", + "signature": "1bd611ec5b00f8f076ed030967bcfa3e-export declare class B {\n prop: string;\n}\nexport interface A {\n b: B;\n foo: any;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/c.ts", + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8d66a87a10151e3d8c84e04e3d962c9-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}", + "signature": "57c1fb7dd5816e999a47a54abfd60004-import { A } from \"./a\";\nexport interface C {\n a: A;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/b.ts", + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "635cd13fa5127837a0f61aa9d436e764-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}", + "signature": "2c6af9ce6f102ba192048b07d4b44ebf-import { C } from \"./c\";\nexport interface B {\n b: C;\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/c.ts" + ], + [ + "./src/a.ts" + ] + ], + "options": { + "alwaysStrict": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./lib", + "rootDir": "./src", + "strict": true, + "sourceMap": true, + "target": 1 + }, + "referencedMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "latestChangedDtsFile": "./lib/a.d.ts", + "size": 2016 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/a.ts +*refresh* /home/src/workspaces/project/src/c.ts +*refresh* /home/src/workspaces/project/src/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/a.ts +(computed .d.ts) /home/src/workspaces/project/src/c.ts +(stored at emit) /home/src/workspaces/project/src/b.ts diff --git a/testdata/baselines/reference/tsbuild/extends/configDir-template.js b/testdata/baselines/reference/tsbuild/extends/configDir-template.js new file mode 100644 index 0000000000..b4531c56b1 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/extends/configDir-template.js @@ -0,0 +1,133 @@ +currentDirectory::/home/src/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/configs/first/tsconfig.json] *new* +{ + "extends": "../second/tsconfig.json", + "include": ["${configDir}/src"], + "compilerOptions": { + "typeRoots": ["root1", "${configDir}/root2", "root3"], + "types": [], + }, +} +//// [/home/src/projects/configs/second/tsconfig.json] *new* +{ + "files": ["${configDir}/main.ts"], + "compilerOptions": { + "declarationDir": "${configDir}/decls", + "paths": { + "@myscope/*": ["${configDir}/types/*"], + }, + }, + "watchOptions": { + "excludeFiles": ["${configDir}/main.ts"], + }, +} +//// [/home/src/projects/myproject/main.ts] *new* +// some comment +export const y = 10; +import { x } from "@myscope/sometype"; +//// [/home/src/projects/myproject/tsconfig.json] *new* +{ + "extends": "../configs/first/tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "outDir", + "traceResolution": true, + }, +} +//// [/home/src/projects/myproject/types/sometype.ts] *new* +export const x = 10; + +tsgo --b --explainFiles --v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'outDir/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name '@myscope/sometype'. +Module name '@myscope/sometype', matched pattern '@myscope/*'. +Trying substitution '/home/src/projects/myproject/types/*', candidate module location: '/home/src/projects/myproject/types/sometype'. +Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. +======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +types/sometype.ts + Imported via "@myscope/sometype" from file 'main.ts' +main.ts + Part of 'files' list in tsconfig.json +//// [/home/src/projects/myproject/decls/main.d.ts] *new* +// some comment +export declare const y = 10; + +//// [/home/src/projects/myproject/decls/types/sometype.d.ts] *new* +export declare const x = 10; + +//// [/home/src/projects/myproject/outDir/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +// some comment +exports.y = 10; + +//// [/home/src/projects/myproject/outDir/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../main.ts"]} +//// [/home/src/projects/myproject/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../main.ts" + ], + "original": "../main.ts" + } + ], + "size": 49 +} +//// [/home/src/projects/myproject/outDir/types/sometype.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/myproject/types/sometype.ts +*refresh* /home/src/projects/myproject/main.ts +Signatures:: +(stored at emit) /home/src/projects/myproject/types/sometype.ts +(stored at emit) /home/src/projects/myproject/main.ts diff --git a/testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js b/testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js new file mode 100644 index 0000000000..4476b7d66e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js @@ -0,0 +1,115 @@ +currentDirectory::/users/user/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/users/user/projects/myconfigs/node_modules/@something/tsconfig-base/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} +//// [/users/user/projects/myconfigs/node_modules/@something/tsconfig-node/tsconfig.json] *new* +{ + "extends": "@something/tsconfig-base/tsconfig.json", + "compilerOptions": { + "removeComments": true + } +} +//// [/users/user/projects/myproject/node_modules/@something/tsconfig-node] -> /users/user/projects/myconfigs/node_modules/@something/tsconfig-node *new* +//// [/users/user/projects/myproject/src/index.ts] *new* +// some comment +export const x = 10; +//// [/users/user/projects/myproject/src/tsconfig.json] *new* +{ + "extends": "@something/tsconfig-node/tsconfig.json" +} + +tsgo -b src --extendedDiagnostics +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/users/user/projects/myproject/node_modules/@something/tsconfig-node] *deleted* +//// [/users/user/projects/myproject/src/index.d.ts] *new* +export declare const x = 10; + +//// [/users/user/projects/myproject/src/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/users/user/projects/myproject/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.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":"03965946b1acc2afec91a302f9646317-// some comment\nexport const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1}],"options":{"composite":true,"removeComments":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/users/user/projects/myproject/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./index.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": "./index.ts", + "version": "03965946b1acc2afec91a302f9646317-// some comment\nexport const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "03965946b1acc2afec91a302f9646317-// some comment\nexport const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "removeComments": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1134 +} + +src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /users/user/projects/myproject/src/index.ts +Signatures:: +(stored at emit) /users/user/projects/myproject/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/extends/when-building-project-uses-reference-and-both-extend-config-with-include.js b/testdata/baselines/reference/tsbuild/extends/when-building-project-uses-reference-and-both-extend-config-with-include.js new file mode 100644 index 0000000000..c0e99b3935 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/extends/when-building-project-uses-reference-and-both-extend-config-with-include.js @@ -0,0 +1,255 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/shared/index.ts] *new* +export const a: Unrestricted = 1; +//// [/home/src/workspaces/solution/shared/tsconfig-base.json] *new* +{ + "include": ["./typings-base/"], +} +//// [/home/src/workspaces/solution/shared/tsconfig.json] *new* +{ + "extends": "./tsconfig-base.json", + "compilerOptions": { + "composite": true, + "outDir": "../target-tsc-build/", + "rootDir": "..", + }, + "files": ["./index.ts"], +} +//// [/home/src/workspaces/solution/shared/typings-base/globals.d.ts] *new* +type Unrestricted = any; +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "references": [ + { "path": "./shared/tsconfig.json" }, + { "path": "./webpack/tsconfig.json" }, + ], + "files": [], +} +//// [/home/src/workspaces/solution/webpack/index.ts] *new* +export const b: Unrestricted = 1; +//// [/home/src/workspaces/solution/webpack/tsconfig.json] *new* +{ + "extends": "../shared/tsconfig-base.json", + "compilerOptions": { + "composite": true, + "outDir": "../target-tsc-build/", + "rootDir": "..", + }, + "files": ["./index.ts"], + "references": [{ "path": "../shared/tsconfig.json" }], +} + +tsgo --b webpack/tsconfig.json --v --listFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * shared/tsconfig.json + * webpack/tsconfig.json + +[HH:MM:SS AM] Project 'shared/tsconfig.json' is out of date because output file 'target-tsc-build/shared/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'shared/tsconfig.json'... + +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/workspaces/solution/shared/index.ts +/home/src/workspaces/solution/shared/typings-base/globals.d.ts +[HH:MM:SS AM] Project 'webpack/tsconfig.json' is out of date because output file 'target-tsc-build/webpack/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'webpack/tsconfig.json'... + +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/workspaces/solution/webpack/index.ts +/home/src/workspaces/solution/shared/typings-base/globals.d.ts +//// [/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/target-tsc-build/shared/index.d.ts] *new* +export declare const a: Unrestricted; + +//// [/home/src/workspaces/solution/target-tsc-build/shared/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 1; + +//// [/home/src/workspaces/solution/target-tsc-build/shared/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../shared/index.ts","../../shared/typings-base/globals.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":"038419a8862a47ff75929bd3632cfaa0-export const a: Unrestricted = 1;","signature":"3d46c415eae6cd0e760bea3fa85ba3aa-export declare const a: Unrestricted;\n","impliedNodeFormat":1},{"version":"0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/target-tsc-build/shared/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../shared/index.ts", + "../../shared/typings-base/globals.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../shared/index.ts", + "../../shared/typings-base/globals.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": "../../shared/index.ts", + "version": "038419a8862a47ff75929bd3632cfaa0-export const a: Unrestricted = 1;", + "signature": "3d46c415eae6cd0e760bea3fa85ba3aa-export declare const a: Unrestricted;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "038419a8862a47ff75929bd3632cfaa0-export const a: Unrestricted = 1;", + "signature": "3d46c415eae6cd0e760bea3fa85ba3aa-export declare const a: Unrestricted;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../shared/typings-base/globals.d.ts", + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "signature": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../.." + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1325 +} +//// [/home/src/workspaces/solution/target-tsc-build/webpack/index.d.ts] *new* +export declare const b: Unrestricted; + +//// [/home/src/workspaces/solution/target-tsc-build/webpack/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 1; + +//// [/home/src/workspaces/solution/target-tsc-build/webpack/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../webpack/index.ts","../../shared/typings-base/globals.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":"55323568c1e8cde378750e233962127b-export const b: Unrestricted = 1;","signature":"ab6809558636ca24521fe1a6d7861d37-export declare const b: Unrestricted;\n","impliedNodeFormat":1},{"version":"0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/target-tsc-build/webpack/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../webpack/index.ts", + "../../shared/typings-base/globals.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../webpack/index.ts", + "../../shared/typings-base/globals.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": "../../webpack/index.ts", + "version": "55323568c1e8cde378750e233962127b-export const b: Unrestricted = 1;", + "signature": "ab6809558636ca24521fe1a6d7861d37-export declare const b: Unrestricted;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "55323568c1e8cde378750e233962127b-export const b: Unrestricted = 1;", + "signature": "ab6809558636ca24521fe1a6d7861d37-export declare const b: Unrestricted;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../shared/typings-base/globals.d.ts", + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "signature": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../.." + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1326 +} + +shared/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/shared/index.ts +*refresh* /home/src/workspaces/solution/shared/typings-base/globals.d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/shared/index.ts + +webpack/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/webpack/index.ts +*refresh* /home/src/workspaces/solution/shared/typings-base/globals.d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/webpack/index.ts diff --git a/testdata/baselines/reference/tsbuild/extends/when-building-solution-with-projects-extends-config-with-include.js b/testdata/baselines/reference/tsbuild/extends/when-building-solution-with-projects-extends-config-with-include.js new file mode 100644 index 0000000000..e23831d39a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/extends/when-building-solution-with-projects-extends-config-with-include.js @@ -0,0 +1,256 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/shared/index.ts] *new* +export const a: Unrestricted = 1; +//// [/home/src/workspaces/solution/shared/tsconfig-base.json] *new* +{ + "include": ["./typings-base/"], +} +//// [/home/src/workspaces/solution/shared/tsconfig.json] *new* +{ + "extends": "./tsconfig-base.json", + "compilerOptions": { + "composite": true, + "outDir": "../target-tsc-build/", + "rootDir": "..", + }, + "files": ["./index.ts"], +} +//// [/home/src/workspaces/solution/shared/typings-base/globals.d.ts] *new* +type Unrestricted = any; +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "references": [ + { "path": "./shared/tsconfig.json" }, + { "path": "./webpack/tsconfig.json" }, + ], + "files": [], +} +//// [/home/src/workspaces/solution/webpack/index.ts] *new* +export const b: Unrestricted = 1; +//// [/home/src/workspaces/solution/webpack/tsconfig.json] *new* +{ + "extends": "../shared/tsconfig-base.json", + "compilerOptions": { + "composite": true, + "outDir": "../target-tsc-build/", + "rootDir": "..", + }, + "files": ["./index.ts"], + "references": [{ "path": "../shared/tsconfig.json" }], +} + +tsgo --b --v --listFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * shared/tsconfig.json + * webpack/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'shared/tsconfig.json' is out of date because output file 'target-tsc-build/shared/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'shared/tsconfig.json'... + +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/workspaces/solution/shared/index.ts +/home/src/workspaces/solution/shared/typings-base/globals.d.ts +[HH:MM:SS AM] Project 'webpack/tsconfig.json' is out of date because output file 'target-tsc-build/webpack/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'webpack/tsconfig.json'... + +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/workspaces/solution/webpack/index.ts +/home/src/workspaces/solution/shared/typings-base/globals.d.ts +//// [/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/target-tsc-build/shared/index.d.ts] *new* +export declare const a: Unrestricted; + +//// [/home/src/workspaces/solution/target-tsc-build/shared/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = 1; + +//// [/home/src/workspaces/solution/target-tsc-build/shared/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../shared/index.ts","../../shared/typings-base/globals.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":"038419a8862a47ff75929bd3632cfaa0-export const a: Unrestricted = 1;","signature":"3d46c415eae6cd0e760bea3fa85ba3aa-export declare const a: Unrestricted;\n","impliedNodeFormat":1},{"version":"0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/target-tsc-build/shared/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../shared/index.ts", + "../../shared/typings-base/globals.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../shared/index.ts", + "../../shared/typings-base/globals.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": "../../shared/index.ts", + "version": "038419a8862a47ff75929bd3632cfaa0-export const a: Unrestricted = 1;", + "signature": "3d46c415eae6cd0e760bea3fa85ba3aa-export declare const a: Unrestricted;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "038419a8862a47ff75929bd3632cfaa0-export const a: Unrestricted = 1;", + "signature": "3d46c415eae6cd0e760bea3fa85ba3aa-export declare const a: Unrestricted;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../shared/typings-base/globals.d.ts", + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "signature": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../.." + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1325 +} +//// [/home/src/workspaces/solution/target-tsc-build/webpack/index.d.ts] *new* +export declare const b: Unrestricted; + +//// [/home/src/workspaces/solution/target-tsc-build/webpack/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 1; + +//// [/home/src/workspaces/solution/target-tsc-build/webpack/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../webpack/index.ts","../../shared/typings-base/globals.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":"55323568c1e8cde378750e233962127b-export const b: Unrestricted = 1;","signature":"ab6809558636ca24521fe1a6d7861d37-export declare const b: Unrestricted;\n","impliedNodeFormat":1},{"version":"0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/target-tsc-build/webpack/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../webpack/index.ts", + "../../shared/typings-base/globals.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../webpack/index.ts", + "../../shared/typings-base/globals.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": "../../webpack/index.ts", + "version": "55323568c1e8cde378750e233962127b-export const b: Unrestricted = 1;", + "signature": "ab6809558636ca24521fe1a6d7861d37-export declare const b: Unrestricted;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "55323568c1e8cde378750e233962127b-export const b: Unrestricted = 1;", + "signature": "ab6809558636ca24521fe1a6d7861d37-export declare const b: Unrestricted;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../shared/typings-base/globals.d.ts", + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "signature": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0818246edc003d659f6bac1bc37ad307-type Unrestricted = any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../.." + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1326 +} + +shared/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/shared/index.ts +*refresh* /home/src/workspaces/solution/shared/typings-base/globals.d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/shared/index.ts + +webpack/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/webpack/index.ts +*refresh* /home/src/workspaces/solution/shared/typings-base/globals.d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/webpack/index.ts diff --git a/testdata/baselines/reference/tsbuild/fileDelete/deleted-file-without-composite.js b/testdata/baselines/reference/tsbuild/fileDelete/deleted-file-without-composite.js new file mode 100644 index 0000000000..e17c570150 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/fileDelete/deleted-file-without-composite.js @@ -0,0 +1,168 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/child/child.ts] *new* +import { child2 } from "../child/child2"; +export function child() { + child2(); +} +//// [/home/src/workspaces/solution/child/child2.ts] *new* +export function child2() { +} +//// [/home/src/workspaces/solution/child/tsconfig.json] *new* +{ + "compilerOptions": { } +} + +tsgo --b child/tsconfig.json -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * child/tsconfig.json + +[HH:MM:SS AM] Project 'child/tsconfig.json' is out of date because output file 'child/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'child/tsconfig.json'... + +======== Resolving module '../child/child2' from '/home/src/workspaces/solution/child/child.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/child/child2', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/workspaces/solution/child/child2.ts' exists - use it as a name resolution result. +======== Module name '../child/child2' was successfully resolved to '/home/src/workspaces/solution/child/child2.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +child/child2.ts + Imported via "../child/child2" from file 'child/child.ts' + Matched by default include pattern '**/*' +child/child.ts + Matched by default include pattern '**/*' +//// [/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/child/child.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.child = child; +const child2_1 = require("../child/child2"); +function child() { + (0, child2_1.child2)(); +} + +//// [/home/src/workspaces/solution/child/child2.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.child2 = child2; +function child2() { +} + +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./child.ts","./child2.ts"]} +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./child.ts" + ], + "original": "./child.ts" + }, + { + "files": [ + "./child2.ts" + ], + "original": "./child2.ts" + } + ], + "size": 63 +} + +child/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/child/child2.ts +*refresh* /home/src/workspaces/solution/child/child.ts +Signatures:: + + +Edit [0]:: delete child2 file +//// [/home/src/workspaces/solution/child/child2.js] *deleted* +//// [/home/src/workspaces/solution/child/child2.ts] *deleted* + +tsgo --b child/tsconfig.json -v --traceResolution --explainFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * child/tsconfig.json + +[HH:MM:SS AM] Project 'child/tsconfig.json' is out of date because buildinfo file 'child/tsconfig.tsbuildinfo' indicates that file 'child/child2.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'child/tsconfig.json'... + +======== Resolving module '../child/child2' from '/home/src/workspaces/solution/child/child.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/child/child2', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/workspaces/solution/child/child2.ts' does not exist. +File '/home/src/workspaces/solution/child/child2.tsx' does not exist. +File '/home/src/workspaces/solution/child/child2.d.ts' does not exist. +File '/home/src/workspaces/solution/child/child2.js' does not exist. +File '/home/src/workspaces/solution/child/child2.jsx' does not exist. +Directory '/home/src/workspaces/solution/child/child2' does not exist, skipping all lookups in it. +======== Module name '../child/child2' was not resolved. ======== +child/child.ts:1:24 - error TS2307: Cannot find module '../child/child2' or its corresponding type declarations. + +1 import { child2 } from "../child/child2"; +   ~~~~~~~~~~~~~~~~~ + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +child/child.ts + Matched by default include pattern '**/*' + +Found 1 error in child/child.ts:1 + +//// [/home/src/workspaces/solution/child/child.js] *rewrite with same content* +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./child.ts"],"semanticErrors":true} +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./child.ts" + ], + "original": "./child.ts" + } + ], + "size": 71, + "semanticErrors": true +} + +child/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/child/child.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/fileDelete/detects-deleted-file.js b/testdata/baselines/reference/tsbuild/fileDelete/detects-deleted-file.js new file mode 100644 index 0000000000..2603d2cd2e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/fileDelete/detects-deleted-file.js @@ -0,0 +1,395 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/child/child.ts] *new* +import { child2 } from "../child/child2"; +export function child() { + child2(); +} +//// [/home/src/workspaces/solution/child/child2.ts] *new* +export function child2() { +} +//// [/home/src/workspaces/solution/child/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} +//// [/home/src/workspaces/solution/main/main.ts] *new* +import { child } from "../child/child"; +export function main() { + child(); +} +//// [/home/src/workspaces/solution/main/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [{ "path": "../child" }], +} + +tsgo --b main/tsconfig.json -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * child/tsconfig.json + * main/tsconfig.json + +[HH:MM:SS AM] Project 'child/tsconfig.json' is out of date because output file 'child/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'child/tsconfig.json'... + +======== Resolving module '../child/child2' from '/home/src/workspaces/solution/child/child.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/child/child2', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/workspaces/solution/child/child2.ts' exists - use it as a name resolution result. +======== Module name '../child/child2' was successfully resolved to '/home/src/workspaces/solution/child/child2.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +child/child2.ts + Imported via "../child/child2" from file 'child/child.ts' + Matched by default include pattern '**/*' +child/child.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'main/tsconfig.json' is out of date because output file 'main/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'main/tsconfig.json'... + +======== Resolving module '../child/child' from '/home/src/workspaces/solution/main/main.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/child/child', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/workspaces/solution/child/child.ts' exists - use it as a name resolution result. +======== Module name '../child/child' was successfully resolved to '/home/src/workspaces/solution/child/child.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +child/child.d.ts + Imported via "../child/child" from file 'main/main.ts' + File is output of project reference source 'child/child.ts' +main/main.ts + Matched by default include pattern '**/*' +//// [/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/child/child.d.ts] *new* +export declare function child(): void; + +//// [/home/src/workspaces/solution/child/child.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.child = child; +const child2_1 = require("../child/child2"); +function child() { + (0, child2_1.child2)(); +} + +//// [/home/src/workspaces/solution/child/child2.d.ts] *new* +export declare function child2(): void; + +//// [/home/src/workspaces/solution/child/child2.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.child2 = child2; +function child2() { +} + +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./child2.ts","./child.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":"85942d10a7b48fc9efb88a3f01fa243f-export function child2() {\n}","signature":"a48d766cad04341d4c420407878f4d51-export declare function child2(): void;\n","impliedNodeFormat":1},{"version":"9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}","signature":"3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./child.d.ts"} +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./child2.ts", + "./child.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./child2.ts", + "./child.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": "./child2.ts", + "version": "85942d10a7b48fc9efb88a3f01fa243f-export function child2() {\n}", + "signature": "a48d766cad04341d4c420407878f4d51-export declare function child2(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "85942d10a7b48fc9efb88a3f01fa243f-export function child2() {\n}", + "signature": "a48d766cad04341d4c420407878f4d51-export declare function child2(): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./child.ts", + "version": "9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}", + "signature": "3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}", + "signature": "3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./child2.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./child.ts": [ + "./child2.ts" + ] + }, + "latestChangedDtsFile": "./child.d.ts", + "size": 1423 +} +//// [/home/src/workspaces/solution/main/main.d.ts] *new* +export declare function main(): void; + +//// [/home/src/workspaces/solution/main/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.main = main; +const child_1 = require("../child/child"); +function main() { + (0, child_1.child)(); +} + +//// [/home/src/workspaces/solution/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../child/child.d.ts","./main.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},"3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n",{"version":"d75ecee856a9674923c51d13bc094a97-import { child } from \"../child/child\";\nexport function main() {\n child();\n}","signature":"c59caa3814ee834e4ffefaf173a2be2a-export declare function main(): void;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./main.d.ts"} +//// [/home/src/workspaces/solution/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../child/child.d.ts", + "./main.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": "../child/child.d.ts", + "version": "3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n", + "signature": "3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./main.ts", + "version": "d75ecee856a9674923c51d13bc094a97-import { child } from \"../child/child\";\nexport function main() {\n child();\n}", + "signature": "c59caa3814ee834e4ffefaf173a2be2a-export declare function main(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d75ecee856a9674923c51d13bc094a97-import { child } from \"../child/child\";\nexport function main() {\n child();\n}", + "signature": "c59caa3814ee834e4ffefaf173a2be2a-export declare function main(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../child/child.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./main.ts": [ + "../child/child.d.ts" + ] + }, + "latestChangedDtsFile": "./main.d.ts", + "size": 1308 +} + +child/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/child/child2.ts +*refresh* /home/src/workspaces/solution/child/child.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/child/child2.ts +(stored at emit) /home/src/workspaces/solution/child/child.ts + +main/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/child/child.d.ts +*refresh* /home/src/workspaces/solution/main/main.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/main/main.ts + + +Edit [0]:: delete child2 file +//// [/home/src/workspaces/solution/child/child2.d.ts] *deleted* +//// [/home/src/workspaces/solution/child/child2.js] *deleted* +//// [/home/src/workspaces/solution/child/child2.ts] *deleted* + +tsgo --b main/tsconfig.json -v --traceResolution --explainFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * child/tsconfig.json + * main/tsconfig.json + +[HH:MM:SS AM] Project 'child/tsconfig.json' is out of date because buildinfo file 'child/tsconfig.tsbuildinfo' indicates that file 'child/child2.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'child/tsconfig.json'... + +======== Resolving module '../child/child2' from '/home/src/workspaces/solution/child/child.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/child/child2', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/home/src/workspaces/solution/child/child2.ts' does not exist. +File '/home/src/workspaces/solution/child/child2.tsx' does not exist. +File '/home/src/workspaces/solution/child/child2.d.ts' does not exist. +File '/home/src/workspaces/solution/child/child2.js' does not exist. +File '/home/src/workspaces/solution/child/child2.jsx' does not exist. +Directory '/home/src/workspaces/solution/child/child2' does not exist, skipping all lookups in it. +======== Module name '../child/child2' was not resolved. ======== +child/child.ts:1:24 - error TS2307: Cannot find module '../child/child2' or its corresponding type declarations. + +1 import { child2 } from "../child/child2"; +   ~~~~~~~~~~~~~~~~~ + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +child/child.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'main/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'main/tsconfig.json'... + + +Found 1 error in child/child.ts:1 + +//// [/home/src/workspaces/solution/child/child.js] *rewrite with same content* +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./child.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":"9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}","signature":"3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n","impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[[2,[{"pos":23,"end":40,"code":2307,"category":1,"message":"Cannot find module '../child/child2' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./child.d.ts"} +//// [/home/src/workspaces/solution/child/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./child.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./child.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": "./child.ts", + "version": "9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}", + "signature": "3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9686fb058ae9baf28ea93ef1e3b32b74-import { child2 } from \"../child/child2\";\nexport function child() {\n child2();\n}", + "signature": "3a48d078ac909d932ed914f17038d634-export declare function child(): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./child.ts", + [ + { + "pos": 23, + "end": 40, + "code": 2307, + "category": 1, + "message": "Cannot find module '../child/child2' or its corresponding type declarations." + } + ] + ] + ], + "latestChangedDtsFile": "./child.d.ts", + "size": 1344 +} +//// [/home/src/workspaces/solution/main/tsconfig.tsbuildinfo] *mTime changed* + +child/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/child/child.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/child/child.ts diff --git a/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js new file mode 100644 index 0000000000..7b909938d8 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js @@ -0,0 +1,623 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/bar.ts] *new* +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] *new* +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] *new* +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} +//// [/home/src/workspaces/project/index.ts] *new* +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] *new* +export { default as bar } from './bar'; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true, + "isolatedModules": true, + }, +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'obj/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/obj/bar.d.ts] *new* +declare const _default: (param: string) => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar(param) { +}); + +//// [/home/src/workspaces/project/obj/bundling.d.ts] *new* +export declare class LazyModule { + private importCallback; + constructor(importCallback: () => Promise); +} +export declare class LazyAction any, TModule> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction); +} + +//// [/home/src/workspaces/project/obj/bundling.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LazyAction = exports.LazyModule = void 0; +class LazyModule { + importCallback; + constructor(importCallback) { + this.importCallback = importCallback; + } +} +exports.LazyModule = LazyModule; +class LazyAction { + constructor(_lazyModule, _getter) { + } +} +exports.LazyAction = LazyAction; + +//// [/home/src/workspaces/project/obj/index.d.ts] *new* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<(param: string) => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lazyBar = void 0; +const bundling_1 = require("./bundling"); +const lazyModule = new bundling_1.LazyModule(() => Promise.resolve().then(() => require('./lazyIndex'))); +exports.lazyBar = new bundling_1.LazyAction(lazyModule, m => m.bar); + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *new* +export { default as bar } from './bar'; + +//// [/home/src/workspaces/project/obj/lazyIndex.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bar = void 0; +const bar_1 = require("./bar"); +Object.defineProperty(exports, "bar", { enumerable: true, get: function () { return bar_1.default; } }); + +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});","signature":"16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3109 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/bundling.ts +*refresh* /home/src/workspaces/project/global.d.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/bundling.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/home/src/workspaces/project/bar.ts] *modified* +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'obj/tsconfig.tsbuildinfo' is older than input 'bar.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/obj/bar.d.ts] *modified* +declare const _default: () => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + +//// [/home/src/workspaces/project/obj/index.d.ts] *modified* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3070 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [1]:: incremental-declaration-changes +//// [/home/src/workspaces/project/bar.ts] *modified* +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'obj/tsconfig.tsbuildinfo' is older than input 'bar.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/obj/bar.d.ts] *modified* +declare const _default: (param: string) => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar(param) { +}); + +//// [/home/src/workspaces/project/obj/index.d.ts] *modified* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<(param: string) => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});","signature":"16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3109 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts diff --git a/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js new file mode 100644 index 0000000000..d6c921c3f2 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js @@ -0,0 +1,625 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/bar.ts] *new* +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] *new* +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] *new* +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} +//// [/home/src/workspaces/project/index.ts] *new* +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] *new* +export { default as bar } from './bar'; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true, + "isolatedModules": false, + }, +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'obj/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/obj/bar.d.ts] *new* +declare const _default: (param: string) => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar(param) { +}); + +//// [/home/src/workspaces/project/obj/bundling.d.ts] *new* +export declare class LazyModule { + private importCallback; + constructor(importCallback: () => Promise); +} +export declare class LazyAction any, TModule> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction); +} + +//// [/home/src/workspaces/project/obj/bundling.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LazyAction = exports.LazyModule = void 0; +class LazyModule { + importCallback; + constructor(importCallback) { + this.importCallback = importCallback; + } +} +exports.LazyModule = LazyModule; +class LazyAction { + constructor(_lazyModule, _getter) { + } +} +exports.LazyAction = LazyAction; + +//// [/home/src/workspaces/project/obj/index.d.ts] *new* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<(param: string) => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lazyBar = void 0; +const bundling_1 = require("./bundling"); +const lazyModule = new bundling_1.LazyModule(() => Promise.resolve().then(() => require('./lazyIndex'))); +exports.lazyBar = new bundling_1.LazyAction(lazyModule, m => m.bar); + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *new* +export { default as bar } from './bar'; + +//// [/home/src/workspaces/project/obj/lazyIndex.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bar = void 0; +const bar_1 = require("./bar"); +Object.defineProperty(exports, "bar", { enumerable: true, get: function () { return bar_1.default; } }); + +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});","signature":"16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3109 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/bundling.ts +*refresh* /home/src/workspaces/project/global.d.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/bundling.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/home/src/workspaces/project/bar.ts] *modified* +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'obj/tsconfig.tsbuildinfo' is older than input 'bar.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/obj/bar.d.ts] *modified* +declare const _default: () => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + +//// [/home/src/workspaces/project/obj/index.d.ts] *modified* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/lazyIndex.js] *rewrite with same content* +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3070 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/bar.ts +(computed .d.ts) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [1]:: incremental-declaration-changes +//// [/home/src/workspaces/project/bar.ts] *modified* +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'obj/tsconfig.tsbuildinfo' is older than input 'bar.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/obj/bar.d.ts] *modified* +declare const _default: (param: string) => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar(param) { +}); + +//// [/home/src/workspaces/project/obj/index.d.ts] *modified* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<(param: string) => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/lazyIndex.js] *rewrite with same content* +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});","signature":"16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7c5cf52aadc65791601164da964e3110-export { default as bar } from './bar';", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3109 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/bar.ts +(computed .d.ts) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts diff --git a/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js new file mode 100644 index 0000000000..bf8bfe4284 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -0,0 +1,998 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/bar.ts] *new* +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] *new* +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] *new* +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} +//// [/home/src/workspaces/project/index.ts] *new* +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] *new* +export { default as bar } from './bar';import { default as bar } from './bar'; +bar("hello"); +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true, + "isolatedModules": true, + }, +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'obj/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/obj/bar.d.ts] *new* +declare const _default: (param: string) => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar(param) { +}); + +//// [/home/src/workspaces/project/obj/bundling.d.ts] *new* +export declare class LazyModule { + private importCallback; + constructor(importCallback: () => Promise); +} +export declare class LazyAction any, TModule> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction); +} + +//// [/home/src/workspaces/project/obj/bundling.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LazyAction = exports.LazyModule = void 0; +class LazyModule { + importCallback; + constructor(importCallback) { + this.importCallback = importCallback; + } +} +exports.LazyModule = LazyModule; +class LazyAction { + constructor(_lazyModule, _getter) { + } +} +exports.LazyAction = LazyAction; + +//// [/home/src/workspaces/project/obj/index.d.ts] *new* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<(param: string) => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lazyBar = void 0; +const bundling_1 = require("./bundling"); +const lazyModule = new bundling_1.LazyModule(() => Promise.resolve().then(() => require('./lazyIndex'))); +exports.lazyBar = new bundling_1.LazyAction(lazyModule, m => m.bar); + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *new* +export { default as bar } from './bar'; + +//// [/home/src/workspaces/project/obj/lazyIndex.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bar = void 0; +const bar_1 = require("./bar"); +Object.defineProperty(exports, "bar", { enumerable: true, get: function () { return bar_1.default; } }); +const bar_2 = require("./bar"); +(0, bar_2.default)("hello"); + +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});","signature":"16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3165 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/bundling.ts +*refresh* /home/src/workspaces/project/global.d.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/bundling.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/home/src/workspaces/project/bar.ts] *modified* +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'obj/tsconfig.tsbuildinfo' is older than input 'bar.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +lazyIndex.ts:2:5 - error TS2554: Expected 0 arguments, but got 1. + +2 bar("hello"); +   ~~~~~~~ + + +Found 1 error in lazyIndex.ts:2 + +//// [/home/src/workspaces/project/obj/bar.d.ts] *modified* +declare const _default: () => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + +//// [/home/src/workspaces/project/obj/index.d.ts] *modified* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[[5,[{"pos":83,"end":90,"code":2554,"category":1,"message":"Expected 0 arguments, but got 1."}]]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../lazyIndex.ts", + [ + { + "pos": 83, + "end": 90, + "code": 2554, + "category": 1, + "message": "Expected 0 arguments, but got 1." + } + ] + ] + ], + "size": 3253 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [1]:: incremental-declaration-changes +//// [/home/src/workspaces/project/bar.ts] *modified* +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'obj/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/obj/bar.d.ts] *modified* +declare const _default: (param: string) => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar(param) { +}); + +//// [/home/src/workspaces/project/obj/index.d.ts] *modified* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<(param: string) => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});","signature":"16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76a83326d4e197789f8362e994577f53-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(param: string): void {\n});", + "signature": "16f73d7e0c200fed165b8fa7d55fefbf-declare const _default: (param: string) => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "421664a6306d66498ea4a2e3065214b1-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3165 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [2]:: incremental-declaration-changes +//// [/home/src/workspaces/project/bar.ts] *modified* +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'obj/tsconfig.tsbuildinfo' is older than input 'bar.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +lazyIndex.ts:2:5 - error TS2554: Expected 0 arguments, but got 1. + +2 bar("hello"); +   ~~~~~~~ + + +Found 1 error in lazyIndex.ts:2 + +//// [/home/src/workspaces/project/obj/bar.d.ts] *modified* +declare const _default: () => void; +export default _default; + +//// [/home/src/workspaces/project/obj/bar.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + +//// [/home/src/workspaces/project/obj/index.d.ts] *modified* +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[[5,[{"pos":83,"end":90,"code":2554,"category":1,"message":"Expected 0 arguments, but got 1."}]]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "60603312318c6195044a5691dcb10507-export { default as bar } from './bar';import { default as bar } from './bar';\nbar(\"hello\");", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../lazyIndex.ts", + [ + { + "pos": 83, + "end": 90, + "code": 2554, + "category": 1, + "message": "Expected 0 arguments, but got 1." + } + ] + ] + ], + "size": 3253 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/bar.ts +*refresh* /home/src/workspaces/project/lazyIndex.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/bar.ts +(stored at emit) /home/src/workspaces/project/lazyIndex.ts +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [3]:: Fix Error +//// [/home/src/workspaces/project/lazyIndex.ts] *modified* +export { default as bar } from './bar';import { default as bar } from './bar'; +bar(); + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'obj/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/obj/lazyIndex.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/obj/lazyIndex.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bar = void 0; +const bar_1 = require("./bar"); +Object.defineProperty(exports, "bar", { enumerable: true, get: function () { return bar_1.default; } }); +const bar_2 = require("./bar"); +(0, bar_2.default)(); + +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyIndex.ts","../index.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":"0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});","signature":"6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n","impliedNodeFormat":1},{"version":"16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}","signature":"5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n","impliedNodeFormat":1},{"version":"9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d72f752a863fc77fab29beff184a4fb0-export { default as bar } from './bar';import { default as bar } from './bar';\nbar();","signature":"3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n","impliedNodeFormat":1},{"version":"d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n","impliedNodeFormat":1}],"fileIdsList":[[3,5],[2]],"options":{"declaration":true,"outDir":"./","target":1},"referencedMap":[[6,1],[5,2]]} +//// [/home/src/workspaces/project/obj/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.ts" + ], + "original": [ + 2, + 6 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../lazyIndex.ts", + "../index.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": "../bar.ts", + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0bd8823a281968531aa051fd0166b47a-interface RawAction {\n (...args: any[]): Promise | void;\n}\ninterface ActionFactory {\n (target: T): T;\n}\ndeclare function foo(): ActionFactory;\nexport default foo()(function foobar(): void {\n});", + "signature": "6cd64ed70c0d0d178b062e1470eb929d-declare const _default: () => void;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../bundling.ts", + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "16bf1b870d8b21533eda3b1f1b87cd77-export class LazyModule {\n constructor(private importCallback: () => Promise) {}\n}\n\nexport class LazyAction<\n TAction extends (...args: any[]) => any,\n TModule\n> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\n }\n}", + "signature": "5e4757586f6f5d494b6763f1e808313a-export declare class LazyModule {\n private importCallback;\n constructor(importCallback: () => Promise);\n}\nexport declare class LazyAction any, TModule> {\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../global.d.ts", + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "signature": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c9274fd70d574f2b4b68a2891bd4c47-interface PromiseConstructor {\n new (): Promise;\n}\ndeclare var Promise: PromiseConstructor;\ninterface Promise {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../lazyIndex.ts", + "version": "d72f752a863fc77fab29beff184a4fb0-export { default as bar } from './bar';import { default as bar } from './bar';\nbar();", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d72f752a863fc77fab29beff184a4fb0-export { default as bar } from './bar';import { default as bar } from './bar';\nbar();", + "signature": "3a848e147ba2aebbd888c3c7bbab715b-export { default as bar } from './bar';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d552d2a19fa05b15aa33018233d09810-import { LazyAction, LazyModule } from './bundling';\nconst lazyModule = new LazyModule(() =>\n import('./lazyIndex')\n);\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "58c7056d7920602a0f958afefa15677d-import { LazyAction } from './bundling';\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../bundling.ts", + "../lazyIndex.ts" + ], + [ + "../bar.ts" + ] + ], + "options": { + "declaration": true, + "outDir": "./", + "target": 1 + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyIndex.ts" + ], + "../lazyIndex.ts": [ + "../bar.ts" + ] + }, + "size": 3117 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/lazyIndex.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/lazyIndex.ts diff --git a/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js new file mode 100644 index 0000000000..4d14d0d880 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js @@ -0,0 +1,447 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.d.ts] *new* +/// +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 { + readonly species: symbol; + (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/common/nominal.js] *new* +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +module.exports = {}; +//// [/home/src/workspaces/solution/common/tsconfig.json] *new* +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + }, + "include": ["nominal.js"], +} +//// [/home/src/workspaces/solution/sub-project-2/index.js] *new* +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] *new* +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../sub-project" }, + ], + "include": ["./index.js"], +} +//// [/home/src/workspaces/solution/sub-project/index.js] *new* +import { Nominal } from '../common/nominal'; + +/** + * @typedef {Nominal} MyNominal + */ +//// [/home/src/workspaces/solution/sub-project/tsconfig.json] *new* +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../common" }, + ], + "include": ["./index.js"], +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "../lib", + "allowJs": true, + "checkJs": true, + "declaration": true, + }, +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" }, + ], + "include": [], +} + +tsgo --b +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +common/nominal.js:5:1 - error TS2309: An export assignment cannot be used in a module with other exported elements. + +5 module.exports = {}; +  ~~~~~~~~~~~~~~~~~~~ + +sub-project/index.js:1:10 - error TS2305: Module '"../../lib/common/nominal"' has no exported member 'Nominal'. + +1 import { Nominal } from '../common/nominal'; +   ~~~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 common/nominal.js:5 + 1 sub-project/index.js:1 + +//// [/home/src/workspaces/lib/common/nominal.d.ts] *new* +export type Nominal = T & { + [Symbol.species]: Name; +}; +declare const _default: {}; +export = _default; + +//// [/home/src/workspaces/lib/common/nominal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +export = {}; +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +module.exports = {}; + +//// [/home/src/workspaces/lib/common/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../../solution/common/nominal.js"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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":"a19075dfba5b2d593b761ed8d8cd526f-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};","signature":"de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n","impliedNodeFormat":1}],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"semanticDiagnosticsPerFile":[[2,[{"pos":80,"end":99,"code":2309,"category":1,"message":"An export assignment cannot be used in a module with other exported elements."}]]],"latestChangedDtsFile":"./nominal.d.ts"} +//// [/home/src/workspaces/lib/common/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../solution/common/nominal.js" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../../solution/common/nominal.js" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "../../solution/common/nominal.js", + "version": "a19075dfba5b2d593b761ed8d8cd526f-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};", + "signature": "de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "a19075dfba5b2d593b761ed8d8cd526f-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};", + "signature": "de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "allowJs": true, + "checkJs": true, + "composite": true, + "declaration": true, + "outDir": "..", + "rootDir": "../../solution", + "skipLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "../../solution/common/nominal.js", + [ + { + "pos": 80, + "end": 99, + "code": 2309, + "category": 1, + "message": "An export assignment cannot be used in a module with other exported elements." + } + ] + ] + ], + "latestChangedDtsFile": "./nominal.d.ts", + "size": 1606 +} +//// [/home/src/workspaces/lib/sub-project-2/index.d.ts] *new* +declare const variable: { + key: Nominal; +}; +/** + * @return {keyof typeof variable} + */ +export declare function getVar(): keyof typeof variable; +export {}; + +//// [/home/src/workspaces/lib/sub-project-2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getVar = getVar; +const index_1 = require("../sub-project/index"); +const variable = { + key: 'value', +}; +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} + +//// [/home/src/workspaces/lib/sub-project-2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../solution/sub-project-2/index.js"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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},"de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n","225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n",{"version":"db2a90e082fd17d65127bda69975a727-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}","signature":"f2cd6630b2dfa04d1fc92179f15d1647-declare const variable: {\n key: Nominal;\n};\n/**\n * @return {keyof typeof variable}\n */\nexport declare function getVar(): keyof typeof variable;\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1],[4,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/lib/sub-project-2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../solution/sub-project-2/index.js" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../common/nominal.d.ts", + "../sub-project/index.d.ts", + "../../solution/sub-project-2/index.js" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "../common/nominal.d.ts", + "version": "de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n", + "signature": "de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../sub-project/index.d.ts", + "version": "225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n", + "signature": "225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../solution/sub-project-2/index.js", + "version": "db2a90e082fd17d65127bda69975a727-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}", + "signature": "f2cd6630b2dfa04d1fc92179f15d1647-declare const variable: {\n key: Nominal;\n};\n/**\n * @return {keyof typeof variable}\n */\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "db2a90e082fd17d65127bda69975a727-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}", + "signature": "f2cd6630b2dfa04d1fc92179f15d1647-declare const variable: {\n key: Nominal;\n};\n/**\n * @return {keyof typeof variable}\n */\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../common/nominal.d.ts" + ], + [ + "../sub-project/index.d.ts" + ] + ], + "options": { + "allowJs": true, + "checkJs": true, + "composite": true, + "declaration": true, + "outDir": "..", + "rootDir": "../../solution", + "skipLibCheck": true + }, + "referencedMap": { + "../sub-project/index.d.ts": [ + "../common/nominal.d.ts" + ], + "../../solution/sub-project-2/index.js": [ + "../sub-project/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2085 +} +//// [/home/src/workspaces/lib/sub-project/index.d.ts] *new* +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; +/** + * @typedef {Nominal} MyNominal + */ + +//// [/home/src/workspaces/lib/sub-project/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const nominal_1 = require("../common/nominal"); +/** + * @typedef {Nominal} MyNominal + */ + +//// [/home/src/workspaces/lib/sub-project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../common/nominal.d.ts","../../solution/sub-project/index.js"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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},"de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n",{"version":"00b7836eaf1e026f7764b7be6efcc8f5-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */","signature":"225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":9,"end":16,"code":2305,"category":1,"message":"Module '\"../../lib/common/nominal\"' has no exported member 'Nominal'."}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/lib/sub-project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../solution/sub-project/index.js" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../common/nominal.d.ts", + "../../solution/sub-project/index.js" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "../common/nominal.d.ts", + "version": "de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n", + "signature": "de751e2539eb6f12413f7067ad0a0ef5-export type Nominal = T & {\n [Symbol.species]: Name;\n};\ndeclare const _default: {};\nexport = _default;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../solution/sub-project/index.js", + "version": "00b7836eaf1e026f7764b7be6efcc8f5-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */", + "signature": "225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "00b7836eaf1e026f7764b7be6efcc8f5-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */", + "signature": "225285a996cc5c4120877a377890d79e-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n/**\n * @typedef {Nominal} MyNominal\n */ \n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../common/nominal.d.ts" + ] + ], + "options": { + "allowJs": true, + "checkJs": true, + "composite": true, + "declaration": true, + "outDir": "..", + "rootDir": "../../solution", + "skipLibCheck": true + }, + "referencedMap": { + "../../solution/sub-project/index.js": [ + "../common/nominal.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../../solution/sub-project/index.js", + [ + { + "pos": 9, + "end": 16, + "code": 2305, + "category": 1, + "message": "Module '\"../../lib/common/nominal\"' has no exported member 'Nominal'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1877 +} + +common/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/common/nominal.js +Signatures:: +(stored at emit) /home/src/workspaces/solution/common/nominal.js + +sub-project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/lib/common/nominal.d.ts +*refresh* /home/src/workspaces/solution/sub-project/index.js +Signatures:: +(stored at emit) /home/src/workspaces/solution/sub-project/index.js + +sub-project-2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/lib/common/nominal.d.ts +*refresh* /home/src/workspaces/lib/sub-project/index.d.ts +*refresh* /home/src/workspaces/solution/sub-project-2/index.js +Signatures:: +(stored at emit) /home/src/workspaces/solution/sub-project-2/index.js diff --git a/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js new file mode 100644 index 0000000000..f3ec772bf0 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js @@ -0,0 +1,412 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/common/index.ts] *new* +import x = require("./obj.json"); +export = x; +//// [/home/src/workspaces/solution/common/obj.json] *new* +{ + "val": 42, +} +//// [/home/src/workspaces/solution/common/tsconfig.json] *new* +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": null, + "composite": true, + }, + "include": ["index.ts", "obj.json"], +} +//// [/home/src/workspaces/solution/sub-project-2/index.js] *new* +import { m } from '../sub-project/index'; + +const variable = { + key: m, +}; + +export function getVar() { + return variable; +} +//// [/home/src/workspaces/solution/sub-project-2/tsconfig.json] *new* +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../sub-project" }, + ], + "include": ["./index.js"], +} +//// [/home/src/workspaces/solution/sub-project/index.js] *new* +import mod from '../common'; + +export const m = mod; +//// [/home/src/workspaces/solution/sub-project/tsconfig.json] *new* +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../common" }, + ], + "include": ["./index.js"], +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "../out", + "allowJs": true, + "checkJs": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "declaration": true, + }, +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" }, + ], + "include": [], +} + +tsgo -b +ExitStatus:: Success +Output:: +//// [/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/out/sub-project-2/index.d.ts] *new* +export declare function getVar(): { + key: { + val: number; + }; +}; + +//// [/home/src/workspaces/out/sub-project-2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getVar = getVar; +const index_1 = require("../sub-project/index"); +const variable = { + key: index_1.m, +}; +function getVar() { + return variable; +} + +//// [/home/src/workspaces/out/sub-project-2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../sub-project/index.d.ts","../../solution/sub-project-2/index.js"],"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},"b13b16e08eb0717669fa55818828b2cb-export declare const m: {\n val: number;\n};\n",{"version":"56ecb5738c72a131a1514873df723721-import { m } from '../sub-project/index';\n\nconst variable = {\n key: m,\n};\n\nexport function getVar() {\n return variable;\n}","signature":"f6a0b1edad82fddabb5c98ad5da1660d-export declare function getVar(): {\n key: {\n val: number;\n };\n};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/out/sub-project-2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../solution/sub-project-2/index.js" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../sub-project/index.d.ts", + "../../solution/sub-project-2/index.js" + ], + "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": "../sub-project/index.d.ts", + "version": "b13b16e08eb0717669fa55818828b2cb-export declare const m: {\n val: number;\n};\n", + "signature": "b13b16e08eb0717669fa55818828b2cb-export declare const m: {\n val: number;\n};\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../solution/sub-project-2/index.js", + "version": "56ecb5738c72a131a1514873df723721-import { m } from '../sub-project/index';\n\nconst variable = {\n key: m,\n};\n\nexport function getVar() {\n return variable;\n}", + "signature": "f6a0b1edad82fddabb5c98ad5da1660d-export declare function getVar(): {\n key: {\n val: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "56ecb5738c72a131a1514873df723721-import { m } from '../sub-project/index';\n\nconst variable = {\n key: m,\n};\n\nexport function getVar() {\n return variable;\n}", + "signature": "f6a0b1edad82fddabb5c98ad5da1660d-export declare function getVar(): {\n key: {\n val: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../sub-project/index.d.ts" + ] + ], + "options": { + "allowJs": true, + "checkJs": true, + "composite": true, + "declaration": true, + "esModuleInterop": true, + "outDir": "..", + "rootDir": "../../solution", + "skipLibCheck": true + }, + "referencedMap": { + "../../solution/sub-project-2/index.js": [ + "../sub-project/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1580 +} +//// [/home/src/workspaces/out/sub-project/index.d.ts] *new* +export declare const m: { + val: number; +}; + +//// [/home/src/workspaces/out/sub-project/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const common_1 = __importDefault(require("../common")); +exports.m = common_1.default; + +//// [/home/src/workspaces/out/sub-project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../../solution/common/obj.json","../../solution/common/index.d.ts","../../solution/sub-project/index.js"],"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":"d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}"},"641f5162aeaa035322008b19df89c663-import x = require(\"./obj.json\");\nexport = x;\n",{"version":"4c69d0c670e9dc788b5e107f277aa8ab-import mod from '../common';\n\nexport const m = mod;","signature":"b13b16e08eb0717669fa55818828b2cb-export declare const m: {\n val: number;\n};\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"..","rootDir":"../../solution","skipLibCheck":true},"referencedMap":[[3,1],[4,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/out/sub-project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../solution/sub-project/index.js" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../../solution/common/obj.json", + "../../solution/common/index.d.ts", + "../../solution/sub-project/index.js" + ], + "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": "../../solution/common/obj.json", + "version": "d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}", + "signature": "d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}", + "impliedNodeFormat": "None", + "original": { + "version": "d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}" + } + }, + { + "fileName": "../../solution/common/index.d.ts", + "version": "641f5162aeaa035322008b19df89c663-import x = require(\"./obj.json\");\nexport = x;\n", + "signature": "641f5162aeaa035322008b19df89c663-import x = require(\"./obj.json\");\nexport = x;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../solution/sub-project/index.js", + "version": "4c69d0c670e9dc788b5e107f277aa8ab-import mod from '../common';\n\nexport const m = mod;", + "signature": "b13b16e08eb0717669fa55818828b2cb-export declare const m: {\n val: number;\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4c69d0c670e9dc788b5e107f277aa8ab-import mod from '../common';\n\nexport const m = mod;", + "signature": "b13b16e08eb0717669fa55818828b2cb-export declare const m: {\n val: number;\n};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../solution/common/obj.json" + ], + [ + "../../solution/common/index.d.ts" + ] + ], + "options": { + "allowJs": true, + "checkJs": true, + "composite": true, + "declaration": true, + "esModuleInterop": true, + "outDir": "..", + "rootDir": "../../solution", + "skipLibCheck": true + }, + "referencedMap": { + "../../solution/common/index.d.ts": [ + "../../solution/common/obj.json" + ], + "../../solution/sub-project/index.js": [ + "../../solution/common/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1583 +} +//// [/home/src/workspaces/solution/common/index.d.ts] *new* +import x = require("./obj.json"); +export = x; + +//// [/home/src/workspaces/solution/common/index.js] *new* +"use strict"; +const x = require("./obj.json"); +module.exports = x; + +//// [/home/src/workspaces/solution/common/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./obj.json","./index.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":"d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}"},{"version":"6d5621da1dbc82712844ae5e706b9295-import x = require(\"./obj.json\");\nexport = x;","signature":"641f5162aeaa035322008b19df89c663-import x = require(\"./obj.json\");\nexport = x;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowJs":true,"checkJs":true,"composite":true,"declaration":true,"esModuleInterop":true,"rootDir":"..","skipLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/common/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./obj.json", + "./index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./obj.json", + "./index.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": "./obj.json", + "version": "d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}", + "signature": "d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}", + "impliedNodeFormat": "None", + "original": { + "version": "d47747c9a3b20f363d6de91e2bd8ed62-{\n \"val\": 42,\n}" + } + }, + { + "fileName": "./index.ts", + "version": "6d5621da1dbc82712844ae5e706b9295-import x = require(\"./obj.json\");\nexport = x;", + "signature": "641f5162aeaa035322008b19df89c663-import x = require(\"./obj.json\");\nexport = x;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6d5621da1dbc82712844ae5e706b9295-import x = require(\"./obj.json\");\nexport = x;", + "signature": "641f5162aeaa035322008b19df89c663-import x = require(\"./obj.json\");\nexport = x;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./obj.json" + ] + ], + "options": { + "allowJs": true, + "checkJs": true, + "composite": true, + "declaration": true, + "esModuleInterop": true, + "rootDir": "..", + "skipLibCheck": true + }, + "referencedMap": { + "./index.ts": [ + "./obj.json" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1381 +} + +common/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/common/obj.json +*refresh* /home/src/workspaces/solution/common/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/common/index.ts + +sub-project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/common/obj.json +*refresh* /home/src/workspaces/solution/common/index.d.ts +*refresh* /home/src/workspaces/solution/sub-project/index.js +Signatures:: +(stored at emit) /home/src/workspaces/solution/sub-project/index.js + +sub-project-2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/out/sub-project/index.d.ts +*refresh* /home/src/workspaces/solution/sub-project-2/index.js +Signatures:: +(stored at emit) /home/src/workspaces/solution/sub-project-2/index.js diff --git a/testdata/baselines/reference/tsbuild/lateBoundSymbol/interface-is-merged-and-contains-late-bound-member.js b/testdata/baselines/reference/tsbuild/lateBoundSymbol/interface-is-merged-and-contains-late-bound-member.js new file mode 100644 index 0000000000..7ae50ab8ed --- /dev/null +++ b/testdata/baselines/reference/tsbuild/lateBoundSymbol/interface-is-merged-and-contains-late-bound-member.js @@ -0,0 +1,397 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/globals.d.ts] *new* +interface SymbolConstructor { + (description?: string | number): symbol; +} +declare var Symbol: SymbolConstructor; +//// [/home/src/workspaces/project/src/hkt.ts] *new* +export interface HKT { } +//// [/home/src/workspaces/project/src/main.ts] *new* +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] *new* +{ + "compilerOptions": { + "rootDir": "src", + "incremental": true, + }, +} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/src/hkt.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sym = Symbol(); +const x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/globals.d.ts","./src/hkt.ts","./src/main.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":"800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;","affectsGlobalScope":true,"impliedNodeFormat":1},"25b260df8f8588de5a4313af5c0708b6-export interface HKT { }","13c368d0fdd135ce10c5200ffd5a0664-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\nconst x = 10;\ntype A = HKT[typeof sym];"],"fileIdsList":[[3]],"options":{"rootDir":"./src"},"referencedMap":[[4,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.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": "./src/globals.d.ts", + "version": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "signature": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/hkt.ts", + "version": "25b260df8f8588de5a4313af5c0708b6-export interface HKT { }", + "signature": "25b260df8f8588de5a4313af5c0708b6-export interface HKT { }", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/main.ts", + "version": "13c368d0fdd135ce10c5200ffd5a0664-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\nconst x = 10;\ntype A = HKT[typeof sym];", + "signature": "13c368d0fdd135ce10c5200ffd5a0664-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\nconst x = 10;\ntype A = HKT[typeof sym];", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "./src/hkt.ts" + ] + ], + "options": { + "rootDir": "./src" + }, + "referencedMap": { + "./src/main.ts": [ + "./src/hkt.ts" + ] + }, + "size": 1484 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/globals.d.ts +*refresh* /home/src/workspaces/project/src/hkt.ts +*refresh* /home/src/workspaces/project/src/main.ts +Signatures:: + + +Edit [0]:: incremental-declaration-doesnt-change +//// [/home/src/workspaces/project/src/main.ts] *modified* +import { HKT } from "./hkt"; + +const sym = Symbol(); + +declare module "./hkt" { + interface HKT { + [sym]: { a: T } + } +} + +type A = HKT[typeof sym]; + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/main.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sym = Symbol(); + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/globals.d.ts","./src/hkt.ts","./src/main.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":"800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;","affectsGlobalScope":true,"impliedNodeFormat":1},"25b260df8f8588de5a4313af5c0708b6-export interface HKT { }",{"version":"5e9e1d9d8d08565504f44a7f2722c67d-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\n\ntype A = HKT[typeof sym];","signature":"2dcfbe0902e223e03ed6acd6292c35ce-declare const sym: unique symbol;\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: {\n a: T;\n };\n }\n}\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"rootDir":"./src"},"referencedMap":[[4,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.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": "./src/globals.d.ts", + "version": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "signature": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/hkt.ts", + "version": "25b260df8f8588de5a4313af5c0708b6-export interface HKT { }", + "signature": "25b260df8f8588de5a4313af5c0708b6-export interface HKT { }", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/main.ts", + "version": "5e9e1d9d8d08565504f44a7f2722c67d-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\n\ntype A = HKT[typeof sym];", + "signature": "2dcfbe0902e223e03ed6acd6292c35ce-declare const sym: unique symbol;\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: {\n a: T;\n };\n }\n}\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5e9e1d9d8d08565504f44a7f2722c67d-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\n\ntype A = HKT[typeof sym];", + "signature": "2dcfbe0902e223e03ed6acd6292c35ce-declare const sym: unique symbol;\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: {\n a: T;\n };\n }\n}\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/hkt.ts" + ] + ], + "options": { + "rootDir": "./src" + }, + "referencedMap": { + "./src/main.ts": [ + "./src/hkt.ts" + ] + }, + "size": 1711 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/main.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/main.ts + + +Edit [1]:: incremental-declaration-doesnt-change +//// [/home/src/workspaces/project/src/main.ts] *modified* +import { HKT } from "./hkt"; + +const sym = Symbol(); + +declare module "./hkt" { + interface HKT { + [sym]: { a: T } + } +} + +type A = HKT[typeof sym];const x = 10; + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/main.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sym = Symbol(); +const x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/globals.d.ts","./src/hkt.ts","./src/main.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":"800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;","affectsGlobalScope":true,"impliedNodeFormat":1},"25b260df8f8588de5a4313af5c0708b6-export interface HKT { }",{"version":"1fd9f291f4caa2615b285320a7f52aa7-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\n\ntype A = HKT[typeof sym];const x = 10;","signature":"2dcfbe0902e223e03ed6acd6292c35ce-declare const sym: unique symbol;\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: {\n a: T;\n };\n }\n}\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"rootDir":"./src"},"referencedMap":[[4,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.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": "./src/globals.d.ts", + "version": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "signature": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "800d0d5c54984ef4a563773d1a81e0d2-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/hkt.ts", + "version": "25b260df8f8588de5a4313af5c0708b6-export interface HKT { }", + "signature": "25b260df8f8588de5a4313af5c0708b6-export interface HKT { }", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/main.ts", + "version": "1fd9f291f4caa2615b285320a7f52aa7-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\n\ntype A = HKT[typeof sym];const x = 10;", + "signature": "2dcfbe0902e223e03ed6acd6292c35ce-declare const sym: unique symbol;\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: {\n a: T;\n };\n }\n}\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fd9f291f4caa2615b285320a7f52aa7-import { HKT } from \"./hkt\";\n\nconst sym = Symbol();\n\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: { a: T }\n }\n}\n\ntype A = HKT[typeof sym];const x = 10;", + "signature": "2dcfbe0902e223e03ed6acd6292c35ce-declare const sym: unique symbol;\ndeclare module \"./hkt\" {\n interface HKT {\n [sym]: {\n a: T;\n };\n }\n}\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/hkt.ts" + ] + ], + "options": { + "rootDir": "./src" + }, + "referencedMap": { + "./src/main.ts": [ + "./src/hkt.ts" + ] + }, + "size": 1724 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/main.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/main.ts diff --git a/testdata/baselines/reference/tsbuild/libraryResolution/with-config-with-libReplacement.js b/testdata/baselines/reference/tsbuild/libraryResolution/with-config-with-libReplacement.js new file mode 100644 index 0000000000..d29afda959 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/libraryResolution/with-config-with-libReplacement.js @@ -0,0 +1,926 @@ +currentDirectory::/home/src/workspace/projects +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.dom.d.ts] *new* +interface DOMInterface { } +//// [/home/src/tslibs/TS/Lib/lib.scripthost.d.ts] *new* +interface ScriptHostInterface { } +//// [/home/src/tslibs/TS/Lib/lib.webworker.d.ts] *new* +interface WebWorkerInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts] *new* +interface DOMInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts] *new* +/// +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/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts] *new* +/// +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/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts] *new* +interface ScriptHostInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts] *new* +interface WebWorkerInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/unlreated/index.d.ts] *new* +export const unrelated = 10; +//// [/home/src/workspace/projects/project1/core.d.ts] *new* +export const core = 10; +//// [/home/src/workspace/projects/project1/file.ts] *new* +export const file = 10; +//// [/home/src/workspace/projects/project1/file2.ts] *new* +/// +/// +/// +//// [/home/src/workspace/projects/project1/index.ts] *new* +export const x = "type1"; +//// [/home/src/workspace/projects/project1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "typeRoots": ["./typeroot1"], + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts] *new* +export type TheNum = "type1"; +//// [/home/src/workspace/projects/project1/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project2/index.ts] *new* +export const y = 10 +//// [/home/src/workspace/projects/project2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project2/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project3/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project3/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project3/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project4/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project4/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["esnext", "dom", "webworker"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project4/utils.d.ts] *new* +export const y = 10; + +tsgo -b project1 project2 project3 project4 --verbose --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/tsconfig.json + * project2/tsconfig.json + * project3/tsconfig.json + * project4/tsconfig.json + +[HH:MM:SS AM] Project 'project1/tsconfig.json' is out of date because output file 'project1/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/tsconfig.json'... + +======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== +Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. +File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. +======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== +======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project1/__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 '/home/src/workspace/projects/project1/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom' +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== +======== Resolving module '@typescript/lib-es5' from '/home/src/workspace/projects/project1/__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 '/home/src/workspace/projects/project1/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-es5' +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. +======== Module name '@typescript/lib-es5' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. ======== +======== Resolving module '@typescript/lib-scripthost' from '/home/src/workspace/projects/project1/__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 '/home/src/workspace/projects/project1/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-scripthost' +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts'. +======== Module name '@typescript/lib-scripthost' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts'. ======== +======== Resolving module '@typescript/lib-webworker' from '/home/src/workspace/projects/project1/__lib_node_modules_lookup_lib.webworker.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/home/src/workspace/projects/project1/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module '@typescript/lib-webworker' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-webworker' +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. +======== Module name '@typescript/lib-webworker' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. ======== +node_modules/@typescript/lib-webworker/index.d.ts + Library referenced via 'webworker' from file 'project1/file2.ts' +node_modules/@typescript/lib-scripthost/index.d.ts + Library referenced via 'scripthost' from file 'project1/file2.ts' +node_modules/@typescript/lib-es5/index.d.ts + Library referenced via 'es5' from file 'project1/file2.ts' + Library 'lib.es5.d.ts' specified in compilerOptions +node_modules/@typescript/lib-dom/index.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +project1/core.d.ts + Matched by default include pattern '**/*' +project1/file.ts + Matched by default include pattern '**/*' +project1/file2.ts + Matched by default include pattern '**/*' +project1/index.ts + Matched by default include pattern '**/*' +project1/utils.d.ts + Matched by default include pattern '**/*' +project1/typeroot1/sometype/index.d.ts + Matched by default include pattern '**/*' + Entry point for implicit type library 'sometype' +[HH:MM:SS AM] Project 'project2/tsconfig.json' is out of date because output file 'project2/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/tsconfig.json'... + +======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project2/__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 '/home/src/workspace/projects/project2/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project2/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project2/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom' +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== +======== Resolving module '@typescript/lib-es5' from '/home/src/workspace/projects/project2/__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 '/home/src/workspace/projects/project2/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project2/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project2/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-es5' +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. +======== Module name '@typescript/lib-es5' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. ======== +node_modules/@typescript/lib-es5/index.d.ts + Library 'lib.es5.d.ts' specified in compilerOptions +node_modules/@typescript/lib-dom/index.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +project2/index.ts + Matched by default include pattern '**/*' +project2/utils.d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'project3/tsconfig.json' is out of date because output file 'project3/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project3/tsconfig.json'... + +======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project3/__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 '/home/src/workspace/projects/project3/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project3/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project3/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom' +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== +======== Resolving module '@typescript/lib-es5' from '/home/src/workspace/projects/project3/__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 '/home/src/workspace/projects/project3/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project3/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project3/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-es5' +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. +======== Module name '@typescript/lib-es5' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. ======== +node_modules/@typescript/lib-es5/index.d.ts + Library 'lib.es5.d.ts' specified in compilerOptions +node_modules/@typescript/lib-dom/index.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +project3/index.ts + Matched by default include pattern '**/*' +project3/utils.d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'project4/tsconfig.json' is out of date because output file 'project4/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project4/tsconfig.json'... + +======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project4/__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 '/home/src/workspace/projects/project4/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project4/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project4/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom' +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== +======== Resolving module '@typescript/lib-esnext' from '/home/src/workspace/projects/project4/__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 '/home/src/workspace/projects/project4/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project4/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project4/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-esnext' +File '/home/src/workspace/projects/node_modules/@typescript/lib-esnext/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-esnext.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-esnext.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-esnext.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts'. +======== Module name '@typescript/lib-esnext' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts'. ======== +======== Resolving module '@typescript/lib-webworker' from '/home/src/workspace/projects/project4/__lib_node_modules_lookup_lib.webworker.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/home/src/workspace/projects/project4/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module '@typescript/lib-webworker' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/workspace/projects/project4/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project4/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-webworker' +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. +======== Module name '@typescript/lib-webworker' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. ======== +node_modules/@typescript/lib-esnext/index.d.ts + Library 'lib.esnext.d.ts' specified in compilerOptions +node_modules/@typescript/lib-dom/index.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +node_modules/@typescript/lib-webworker/index.d.ts + Library 'lib.webworker.d.ts' specified in compilerOptions +project4/index.ts + Matched by default include pattern '**/*' +project4/utils.d.ts + Matched by default include pattern '**/*' +//// [/home/src/workspace/projects/project1/file.d.ts] *new* +export declare const file = 10; + +//// [/home/src/workspace/projects/project1/file.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.file = void 0; +exports.file = 10; + +//// [/home/src/workspace/projects/project1/file2.d.ts] *new* + +//// [/home/src/workspace/projects/project1/file2.js] *new* +/// +/// +/// + +//// [/home/src/workspace/projects/project1/index.d.ts] *new* +export declare const x = "type1"; + +//// [/home/src/workspace/projects/project1/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "type1"; + +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[5,10]],"fileNames":["../node_modules/@typescript/lib-webworker/index.d.ts","../node_modules/@typescript/lib-scripthost/index.d.ts","../node_modules/@typescript/lib-es5/index.d.ts","../node_modules/@typescript/lib-dom/index.d.ts","./core.d.ts","./file.ts","./file2.ts","./index.ts","./utils.d.ts","./typeroot1/sometype/index.d.ts"],"fileInfos":[{"version":"95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},"a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;",{"version":"69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;","signature":"a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n","impliedNodeFormat":1},{"version":"76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ","signature":"99aa06d3014798d86001c324468d497f-","impliedNodeFormat":1},{"version":"aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";","signature":"e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "original": [ + 5, + 10 + ] + } + ], + "fileNames": [ + "../node_modules/@typescript/lib-webworker/index.d.ts", + "../node_modules/@typescript/lib-scripthost/index.d.ts", + "../node_modules/@typescript/lib-es5/index.d.ts", + "../node_modules/@typescript/lib-dom/index.d.ts", + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "fileInfos": [ + { + "fileName": "../node_modules/@typescript/lib-webworker/index.d.ts", + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "signature": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@typescript/lib-scripthost/index.d.ts", + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "signature": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@typescript/lib-es5/index.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": "../node_modules/@typescript/lib-dom/index.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./core.d.ts", + "version": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "signature": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./file.ts", + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./typeroot1/sometype/index.d.ts", + "version": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "signature": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2354 +} +//// [/home/src/workspace/projects/project2/index.d.ts] *new* +export declare const y = 10; + +//// [/home/src/workspace/projects/project2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = 10; + +//// [/home/src/workspace/projects/project2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[3,4]],"fileNames":["../node_modules/@typescript/lib-es5/index.d.ts","../node_modules/@typescript/lib-dom/index.d.ts","./index.ts","./utils.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"95e641b4f34db55d73f0f5008cdd30f0-export const y = 10","signature":"7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./utils.d.ts" + ], + "original": [ + 3, + 4 + ] + } + ], + "fileNames": [ + "../node_modules/@typescript/lib-es5/index.d.ts", + "../node_modules/@typescript/lib-dom/index.d.ts", + "./index.ts", + "./utils.d.ts" + ], + "fileInfos": [ + { + "fileName": "../node_modules/@typescript/lib-es5/index.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": "../node_modules/@typescript/lib-dom/index.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "95e641b4f34db55d73f0f5008cdd30f0-export const y = 10", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95e641b4f34db55d73f0f5008cdd30f0-export const y = 10", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1378 +} +//// [/home/src/workspace/projects/project3/index.d.ts] *new* +export declare const z = 10; + +//// [/home/src/workspace/projects/project3/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +exports.z = 10; + +//// [/home/src/workspace/projects/project3/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[3,4]],"fileNames":["../node_modules/@typescript/lib-es5/index.d.ts","../node_modules/@typescript/lib-dom/index.d.ts","./index.ts","./utils.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10","signature":"f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project3/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./utils.d.ts" + ], + "original": [ + 3, + 4 + ] + } + ], + "fileNames": [ + "../node_modules/@typescript/lib-es5/index.d.ts", + "../node_modules/@typescript/lib-dom/index.d.ts", + "./index.ts", + "./utils.d.ts" + ], + "fileInfos": [ + { + "fileName": "../node_modules/@typescript/lib-es5/index.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": "../node_modules/@typescript/lib-dom/index.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1378 +} +//// [/home/src/workspace/projects/project4/index.d.ts] *new* +export declare const z = 10; + +//// [/home/src/workspace/projects/project4/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +exports.z = 10; + +//// [/home/src/workspace/projects/project4/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[4,5]],"fileNames":["../node_modules/@typescript/lib-esnext/index.d.ts","../node_modules/@typescript/lib-dom/index.d.ts","../node_modules/@typescript/lib-webworker/index.d.ts","./index.ts","./utils.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10","signature":"f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project4/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./utils.d.ts" + ], + "original": [ + 4, + 5 + ] + } + ], + "fileNames": [ + "../node_modules/@typescript/lib-esnext/index.d.ts", + "../node_modules/@typescript/lib-dom/index.d.ts", + "../node_modules/@typescript/lib-webworker/index.d.ts", + "./index.ts", + "./utils.d.ts" + ], + "fileInfos": [ + { + "fileName": "../node_modules/@typescript/lib-esnext/index.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": "../node_modules/@typescript/lib-dom/index.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@typescript/lib-webworker/index.d.ts", + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "signature": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1564 +} + +project1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts +*refresh* /home/src/workspace/projects/project1/core.d.ts +*refresh* /home/src/workspace/projects/project1/file.ts +*refresh* /home/src/workspace/projects/project1/file2.ts +*refresh* /home/src/workspace/projects/project1/index.ts +*refresh* /home/src/workspace/projects/project1/utils.d.ts +*refresh* /home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project1/file.ts +(stored at emit) /home/src/workspace/projects/project1/file2.ts +(stored at emit) /home/src/workspace/projects/project1/index.ts + +project2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts +*refresh* /home/src/workspace/projects/project2/index.ts +*refresh* /home/src/workspace/projects/project2/utils.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project2/index.ts + +project3/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts +*refresh* /home/src/workspace/projects/project3/index.ts +*refresh* /home/src/workspace/projects/project3/utils.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project3/index.ts + +project4/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts +*refresh* /home/src/workspace/projects/project4/index.ts +*refresh* /home/src/workspace/projects/project4/utils.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project4/index.ts diff --git a/testdata/baselines/reference/tsbuild/libraryResolution/with-config.js b/testdata/baselines/reference/tsbuild/libraryResolution/with-config.js new file mode 100644 index 0000000000..32a0ecfdaf --- /dev/null +++ b/testdata/baselines/reference/tsbuild/libraryResolution/with-config.js @@ -0,0 +1,667 @@ +currentDirectory::/home/src/workspace/projects +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.dom.d.ts] *new* +interface DOMInterface { } +//// [/home/src/tslibs/TS/Lib/lib.scripthost.d.ts] *new* +interface ScriptHostInterface { } +//// [/home/src/tslibs/TS/Lib/lib.webworker.d.ts] *new* +interface WebWorkerInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/unlreated/index.d.ts] *new* +export const unrelated = 10; +//// [/home/src/workspace/projects/project1/core.d.ts] *new* +export const core = 10; +//// [/home/src/workspace/projects/project1/file.ts] *new* +export const file = 10; +//// [/home/src/workspace/projects/project1/file2.ts] *new* +/// +/// +/// +//// [/home/src/workspace/projects/project1/index.ts] *new* +export const x = "type1"; +//// [/home/src/workspace/projects/project1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "typeRoots": ["./typeroot1"], + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts] *new* +export type TheNum = "type1"; +//// [/home/src/workspace/projects/project1/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project2/index.ts] *new* +export const y = 10 +//// [/home/src/workspace/projects/project2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project2/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project3/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project3/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project3/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project4/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project4/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["esnext", "dom", "webworker"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project4/utils.d.ts] *new* +export const y = 10; + +tsgo -b project1 project2 project3 project4 --verbose --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/tsconfig.json + * project2/tsconfig.json + * project3/tsconfig.json + * project4/tsconfig.json + +[HH:MM:SS AM] Project 'project1/tsconfig.json' is out of date because output file 'project1/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project1/tsconfig.json'... + +======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== +Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. +File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. +======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== +../../tslibs/TS/Lib/lib.es5.d.ts + Library referenced via 'es5' from file 'project1/file2.ts' + Library 'lib.es5.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.dom.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.webworker.d.ts + Library referenced via 'webworker' from file 'project1/file2.ts' +../../tslibs/TS/Lib/lib.scripthost.d.ts + Library referenced via 'scripthost' from file 'project1/file2.ts' +project1/core.d.ts + Matched by default include pattern '**/*' +project1/file.ts + Matched by default include pattern '**/*' +project1/file2.ts + Matched by default include pattern '**/*' +project1/index.ts + Matched by default include pattern '**/*' +project1/utils.d.ts + Matched by default include pattern '**/*' +project1/typeroot1/sometype/index.d.ts + Matched by default include pattern '**/*' + Entry point for implicit type library 'sometype' +[HH:MM:SS AM] Project 'project2/tsconfig.json' is out of date because output file 'project2/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/tsconfig.json'... + +../../tslibs/TS/Lib/lib.es5.d.ts + Library 'lib.es5.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.dom.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +project2/index.ts + Matched by default include pattern '**/*' +project2/utils.d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'project3/tsconfig.json' is out of date because output file 'project3/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project3/tsconfig.json'... + +../../tslibs/TS/Lib/lib.es5.d.ts + Library 'lib.es5.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.dom.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +project3/index.ts + Matched by default include pattern '**/*' +project3/utils.d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'project4/tsconfig.json' is out of date because output file 'project4/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project4/tsconfig.json'... + +../../tslibs/TS/Lib/lib.esnext.d.ts + Library 'lib.esnext.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.dom.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.webworker.d.ts + Library 'lib.webworker.d.ts' specified in compilerOptions +project4/index.ts + Matched by default include pattern '**/*' +project4/utils.d.ts + Matched by default include pattern '**/*' +//// [/home/src/tslibs/TS/Lib/lib.es5.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/tslibs/TS/Lib/lib.esnext.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/workspace/projects/project1/file.d.ts] *new* +export declare const file = 10; + +//// [/home/src/workspace/projects/project1/file.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.file = void 0; +exports.file = 10; + +//// [/home/src/workspace/projects/project1/file2.d.ts] *new* + +//// [/home/src/workspace/projects/project1/file2.js] *new* +/// +/// +/// + +//// [/home/src/workspace/projects/project1/index.d.ts] *new* +export declare const x = "type1"; + +//// [/home/src/workspace/projects/project1/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "type1"; + +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[5,10]],"fileNames":["lib.es5.d.ts","lib.dom.d.ts","lib.webworker.d.ts","lib.scripthost.d.ts","./core.d.ts","./file.ts","./file2.ts","./index.ts","./utils.d.ts","./typeroot1/sometype/index.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},"a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;",{"version":"69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;","signature":"a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n","impliedNodeFormat":1},{"version":"76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ","signature":"99aa06d3014798d86001c324468d497f-","impliedNodeFormat":1},{"version":"aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";","signature":"e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "original": [ + 5, + 10 + ] + } + ], + "fileNames": [ + "lib.es5.d.ts", + "lib.dom.d.ts", + "lib.webworker.d.ts", + "lib.scripthost.d.ts", + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es5.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": "lib.dom.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "lib.webworker.d.ts", + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "signature": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "lib.scripthost.d.ts", + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "signature": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./core.d.ts", + "version": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "signature": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./file.ts", + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./typeroot1/sometype/index.d.ts", + "version": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "signature": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2218 +} +//// [/home/src/workspace/projects/project2/index.d.ts] *new* +export declare const y = 10; + +//// [/home/src/workspace/projects/project2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = 10; + +//// [/home/src/workspace/projects/project2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[3,4]],"fileNames":["lib.es5.d.ts","lib.dom.d.ts","./index.ts","./utils.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"95e641b4f34db55d73f0f5008cdd30f0-export const y = 10","signature":"7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./utils.d.ts" + ], + "original": [ + 3, + 4 + ] + } + ], + "fileNames": [ + "lib.es5.d.ts", + "lib.dom.d.ts", + "./index.ts", + "./utils.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es5.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": "lib.dom.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "95e641b4f34db55d73f0f5008cdd30f0-export const y = 10", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95e641b4f34db55d73f0f5008cdd30f0-export const y = 10", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1310 +} +//// [/home/src/workspace/projects/project3/index.d.ts] *new* +export declare const z = 10; + +//// [/home/src/workspace/projects/project3/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +exports.z = 10; + +//// [/home/src/workspace/projects/project3/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[3,4]],"fileNames":["lib.es5.d.ts","lib.dom.d.ts","./index.ts","./utils.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10","signature":"f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project3/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./utils.d.ts" + ], + "original": [ + 3, + 4 + ] + } + ], + "fileNames": [ + "lib.es5.d.ts", + "lib.dom.d.ts", + "./index.ts", + "./utils.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es5.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": "lib.dom.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1310 +} +//// [/home/src/workspace/projects/project4/index.d.ts] *new* +export declare const z = 10; + +//// [/home/src/workspace/projects/project4/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.z = void 0; +exports.z = 10; + +//// [/home/src/workspace/projects/project4/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[4,5]],"fileNames":["lib.esnext.d.ts","lib.dom.d.ts","lib.webworker.d.ts","./index.ts","./utils.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10","signature":"f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project4/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./utils.d.ts" + ], + "original": [ + 4, + 5 + ] + } + ], + "fileNames": [ + "lib.esnext.d.ts", + "lib.dom.d.ts", + "lib.webworker.d.ts", + "./index.ts", + "./utils.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.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": "lib.dom.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "lib.webworker.d.ts", + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "signature": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f4aaa0b206d74bd2835c8fd3a4020fe-export const z = 10", + "signature": "f4ea7cd61571728ffc44aefcffc4eda1-export declare const z = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1462 +} + +project1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es5.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.dom.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.webworker.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.scripthost.d.ts +*refresh* /home/src/workspace/projects/project1/core.d.ts +*refresh* /home/src/workspace/projects/project1/file.ts +*refresh* /home/src/workspace/projects/project1/file2.ts +*refresh* /home/src/workspace/projects/project1/index.ts +*refresh* /home/src/workspace/projects/project1/utils.d.ts +*refresh* /home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project1/file.ts +(stored at emit) /home/src/workspace/projects/project1/file2.ts +(stored at emit) /home/src/workspace/projects/project1/index.ts + +project2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es5.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.dom.d.ts +*refresh* /home/src/workspace/projects/project2/index.ts +*refresh* /home/src/workspace/projects/project2/utils.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project2/index.ts + +project3/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es5.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.dom.d.ts +*refresh* /home/src/workspace/projects/project3/index.ts +*refresh* /home/src/workspace/projects/project3/utils.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project3/index.ts + +project4/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.dom.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.webworker.d.ts +*refresh* /home/src/workspace/projects/project4/index.ts +*refresh* /home/src/workspace/projects/project4/utils.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project4/index.ts diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js b/testdata/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js new file mode 100644 index 0000000000..4c0233d595 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js @@ -0,0 +1,214 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a/src/index.ts] *new* + +//// [/home/src/workspaces/project/a/tsconfig.json] *new* +{ + "compilerOptions": { + "strict": true + } +} +//// [/home/src/workspaces/project/b/package.json] *new* +{ + "name": "b", + "type": "module" +} +//// [/home/src/workspaces/project/b/src/index.ts] *new* +import pg from "pg"; +pg.foo(); +//// [/home/src/workspaces/project/b/tsconfig.json] *new* +{ + "compilerOptions": { + "strict": true, + "module": "node16" + }, +} +//// [/home/src/workspaces/project/node_modules/@types/pg/index.d.ts] *new* +export function foo(): void; +//// [/home/src/workspaces/project/node_modules/@types/pg/package.json] *new* +{ + "name": "@types/pg", + "types": "index.d.ts" +} + +tsgo -b a b --verbose --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * a/tsconfig.json + * b/tsconfig.json + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output file 'a/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +======== Resolving type reference directive 'pg', containing file '/home/src/workspaces/project/a/__inferred type names__.ts', root directory '/home/src/workspaces/project/a/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/home/src/workspaces/project/a/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Directory '/home/src/workspaces/project/a/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/home/src/workspaces/project/node_modules/@types/pg/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. +File '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. +======== Type reference directive 'pg' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', primary: true. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +a/src/index.ts + Matched by default include pattern '**/*' +node_modules/@types/pg/index.d.ts + Entry point for implicit type library 'pg' +[HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output file 'b/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +======== Resolving module 'pg' from '/home/src/workspaces/project/b/src/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/workspaces/project/b/src/package.json' does not exist. +Found 'package.json' at '/home/src/workspaces/project/b/package.json'. +Loading module 'pg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/workspaces/project/b/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/b/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/b/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/b/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/home/src/workspaces/project/node_modules/@types/pg/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. +File '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. +======== Module name 'pg' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. ======== +======== Resolving type reference directive 'pg', containing file '/home/src/workspaces/project/b/__inferred type names__.ts', root directory '/home/src/workspaces/project/b/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== +Resolving with primary search path '/home/src/workspaces/project/b/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. +Directory '/home/src/workspaces/project/b/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/home/src/workspaces/project/node_modules/@types/pg/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. +File '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. +======== Type reference directive 'pg' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', primary: true. ======== +../../tslibs/TS/Lib/lib.es2022.full.d.ts + Default library for target 'ES2022' +node_modules/@types/pg/index.d.ts + Imported via "pg" from file 'b/src/index.ts' + Entry point for implicit type library 'pg' + File is CommonJS module because 'node_modules/@types/pg/package.json' does not have field "type" +b/src/index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'b/package.json' has field "type" with value "module" +//// [/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/tslibs/TS/Lib/lib.es2022.full.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/src/index.js] *new* + +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./src/index.ts"]} +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": "./src/index.ts" + } + ], + "size": 53 +} +//// [/home/src/workspaces/project/b/src/index.js] *new* +import pg from "pg"; +pg.foo(); + +//// [/home/src/workspaces/project/b/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./src/index.ts"]} +//// [/home/src/workspaces/project/b/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": "./src/index.ts" + } + ], + "size": 53 +} + +a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/a/src/index.ts +*refresh* /home/src/workspaces/project/node_modules/@types/pg/index.d.ts +Signatures:: + +b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /home/src/workspaces/project/node_modules/@types/pg/index.d.ts +*refresh* /home/src/workspaces/project/b/src/index.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b a b --verbose --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * a/tsconfig.json + * b/tsconfig.json + +[HH:MM:SS AM] Project 'a/tsconfig.json' is up to date because newest input 'a/src/index.ts' is older than output 'a/src/index.js' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'b/src/index.js' + + diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js b/testdata/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js new file mode 100644 index 0000000000..1fb54008e0 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js @@ -0,0 +1,252 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/node_modules/pkg2] -> /user/username/projects/myproject/packages/pkg2 *new* +//// [/user/username/projects/myproject/packages/pkg1/index.ts] *new* +import type { TheNum } from 'pkg2' +export const theNum: TheNum = 42; +//// [/user/username/projects/myproject/packages/pkg1/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "build", + "preserveSymlinks": true + }, + "references": [{ "path": "../pkg2" }] +} +//// [/user/username/projects/myproject/packages/pkg2/const.ts] *new* +export type TheNum = 42; +//// [/user/username/projects/myproject/packages/pkg2/index.ts] *new* +export type { TheNum } from 'const'; +//// [/user/username/projects/myproject/packages/pkg2/package.json] *new* +{ + "name": "pkg2", + "version": "1.0.0", + "main": "build/index.js" +} +//// [/user/username/projects/myproject/packages/pkg2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "build", + "paths": { + "const": ["./const"] + }, + "preserveSymlinks": true, + }, +} + +tsgo -b packages/pkg1 --verbose --traceResolution +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * packages/pkg2/tsconfig.json + * packages/pkg1/tsconfig.json + +[HH:MM:SS AM] Project 'packages/pkg2/tsconfig.json' is out of date because output file 'packages/pkg2/build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg2/tsconfig.json'... + +======== Resolving module 'const' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'const'. +Module name 'const', matched pattern 'const'. +Trying substitution './const', candidate module location: './const'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/user/username/projects/myproject/packages/pkg2/const.ts' exists - use it as a name resolution result. +======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== +[HH:MM:SS AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg1/tsconfig.json'... + +======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/packages/pkg1/package.json' does not exist. +File '/user/username/projects/myproject/packages/package.json' does not exist. +File '/user/username/projects/myproject/package.json' does not exist. +File '/user/username/projects/package.json' does not exist. +File '/user/username/package.json' does not exist. +File '/user/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. +File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. +File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' with Package ID 'pkg2@1.0.0'. ======== +======== Resolving module 'const' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== +Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'const'. +Module name 'const', matched pattern 'const'. +Trying substitution './const', candidate module location: './const'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/user/username/projects/myproject/packages/pkg2/const.ts' exists - use it as a name resolution result. +======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== +//// [/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; }; +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg1/build/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.theNum = void 0; +exports.theNum = 42; + +//// [/user/username/projects/myproject/packages/pkg1/build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../index.ts"]} +//// [/user/username/projects/myproject/packages/pkg1/build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../index.ts" + ], + "original": "../index.ts" + } + ], + "size": 50 +} +//// [/user/username/projects/myproject/packages/pkg2/build/const.d.ts] *new* +export type TheNum = 42; + +//// [/user/username/projects/myproject/packages/pkg2/build/const.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/packages/pkg2/build/index.d.ts] *new* +export type { TheNum } from 'const'; + +//// [/user/username/projects/myproject/packages/pkg2/build/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../const.ts","../index.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":"be0f939ab1143e4064a3742586332724-export type TheNum = 42;","signature":"56e2d69d2edd1f0edd1a64ecfdf6de0d-export type TheNum = 42;\n","impliedNodeFormat":1},{"version":"0b8e978a1e274cdc446fbbcbc9e78724-export type { TheNum } from 'const';","signature":"1a74e021c93cb748502ffc92156e3427-export type { TheNum } from 'const';\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../const.ts", + "../index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../const.ts", + "../index.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": "../const.ts", + "version": "be0f939ab1143e4064a3742586332724-export type TheNum = 42;", + "signature": "56e2d69d2edd1f0edd1a64ecfdf6de0d-export type TheNum = 42;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "be0f939ab1143e4064a3742586332724-export type TheNum = 42;", + "signature": "56e2d69d2edd1f0edd1a64ecfdf6de0d-export type TheNum = 42;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "0b8e978a1e274cdc446fbbcbc9e78724-export type { TheNum } from 'const';", + "signature": "1a74e021c93cb748502ffc92156e3427-export type { TheNum } from 'const';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0b8e978a1e274cdc446fbbcbc9e78724-export type { TheNum } from 'const';", + "signature": "1a74e021c93cb748502ffc92156e3427-export type { TheNum } from 'const';\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../const.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../index.ts": [ + "../const.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1364 +} + +packages/pkg2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/packages/pkg2/const.ts +*refresh* /user/username/projects/myproject/packages/pkg2/index.ts +Signatures:: +(stored at emit) /user/username/projects/myproject/packages/pkg2/const.ts +(stored at emit) /user/username/projects/myproject/packages/pkg2/index.ts + +packages/pkg1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/packages/pkg2/build/const.d.ts +*refresh* /user/username/projects/myproject/node_modules/pkg2/build/index.d.ts +*refresh* /user/username/projects/myproject/packages/pkg1/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js b/testdata/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js new file mode 100644 index 0000000000..99d21e5c9b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js @@ -0,0 +1,253 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/node_modules/pkg2] -> /user/username/projects/myproject/packages/pkg2 *new* +//// [/user/username/projects/myproject/packages/pkg1/index.ts] *new* +import type { TheNum } from 'pkg2' +export const theNum: TheNum = 42; +//// [/user/username/projects/myproject/packages/pkg1/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "build", + "preserveSymlinks": false + }, + "references": [{ "path": "../pkg2" }] +} +//// [/user/username/projects/myproject/packages/pkg2/const.ts] *new* +export type TheNum = 42; +//// [/user/username/projects/myproject/packages/pkg2/index.ts] *new* +export type { TheNum } from 'const'; +//// [/user/username/projects/myproject/packages/pkg2/package.json] *new* +{ + "name": "pkg2", + "version": "1.0.0", + "main": "build/index.js" +} +//// [/user/username/projects/myproject/packages/pkg2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "build", + "paths": { + "const": ["./const"] + }, + "preserveSymlinks": false, + }, +} + +tsgo -b packages/pkg1 --verbose --traceResolution +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * packages/pkg2/tsconfig.json + * packages/pkg1/tsconfig.json + +[HH:MM:SS AM] Project 'packages/pkg2/tsconfig.json' is out of date because output file 'packages/pkg2/build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg2/tsconfig.json'... + +======== Resolving module 'const' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'const'. +Module name 'const', matched pattern 'const'. +Trying substitution './const', candidate module location: './const'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/user/username/projects/myproject/packages/pkg2/const.ts' exists - use it as a name resolution result. +======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== +[HH:MM:SS AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg1/tsconfig.json'... + +======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/packages/pkg1/package.json' does not exist. +File '/user/username/projects/myproject/packages/package.json' does not exist. +File '/user/username/projects/myproject/package.json' does not exist. +File '/user/username/projects/package.json' does not exist. +File '/user/username/package.json' does not exist. +File '/user/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. +File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. +File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. +======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2@1.0.0'. ======== +======== Resolving module 'const' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== +Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name 'const'. +Module name 'const', matched pattern 'const'. +Trying substitution './const', candidate module location: './const'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, JavaScript, Declaration, JSON. +File '/user/username/projects/myproject/packages/pkg2/const.ts' exists - use it as a name resolution result. +======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== +//// [/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; }; +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg1/build/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.theNum = void 0; +exports.theNum = 42; + +//// [/user/username/projects/myproject/packages/pkg1/build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../index.ts"]} +//// [/user/username/projects/myproject/packages/pkg1/build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../index.ts" + ], + "original": "../index.ts" + } + ], + "size": 50 +} +//// [/user/username/projects/myproject/packages/pkg2/build/const.d.ts] *new* +export type TheNum = 42; + +//// [/user/username/projects/myproject/packages/pkg2/build/const.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/packages/pkg2/build/index.d.ts] *new* +export type { TheNum } from 'const'; + +//// [/user/username/projects/myproject/packages/pkg2/build/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../const.ts","../index.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":"be0f939ab1143e4064a3742586332724-export type TheNum = 42;","signature":"56e2d69d2edd1f0edd1a64ecfdf6de0d-export type TheNum = 42;\n","impliedNodeFormat":1},{"version":"0b8e978a1e274cdc446fbbcbc9e78724-export type { TheNum } from 'const';","signature":"1a74e021c93cb748502ffc92156e3427-export type { TheNum } from 'const';\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../const.ts", + "../index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../const.ts", + "../index.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": "../const.ts", + "version": "be0f939ab1143e4064a3742586332724-export type TheNum = 42;", + "signature": "56e2d69d2edd1f0edd1a64ecfdf6de0d-export type TheNum = 42;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "be0f939ab1143e4064a3742586332724-export type TheNum = 42;", + "signature": "56e2d69d2edd1f0edd1a64ecfdf6de0d-export type TheNum = 42;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../index.ts", + "version": "0b8e978a1e274cdc446fbbcbc9e78724-export type { TheNum } from 'const';", + "signature": "1a74e021c93cb748502ffc92156e3427-export type { TheNum } from 'const';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0b8e978a1e274cdc446fbbcbc9e78724-export type { TheNum } from 'const';", + "signature": "1a74e021c93cb748502ffc92156e3427-export type { TheNum } from 'const';\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../const.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../index.ts": [ + "../const.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1364 +} + +packages/pkg2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/packages/pkg2/const.ts +*refresh* /user/username/projects/myproject/packages/pkg2/index.ts +Signatures:: +(stored at emit) /user/username/projects/myproject/packages/pkg2/const.ts +(stored at emit) /user/username/projects/myproject/packages/pkg2/index.ts + +packages/pkg1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/packages/pkg2/build/const.d.ts +*refresh* /user/username/projects/myproject/packages/pkg2/build/index.d.ts +*refresh* /user/username/projects/myproject/packages/pkg1/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js b/testdata/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js new file mode 100644 index 0000000000..2ab0a5931b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleResolution/shared-resolution-should-not-report-error.js @@ -0,0 +1,263 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/node_modules/a] -> /home/src/workspaces/project/packages/a *new* +//// [/home/src/workspaces/project/packages/a/index.js] *new* +export const a = 'a'; +//// [/home/src/workspaces/project/packages/a/package.json] *new* +{ + "name": "a", + "version": "0.0.0", + "type": "module", + "exports": { + ".": { + "types": "./types/index.d.ts", + "default": "./index.js" + } + } +} +//// [/home/src/workspaces/project/packages/a/test/index.js] *new* +import 'a'; +//// [/home/src/workspaces/project/packages/a/tsconfig.json] *new* +{ + "compilerOptions": { + "checkJs": true, + "composite": true, + "declaration": true, + "emitDeclarationOnly": true, + "module": "nodenext", + "outDir": "types", + }, +} +//// [/home/src/workspaces/project/packages/b/index.js] *new* +export { a } from 'a'; +//// [/home/src/workspaces/project/packages/b/package.json] *new* +{ + "name": "b", + "version": "0.0.0", + "type": "module" +} +//// [/home/src/workspaces/project/packages/b/tsconfig.json] *new* +{ +"references": [{ "path": "../a" }], + "compilerOptions": { + "checkJs": true, + "module": "nodenext", + "noEmit": true, + "noImplicitAny": true, + }, +} + +tsgo -b packages/b --verbose --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * packages/a/tsconfig.json + * packages/b/tsconfig.json + +[HH:MM:SS AM] Project 'packages/a/tsconfig.json' is out of date because output file 'packages/a/types/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/a/tsconfig.json'... + +======== Resolving module 'a' from '/home/src/workspaces/project/packages/a/test/index.js'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/workspaces/project/packages/a/test/package.json' does not exist. +Found 'package.json' at '/home/src/workspaces/project/packages/a/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './types/index.d.ts'. +File '/home/src/workspaces/project/packages/a/types/index.d.ts' does not exist. +Failed to resolve under condition 'types'. +Matched 'exports' condition 'default'. +Using 'exports' subpath '.' with target './index.js'. +File name '/home/src/workspaces/project/packages/a/index.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/project/packages/a/index.ts' does not exist. +File '/home/src/workspaces/project/packages/a/index.tsx' does not exist. +File '/home/src/workspaces/project/packages/a/index.d.ts' does not exist. +File '/home/src/workspaces/project/packages/a/index.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'default'. +Exiting conditional exports. +======== Module name 'a' was successfully resolved to '/home/src/workspaces/project/packages/a/index.js' with Package ID 'a/index.js@0.0.0'. ======== +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +packages/a/index.js + Matched by default include pattern '**/*' + Imported via 'a' from file 'packages/a/test/index.js' with packageId 'a/index.js@0.0.0' + File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" +packages/a/test/index.js + Matched by default include pattern '**/*' + File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" +[HH:MM:SS AM] Project 'packages/b/tsconfig.json' is out of date because output file 'packages/b/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/b/tsconfig.json'... + +======== Resolving module 'a' from '/home/src/workspaces/project/packages/b/index.js'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +Found 'package.json' at '/home/src/workspaces/project/packages/b/package.json'. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/workspaces/project/packages/b/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/packages/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/packages/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/home/src/workspaces/project/node_modules/a/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './types/index.d.ts'. +File '/home/src/workspaces/project/node_modules/a/types/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/workspaces/project/node_modules/a/types/index.d.ts', result '/home/src/workspaces/project/packages/a/types/index.d.ts'. +======== Module name 'a' was successfully resolved to '/home/src/workspaces/project/packages/a/types/index.d.ts' with Package ID 'a/types/index.d.ts@0.0.0'. ======== +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +packages/a/types/index.d.ts + Imported via 'a' from file 'packages/b/index.js' with packageId 'a/types/index.d.ts@0.0.0' + File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" +packages/b/index.js + Matched by default include pattern '**/*' + File is ECMAScript module because 'packages/b/package.json' has field "type" with value "module" +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.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/node_modules/a] *deleted* +//// [/home/src/workspaces/project/packages/a/types/index.d.ts] *new* +export declare const a = "a"; + +//// [/home/src/workspaces/project/packages/a/types/test/index.d.ts] *new* +import 'a'; + +//// [/home/src/workspaces/project/packages/a/types/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.esnext.full.d.ts","../index.js","../test/index.js"],"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":"fb6f7bce1e97f6455fc2f6a3fc00ca67-export const a = 'a';","signature":"410f445844ca5e1f83239796f66520a1-export declare const a = \"a\";\n","impliedNodeFormat":99},{"version":"25c2781885c8232d7ba0f67afa33aa44-import 'a';","signature":"518d564eba22abfaf340ce3ae18a4763-import 'a';\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"checkJs":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"module":199,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./test/index.d.ts"} +//// [/home/src/workspaces/project/packages/a/types/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../index.js", + "../test/index.js" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.esnext.full.d.ts", + "../index.js", + "../test/index.js" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.full.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": "../index.js", + "version": "fb6f7bce1e97f6455fc2f6a3fc00ca67-export const a = 'a';", + "signature": "410f445844ca5e1f83239796f66520a1-export declare const a = \"a\";\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "fb6f7bce1e97f6455fc2f6a3fc00ca67-export const a = 'a';", + "signature": "410f445844ca5e1f83239796f66520a1-export declare const a = \"a\";\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "../test/index.js", + "version": "25c2781885c8232d7ba0f67afa33aa44-import 'a';", + "signature": "518d564eba22abfaf340ce3ae18a4763-import 'a';\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "25c2781885c8232d7ba0f67afa33aa44-import 'a';", + "signature": "518d564eba22abfaf340ce3ae18a4763-import 'a';\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "../index.js" + ] + ], + "options": { + "checkJs": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "module": 199, + "outDir": "./" + }, + "referencedMap": { + "../test/index.js": [ + "../index.js" + ] + }, + "latestChangedDtsFile": "./test/index.d.ts", + "size": 1416 +} +//// [/home/src/workspaces/project/packages/b/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./index.js"]} +//// [/home/src/workspaces/project/packages/b/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.js" + ], + "original": "./index.js" + } + ], + "size": 49 +} + +packages/a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/packages/a/index.js +*refresh* /home/src/workspaces/project/packages/a/test/index.js +Signatures:: +(stored at emit) /home/src/workspaces/project/packages/a/index.js +(stored at emit) /home/src/workspaces/project/packages/a/test/index.js + +packages/b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/packages/a/types/index.d.ts +*refresh* /home/src/workspaces/project/packages/b/index.js +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js b/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js new file mode 100644 index 0000000000..814527f39e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js @@ -0,0 +1,236 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/packages/pkg1.tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "typeRoots": ["./typeroot1"] + }, + "files": ["./pkg1_index.ts"], +} +//// [/home/src/workspaces/project/packages/pkg1_index.ts] *new* +export const theNum: TheNum = "type1"; +//// [/home/src/workspaces/project/packages/pkg2.tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "typeRoots": ["./typeroot2"] + }, + "files": ["./pkg2_index.ts"], +} +//// [/home/src/workspaces/project/packages/pkg2_index.ts] *new* +export const theNum: TheNum2 = "type2"; +//// [/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts] *new* +declare type TheNum = "type1"; +//// [/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts] *new* +declare type TheNum2 = "type2"; + +tsgo -b packages/pkg1.tsconfig.json packages/pkg2.tsconfig.json --verbose --traceResolution +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * packages/pkg1.tsconfig.json + * packages/pkg2.tsconfig.json + +[HH:MM:SS AM] Project 'packages/pkg1.tsconfig.json' is out of date because output file 'packages/pkg1.tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg1.tsconfig.json'... + +======== Resolving type reference directive 'sometype', containing file '/home/src/workspaces/project/packages/__inferred type names__.ts', root directory '/home/src/workspaces/project/packages/typeroot1'. ======== +Resolving with primary search path '/home/src/workspaces/project/packages/typeroot1'. +File '/home/src/workspaces/project/packages/typeroot1/sometype.d.ts' does not exist. +File '/home/src/workspaces/project/packages/typeroot1/sometype/package.json' does not exist. +File '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts', result '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts'. +======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts', primary: true. ======== +[HH:MM:SS AM] Project 'packages/pkg2.tsconfig.json' is out of date because output file 'packages/pkg2.tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/pkg2.tsconfig.json'... + +======== Resolving type reference directive 'sometype', containing file '/home/src/workspaces/project/packages/__inferred type names__.ts', root directory '/home/src/workspaces/project/packages/typeroot2'. ======== +Resolving with primary search path '/home/src/workspaces/project/packages/typeroot2'. +File '/home/src/workspaces/project/packages/typeroot2/sometype.d.ts' does not exist. +File '/home/src/workspaces/project/packages/typeroot2/sometype/package.json' does not exist. +File '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts', result '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts'. +======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts', primary: true. ======== +//// [/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/packages/pkg1.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./pkg1_index.ts","./typeroot1/sometype/index.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":"f4662ef3bd793790375f811e7f7d599f-export const theNum: TheNum = \"type1\";","signature":"dea6d3f907d93004db9004d6cea5698d-export declare const theNum: TheNum;\n","impliedNodeFormat":1},{"version":"74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./pkg1_index.d.ts"} +//// [/home/src/workspaces/project/packages/pkg1.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./pkg1_index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./pkg1_index.ts", + "./typeroot1/sometype/index.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": "./pkg1_index.ts", + "version": "f4662ef3bd793790375f811e7f7d599f-export const theNum: TheNum = \"type1\";", + "signature": "dea6d3f907d93004db9004d6cea5698d-export declare const theNum: TheNum;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f4662ef3bd793790375f811e7f7d599f-export const theNum: TheNum = \"type1\";", + "signature": "dea6d3f907d93004db9004d6cea5698d-export declare const theNum: TheNum;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./typeroot1/sometype/index.d.ts", + "version": "74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";", + "signature": "74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./pkg1_index.d.ts", + "size": 1295 +} +//// [/home/src/workspaces/project/packages/pkg1_index.d.ts] *new* +export declare const theNum: TheNum; + +//// [/home/src/workspaces/project/packages/pkg1_index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.theNum = void 0; +exports.theNum = "type1"; + +//// [/home/src/workspaces/project/packages/pkg2.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./pkg2_index.ts","./typeroot2/sometype/index.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":"5520638613ac947a47797c35d3ad9c4b-export const theNum: TheNum2 = \"type2\";","signature":"becc5ed6bddc5e1124b92e180d59b5e3-export declare const theNum: TheNum2;\n","impliedNodeFormat":1},{"version":"660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./pkg2_index.d.ts"} +//// [/home/src/workspaces/project/packages/pkg2.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./pkg2_index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./pkg2_index.ts", + "./typeroot2/sometype/index.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": "./pkg2_index.ts", + "version": "5520638613ac947a47797c35d3ad9c4b-export const theNum: TheNum2 = \"type2\";", + "signature": "becc5ed6bddc5e1124b92e180d59b5e3-export declare const theNum: TheNum2;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5520638613ac947a47797c35d3ad9c4b-export const theNum: TheNum2 = \"type2\";", + "signature": "becc5ed6bddc5e1124b92e180d59b5e3-export declare const theNum: TheNum2;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./typeroot2/sometype/index.d.ts", + "version": "660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";", + "signature": "660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./pkg2_index.d.ts", + "size": 1298 +} +//// [/home/src/workspaces/project/packages/pkg2_index.d.ts] *new* +export declare const theNum: TheNum2; + +//// [/home/src/workspaces/project/packages/pkg2_index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.theNum = void 0; +exports.theNum = "type2"; + + +packages/pkg1.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/packages/pkg1_index.ts +*refresh* /home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/packages/pkg1_index.ts + +packages/pkg2.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/packages/pkg2_index.ts +*refresh* /home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/packages/pkg2_index.ts diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js b/testdata/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js new file mode 100644 index 0000000000..b1298953bb --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js @@ -0,0 +1,277 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/node_modules/a] -> /home/src/workspaces/project/packages/a *new* +//// [/home/src/workspaces/project/packages/a/index.js] *new* +export const a = 'a'; +//// [/home/src/workspaces/project/packages/a/package.json] *new* +{ + "name": "a", + "version": "0.0.0", + "type": "module", + "exports": { + ".": { + "types": "./types/index.d.ts", + "default": "./index.js" + } + } +} +//// [/home/src/workspaces/project/packages/a/test/index.js] *new* +import 'a'; +//// [/home/src/workspaces/project/packages/a/tsconfig.json] *new* +{ + "compilerOptions": { + "checkJs": true, + "composite": true, + "declaration": true, + "emitDeclarationOnly": true, + "module": "nodenext", + "outDir": "types", + }, +} +//// [/home/src/workspaces/project/packages/b/index.js] *new* +export { a } from 'a'; +//// [/home/src/workspaces/project/packages/b/package.json] *new* +{ + "name": "b", + "version": "0.0.0", + "type": "module" +} +//// [/home/src/workspaces/project/packages/b/tsconfig.json] *new* +{ +"references": [{ "path": "../a" }], + "compilerOptions": { + "checkJs": true, + "module": "nodenext", + "noEmit": true, + "noImplicitAny": true, + }, +} + +tsgo -b packages/a --verbose --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * packages/a/tsconfig.json + +[HH:MM:SS AM] Project 'packages/a/tsconfig.json' is out of date because output file 'packages/a/types/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/a/tsconfig.json'... + +======== Resolving module 'a' from '/home/src/workspaces/project/packages/a/test/index.js'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/workspaces/project/packages/a/test/package.json' does not exist. +Found 'package.json' at '/home/src/workspaces/project/packages/a/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './types/index.d.ts'. +File '/home/src/workspaces/project/packages/a/types/index.d.ts' does not exist. +Failed to resolve under condition 'types'. +Matched 'exports' condition 'default'. +Using 'exports' subpath '.' with target './index.js'. +File name '/home/src/workspaces/project/packages/a/index.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/project/packages/a/index.ts' does not exist. +File '/home/src/workspaces/project/packages/a/index.tsx' does not exist. +File '/home/src/workspaces/project/packages/a/index.d.ts' does not exist. +File '/home/src/workspaces/project/packages/a/index.js' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'default'. +Exiting conditional exports. +======== Module name 'a' was successfully resolved to '/home/src/workspaces/project/packages/a/index.js' with Package ID 'a/index.js@0.0.0'. ======== +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +packages/a/index.js + Matched by default include pattern '**/*' + Imported via 'a' from file 'packages/a/test/index.js' with packageId 'a/index.js@0.0.0' + File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" +packages/a/test/index.js + Matched by default include pattern '**/*' + File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.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/node_modules/a] *deleted* +//// [/home/src/workspaces/project/packages/a/types/index.d.ts] *new* +export declare const a = "a"; + +//// [/home/src/workspaces/project/packages/a/types/test/index.d.ts] *new* +import 'a'; + +//// [/home/src/workspaces/project/packages/a/types/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.esnext.full.d.ts","../index.js","../test/index.js"],"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":"fb6f7bce1e97f6455fc2f6a3fc00ca67-export const a = 'a';","signature":"410f445844ca5e1f83239796f66520a1-export declare const a = \"a\";\n","impliedNodeFormat":99},{"version":"25c2781885c8232d7ba0f67afa33aa44-import 'a';","signature":"518d564eba22abfaf340ce3ae18a4763-import 'a';\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"checkJs":true,"composite":true,"emitDeclarationOnly":true,"declaration":true,"module":199,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./test/index.d.ts"} +//// [/home/src/workspaces/project/packages/a/types/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../index.js", + "../test/index.js" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.esnext.full.d.ts", + "../index.js", + "../test/index.js" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.full.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": "../index.js", + "version": "fb6f7bce1e97f6455fc2f6a3fc00ca67-export const a = 'a';", + "signature": "410f445844ca5e1f83239796f66520a1-export declare const a = \"a\";\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "fb6f7bce1e97f6455fc2f6a3fc00ca67-export const a = 'a';", + "signature": "410f445844ca5e1f83239796f66520a1-export declare const a = \"a\";\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "../test/index.js", + "version": "25c2781885c8232d7ba0f67afa33aa44-import 'a';", + "signature": "518d564eba22abfaf340ce3ae18a4763-import 'a';\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "25c2781885c8232d7ba0f67afa33aa44-import 'a';", + "signature": "518d564eba22abfaf340ce3ae18a4763-import 'a';\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "../index.js" + ] + ], + "options": { + "checkJs": true, + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "module": 199, + "outDir": "./" + }, + "referencedMap": { + "../test/index.js": [ + "../index.js" + ] + }, + "latestChangedDtsFile": "./test/index.d.ts", + "size": 1416 +} + +packages/a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/packages/a/index.js +*refresh* /home/src/workspaces/project/packages/a/test/index.js +Signatures:: +(stored at emit) /home/src/workspaces/project/packages/a/index.js +(stored at emit) /home/src/workspaces/project/packages/a/test/index.js + + +Edit [0]:: build b +//// [/home/src/workspaces/project/node_modules/a] *deleted* + +tsgo -b packages/b --verbose --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * packages/a/tsconfig.json + * packages/b/tsconfig.json + +[HH:MM:SS AM] Project 'packages/a/tsconfig.json' is up to date because newest input 'packages/a/test/index.js' is older than output 'packages/a/types/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'packages/b/tsconfig.json' is out of date because output file 'packages/b/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'packages/b/tsconfig.json'... + +======== Resolving module 'a' from '/home/src/workspaces/project/packages/b/index.js'. ======== +Module resolution kind is not specified, using 'NodeNext'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +Found 'package.json' at '/home/src/workspaces/project/packages/b/package.json'. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/workspaces/project/packages/b/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/packages/b/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/packages/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspaces/project/packages/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/home/src/workspaces/project/node_modules/a/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './types/index.d.ts'. +File '/home/src/workspaces/project/node_modules/a/types/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/workspaces/project/node_modules/a/types/index.d.ts', result '/home/src/workspaces/project/packages/a/types/index.d.ts'. +======== Module name 'a' was successfully resolved to '/home/src/workspaces/project/packages/a/types/index.d.ts' with Package ID 'a/types/index.d.ts@0.0.0'. ======== +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +packages/a/types/index.d.ts + Imported via 'a' from file 'packages/b/index.js' with packageId 'a/types/index.d.ts@0.0.0' + File is ECMAScript module because 'packages/a/package.json' has field "type" with value "module" +packages/b/index.js + Matched by default include pattern '**/*' + File is ECMAScript module because 'packages/b/package.json' has field "type" with value "module" +//// [/home/src/workspaces/project/node_modules/a] *deleted* +//// [/home/src/workspaces/project/packages/b/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./index.js"]} +//// [/home/src/workspaces/project/packages/b/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.js" + ], + "original": "./index.js" + } + ], + "size": 49 +} + +packages/b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/packages/a/types/index.d.ts +*refresh* /home/src/workspaces/project/packages/b/index.js +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js b/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js new file mode 100644 index 0000000000..03499ed04f --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js @@ -0,0 +1,459 @@ +currentDirectory::/home/src/workspaces/packages +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/packages/src-dogs/dog.ts] *new* +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/dogconfig.ts] *new* +import { DogConfig } from 'src-types'; + +export const DOG_CONFIG: DogConfig = { + name: 'Default dog', +}; +//// [/home/src/workspaces/packages/src-dogs/index.ts] *new* +export * from 'src-types'; +export * from './lassie/lassiedog.js'; +//// [/home/src/workspaces/packages/src-dogs/lassie/lassieconfig.ts] *new* +import { DogConfig } from 'src-types'; + +export const LASSIE_CONFIG: DogConfig = { name: 'Lassie' }; +//// [/home/src/workspaces/packages/src-dogs/lassie/lassiedog.ts] *new* +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/node_modules] -> /home/src/workspaces/packages *new* +//// [/home/src/workspaces/packages/src-dogs/package.json] *new* +{ + "type": "module", + "exports": "./index.js" +} +//// [/home/src/workspaces/packages/src-dogs/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "../src-types" }, + ], + "include": [ + "**/*", + ], +} +//// [/home/src/workspaces/packages/src-types/dogconfig.ts] *new* +export interface DogConfig { + name: string; +} +//// [/home/src/workspaces/packages/src-types/index.ts] *new* +export * from './dogconfig.js'; +//// [/home/src/workspaces/packages/src-types/node_modules] -> /home/src/workspaces/packages *new* +//// [/home/src/workspaces/packages/src-types/package.json] *new* +{ + "type": "module", + "exports": "./index.js" +} +//// [/home/src/workspaces/packages/src-types/tsconfig.json] *new* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "composite": true, + }, + "include": [ + "**/*", + ], +} +//// [/home/src/workspaces/packages/tsconfig-base.json] *new* +{ + "compilerOptions": { + "declaration": true, + "module": "node16", + }, +} + +tsgo -b src-types src-dogs --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src-types/tsconfig.json + * src-dogs/tsconfig.json + +[HH:MM:SS AM] Project 'src-types/tsconfig.json' is out of date because output file 'src-types/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src-types/tsconfig.json'... + +[HH:MM:SS AM] Project 'src-dogs/tsconfig.json' is out of date because output file 'src-dogs/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src-dogs/tsconfig.json'... + +//// [/home/src/tslibs/TS/Lib/lib.es2022.full.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/packages/src-dogs/dog.d.ts] *new* +import { DogConfig } from 'src-types'; +export declare abstract class Dog { + static getCapabilities(): DogConfig; +} + +//// [/home/src/workspaces/packages/src-dogs/dog.js] *new* +import { DOG_CONFIG } from './dogconfig.js'; +export class Dog { + static getCapabilities() { + return DOG_CONFIG; + } +} + +//// [/home/src/workspaces/packages/src-dogs/dogconfig.d.ts] *new* +import { DogConfig } from 'src-types'; +export declare const DOG_CONFIG: DogConfig; + +//// [/home/src/workspaces/packages/src-dogs/dogconfig.js] *new* +export const DOG_CONFIG = { + name: 'Default dog', +}; + +//// [/home/src/workspaces/packages/src-dogs/index.d.ts] *new* +export * from 'src-types'; +export * from './lassie/lassiedog.js'; + +//// [/home/src/workspaces/packages/src-dogs/index.js] *new* +export * from 'src-types'; +export * from './lassie/lassiedog.js'; + +//// [/home/src/workspaces/packages/src-dogs/lassie/lassieconfig.d.ts] *new* +import { DogConfig } from 'src-types'; +export declare const LASSIE_CONFIG: DogConfig; + +//// [/home/src/workspaces/packages/src-dogs/lassie/lassieconfig.js] *new* +export const LASSIE_CONFIG = { name: 'Lassie' }; + +//// [/home/src/workspaces/packages/src-dogs/lassie/lassiedog.d.ts] *new* +import { Dog } from '../dog.js'; +export declare class LassieDog extends Dog { + protected static getDogConfig: () => import("../index.js").DogConfig; +} + +//// [/home/src/workspaces/packages/src-dogs/lassie/lassiedog.js] *new* +import { Dog } from '../dog.js'; +import { LASSIE_CONFIG } from './lassieconfig.js'; +export class LassieDog extends Dog { + static getDogConfig = () => LASSIE_CONFIG; +} + +//// [/home/src/workspaces/packages/src-dogs/node_modules] *deleted* +//// [/home/src/workspaces/packages/src-dogs/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[4,8]],"fileNames":["lib.es2022.full.d.ts","../src-types/dogconfig.d.ts","../src-types/index.d.ts","./dogconfig.ts","./dog.ts","./lassie/lassieconfig.ts","./lassie/lassiedog.ts","./index.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":"a71e22ebb89c8c5bea7cef8d090ace25-export interface DogConfig {\n name: string;\n}\n","impliedNodeFormat":99},{"version":"3c21c50da3a1aea8b6fafa5aa595f160-export * from './dogconfig.js';\n","impliedNodeFormat":99},{"version":"a8c9e5169f1e05ea3fd4da563dc779b7-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};","signature":"55c35bfb192d26f7ab56e9447864b637-import { DogConfig } from 'src-types';\nexport declare const DOG_CONFIG: DogConfig;\n","impliedNodeFormat":99},{"version":"4ef4eb6072aff36903b09b7e1fa75eea-import { DogConfig } from 'src-types';\nimport { DOG_CONFIG } from './dogconfig.js';\n\nexport abstract class Dog {\n\n public static getCapabilities(): DogConfig {\n return DOG_CONFIG;\n }\n}","signature":"1130c09f22ac69e13b25f0c42f3a9379-import { DogConfig } from 'src-types';\nexport declare abstract class Dog {\n static getCapabilities(): DogConfig;\n}\n","impliedNodeFormat":99},{"version":"37fa5afea0e398a9cc485818c902b71c-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };","signature":"2ef44fffbc07bb77765462af9f6df2a2-import { DogConfig } from 'src-types';\nexport declare const LASSIE_CONFIG: DogConfig;\n","impliedNodeFormat":99},{"version":"16f2a31a47590452f19f34bb56d0345f-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}","signature":"4e9a2f5bdce32a44b15cca0af7254c50-import { Dog } from '../dog.js';\nexport declare class LassieDog extends Dog {\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\n}\n","impliedNodeFormat":99},{"version":"099983d5c3c8b20233df02ca964ad12f-export * from 'src-types';\nexport * from './lassie/lassiedog.js';","signature":"0fb03f7b5b8061b0e2cd78a4131e3df7-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n","impliedNodeFormat":99}],"fileIdsList":[[3,4],[3],[3,7],[5,6],[2]],"options":{"composite":true,"declaration":true,"module":100},"referencedMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/packages/src-dogs/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./dogconfig.ts", + "./dog.ts", + "./lassie/lassieconfig.ts", + "./lassie/lassiedog.ts", + "./index.ts" + ], + "original": [ + 4, + 8 + ] + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "../src-types/dogconfig.d.ts", + "../src-types/index.d.ts", + "./dogconfig.ts", + "./dog.ts", + "./lassie/lassieconfig.ts", + "./lassie/lassiedog.ts", + "./index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "../src-types/dogconfig.d.ts", + "version": "a71e22ebb89c8c5bea7cef8d090ace25-export interface DogConfig {\n name: string;\n}\n", + "signature": "a71e22ebb89c8c5bea7cef8d090ace25-export interface DogConfig {\n name: string;\n}\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "a71e22ebb89c8c5bea7cef8d090ace25-export interface DogConfig {\n name: string;\n}\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "../src-types/index.d.ts", + "version": "3c21c50da3a1aea8b6fafa5aa595f160-export * from './dogconfig.js';\n", + "signature": "3c21c50da3a1aea8b6fafa5aa595f160-export * from './dogconfig.js';\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "3c21c50da3a1aea8b6fafa5aa595f160-export * from './dogconfig.js';\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./dogconfig.ts", + "version": "a8c9e5169f1e05ea3fd4da563dc779b7-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};", + "signature": "55c35bfb192d26f7ab56e9447864b637-import { DogConfig } from 'src-types';\nexport declare const DOG_CONFIG: DogConfig;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "a8c9e5169f1e05ea3fd4da563dc779b7-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};", + "signature": "55c35bfb192d26f7ab56e9447864b637-import { DogConfig } from 'src-types';\nexport declare const DOG_CONFIG: DogConfig;\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./dog.ts", + "version": "4ef4eb6072aff36903b09b7e1fa75eea-import { DogConfig } from 'src-types';\nimport { DOG_CONFIG } from './dogconfig.js';\n\nexport abstract class Dog {\n\n public static getCapabilities(): DogConfig {\n return DOG_CONFIG;\n }\n}", + "signature": "1130c09f22ac69e13b25f0c42f3a9379-import { DogConfig } from 'src-types';\nexport declare abstract class Dog {\n static getCapabilities(): DogConfig;\n}\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "4ef4eb6072aff36903b09b7e1fa75eea-import { DogConfig } from 'src-types';\nimport { DOG_CONFIG } from './dogconfig.js';\n\nexport abstract class Dog {\n\n public static getCapabilities(): DogConfig {\n return DOG_CONFIG;\n }\n}", + "signature": "1130c09f22ac69e13b25f0c42f3a9379-import { DogConfig } from 'src-types';\nexport declare abstract class Dog {\n static getCapabilities(): DogConfig;\n}\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./lassie/lassieconfig.ts", + "version": "37fa5afea0e398a9cc485818c902b71c-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };", + "signature": "2ef44fffbc07bb77765462af9f6df2a2-import { DogConfig } from 'src-types';\nexport declare const LASSIE_CONFIG: DogConfig;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "37fa5afea0e398a9cc485818c902b71c-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };", + "signature": "2ef44fffbc07bb77765462af9f6df2a2-import { DogConfig } from 'src-types';\nexport declare const LASSIE_CONFIG: DogConfig;\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./lassie/lassiedog.ts", + "version": "16f2a31a47590452f19f34bb56d0345f-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}", + "signature": "4e9a2f5bdce32a44b15cca0af7254c50-import { Dog } from '../dog.js';\nexport declare class LassieDog extends Dog {\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\n}\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "16f2a31a47590452f19f34bb56d0345f-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}", + "signature": "4e9a2f5bdce32a44b15cca0af7254c50-import { Dog } from '../dog.js';\nexport declare class LassieDog extends Dog {\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\n}\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./index.ts", + "version": "099983d5c3c8b20233df02ca964ad12f-export * from 'src-types';\nexport * from './lassie/lassiedog.js';", + "signature": "0fb03f7b5b8061b0e2cd78a4131e3df7-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "099983d5c3c8b20233df02ca964ad12f-export * from 'src-types';\nexport * from './lassie/lassiedog.js';", + "signature": "0fb03f7b5b8061b0e2cd78a4131e3df7-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "../src-types/index.d.ts", + "./dogconfig.ts" + ], + [ + "../src-types/index.d.ts" + ], + [ + "../src-types/index.d.ts", + "./lassie/lassiedog.ts" + ], + [ + "./dog.ts", + "./lassie/lassieconfig.ts" + ], + [ + "../src-types/dogconfig.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 100 + }, + "referencedMap": { + "./dog.ts": [ + "../src-types/index.d.ts", + "./dogconfig.ts" + ], + "./dogconfig.ts": [ + "../src-types/index.d.ts" + ], + "./index.ts": [ + "../src-types/index.d.ts", + "./lassie/lassiedog.ts" + ], + "./lassie/lassieconfig.ts": [ + "../src-types/index.d.ts" + ], + "./lassie/lassiedog.ts": [ + "./dog.ts", + "./lassie/lassieconfig.ts" + ], + "../src-types/index.d.ts": [ + "../src-types/dogconfig.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 3218 +} +//// [/home/src/workspaces/packages/src-types/dogconfig.d.ts] *new* +export interface DogConfig { + name: string; +} + +//// [/home/src/workspaces/packages/src-types/dogconfig.js] *new* +export {}; + +//// [/home/src/workspaces/packages/src-types/index.d.ts] *new* +export * from './dogconfig.js'; + +//// [/home/src/workspaces/packages/src-types/index.js] *new* +export * from './dogconfig.js'; + +//// [/home/src/workspaces/packages/src-types/node_modules] *deleted* +//// [/home/src/workspaces/packages/src-types/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.es2022.full.d.ts","./dogconfig.ts","./index.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":"d8b224befa78d5f27814a6eb4da56079-export interface DogConfig {\n name: string;\n}","signature":"a71e22ebb89c8c5bea7cef8d090ace25-export interface DogConfig {\n name: string;\n}\n","impliedNodeFormat":99},{"version":"ac3890d1bb11659994f68e147333e98e-export * from './dogconfig.js';","signature":"3c21c50da3a1aea8b6fafa5aa595f160-export * from './dogconfig.js';\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"module":100},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/packages/src-types/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./dogconfig.ts", + "./index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./dogconfig.ts", + "./index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./dogconfig.ts", + "version": "d8b224befa78d5f27814a6eb4da56079-export interface DogConfig {\n name: string;\n}", + "signature": "a71e22ebb89c8c5bea7cef8d090ace25-export interface DogConfig {\n name: string;\n}\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "d8b224befa78d5f27814a6eb4da56079-export interface DogConfig {\n name: string;\n}", + "signature": "a71e22ebb89c8c5bea7cef8d090ace25-export interface DogConfig {\n name: string;\n}\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./index.ts", + "version": "ac3890d1bb11659994f68e147333e98e-export * from './dogconfig.js';", + "signature": "3c21c50da3a1aea8b6fafa5aa595f160-export * from './dogconfig.js';\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "ac3890d1bb11659994f68e147333e98e-export * from './dogconfig.js';", + "signature": "3c21c50da3a1aea8b6fafa5aa595f160-export * from './dogconfig.js';\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./dogconfig.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 100 + }, + "referencedMap": { + "./index.ts": [ + "./dogconfig.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1440 +} + +src-types/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /home/src/workspaces/packages/src-types/dogconfig.ts +*refresh* /home/src/workspaces/packages/src-types/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/packages/src-types/dogconfig.ts +(stored at emit) /home/src/workspaces/packages/src-types/index.ts + +src-dogs/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /home/src/workspaces/packages/src-types/dogconfig.d.ts +*refresh* /home/src/workspaces/packages/src-types/index.d.ts +*refresh* /home/src/workspaces/packages/src-dogs/dogconfig.ts +*refresh* /home/src/workspaces/packages/src-dogs/dog.ts +*refresh* /home/src/workspaces/packages/src-dogs/lassie/lassieconfig.ts +*refresh* /home/src/workspaces/packages/src-dogs/lassie/lassiedog.ts +*refresh* /home/src/workspaces/packages/src-dogs/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/packages/src-dogs/dogconfig.ts +(stored at emit) /home/src/workspaces/packages/src-dogs/dog.ts +(stored at emit) /home/src/workspaces/packages/src-dogs/lassie/lassieconfig.ts +(stored at emit) /home/src/workspaces/packages/src-dogs/lassie/lassiedog.ts +(stored at emit) /home/src/workspaces/packages/src-dogs/index.ts diff --git a/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js b/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js new file mode 100644 index 0000000000..4e8b2324c4 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js @@ -0,0 +1,387 @@ +currentDirectory::/home/src/workspaces/packages +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.d.ts] *new* +/// +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 { + readonly species: symbol; + (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/packages/solution/common/nominal.ts] *new* +export declare type Nominal = T & { + [Symbol.species]: Name; +}; +//// [/home/src/workspaces/packages/solution/common/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "include": ["nominal.ts"] +} +//// [/home/src/workspaces/packages/solution/sub-project-2/index.ts] *new* +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] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../sub-project" } + ], + "include": ["./index.ts"] +} +//// [/home/src/workspaces/packages/solution/sub-project/index.ts] *new* +import { Nominal } from '../common/nominal'; + +export type MyNominal = Nominal; +//// [/home/src/workspaces/packages/solution/sub-project/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" } + ], + "include": ["./index.ts"] +} +//// [/home/src/workspaces/packages/solution/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" } + ], + "include": [] +} +//// [/home/src/workspaces/packages/tsconfig.base.json] *new* +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "lib" + } +} +//// [/home/src/workspaces/packages/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./solution" }, + ], + "include": [], +} + +tsgo -b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * solution/common/tsconfig.json + * solution/sub-project/tsconfig.json + * solution/sub-project-2/tsconfig.json + * solution/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'solution/common/tsconfig.json' is out of date because output file 'lib/solution/common/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'solution/common/tsconfig.json'... + +[HH:MM:SS AM] Project 'solution/sub-project/tsconfig.json' is out of date because output file 'lib/solution/sub-project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'solution/sub-project/tsconfig.json'... + +[HH:MM:SS AM] Project 'solution/sub-project-2/tsconfig.json' is out of date because output file 'lib/solution/sub-project-2/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'solution/sub-project-2/tsconfig.json'... + +//// [/home/src/workspaces/packages/lib/solution/common/nominal.d.ts] *new* +export declare type Nominal = T & { + [Symbol.species]: Name; +}; + +//// [/home/src/workspaces/packages/lib/solution/common/nominal.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/packages/lib/solution/common/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../../../solution/common/nominal.ts"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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":"6da5023bc256e774f9366f88c712bfc1-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};","signature":"5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"latestChangedDtsFile":"./nominal.d.ts"} +//// [/home/src/workspaces/packages/lib/solution/common/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../solution/common/nominal.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../../../solution/common/nominal.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "../../../solution/common/nominal.ts", + "version": "6da5023bc256e774f9366f88c712bfc1-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};", + "signature": "5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6da5023bc256e774f9366f88c712bfc1-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};", + "signature": "5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "../..", + "rootDir": "../../..", + "skipLibCheck": true + }, + "latestChangedDtsFile": "./nominal.d.ts", + "size": 1347 +} +//// [/home/src/workspaces/packages/lib/solution/sub-project-2/index.d.ts] *new* +import { MyNominal } from '../sub-project/index'; +declare const variable: { + key: MyNominal; +}; +export declare function getVar(): keyof typeof variable; +export {}; + +//// [/home/src/workspaces/packages/lib/solution/sub-project-2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getVar = getVar; +const variable = { + key: 'value', +}; +function getVar() { + return 'key'; +} + +//// [/home/src/workspaces/packages/lib/solution/sub-project-2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../../solution/sub-project-2/index.ts"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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},"5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n","ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n",{"version":"8d7f0cd34ff9cb954b00662137820b98-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}","signature":"d3fc4bf12d5f8dfcac4dd45791e378ef-import { MyNominal } from '../sub-project/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n","impliedNodeFormat":1}],"fileIdsList":[[2],[3]],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"referencedMap":[[3,1],[4,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/packages/lib/solution/sub-project-2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../solution/sub-project-2/index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../common/nominal.d.ts", + "../sub-project/index.d.ts", + "../../../solution/sub-project-2/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "../common/nominal.d.ts", + "version": "5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", + "signature": "5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../sub-project/index.d.ts", + "version": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../solution/sub-project-2/index.ts", + "version": "8d7f0cd34ff9cb954b00662137820b98-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "d3fc4bf12d5f8dfcac4dd45791e378ef-import { MyNominal } from '../sub-project/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8d7f0cd34ff9cb954b00662137820b98-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", + "signature": "d3fc4bf12d5f8dfcac4dd45791e378ef-import { MyNominal } from '../sub-project/index';\ndeclare const variable: {\n key: MyNominal;\n};\nexport declare function getVar(): keyof typeof variable;\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../common/nominal.d.ts" + ], + [ + "../sub-project/index.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "../..", + "rootDir": "../../..", + "skipLibCheck": true + }, + "referencedMap": { + "../sub-project/index.d.ts": [ + "../common/nominal.d.ts" + ], + "../../../solution/sub-project-2/index.ts": [ + "../sub-project/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1893 +} +//// [/home/src/workspaces/packages/lib/solution/sub-project/index.d.ts] *new* +import { Nominal } from '../common/nominal'; +export type MyNominal = Nominal; + +//// [/home/src/workspaces/packages/lib/solution/sub-project/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/packages/lib/solution/sub-project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../common/nominal.d.ts","../../../solution/sub-project/index.ts"],"fileInfos":[{"version":"24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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},"5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n",{"version":"17fb8188dac0968c390031165ecd45b6-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;","signature":"ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/packages/lib/solution/sub-project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../solution/sub-project/index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../common/nominal.d.ts", + "../../../solution/sub-project/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "24b4796cd50d1a9aabad1583878c494d-/// \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 readonly species: symbol;\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": "../common/nominal.d.ts", + "version": "5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", + "signature": "5e7f6e0ebb82be49de355c8db93969fe-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../solution/sub-project/index.ts", + "version": "17fb8188dac0968c390031165ecd45b6-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "17fb8188dac0968c390031165ecd45b6-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;", + "signature": "ba931f9684d9e8eb38e02da33050dc55-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../common/nominal.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "../..", + "rootDir": "../../..", + "skipLibCheck": true + }, + "referencedMap": { + "../../../solution/sub-project/index.ts": [ + "../common/nominal.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1563 +} + +solution/common/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/packages/solution/common/nominal.ts +Signatures:: +(stored at emit) /home/src/workspaces/packages/solution/common/nominal.ts + +solution/sub-project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/packages/lib/solution/common/nominal.d.ts +*refresh* /home/src/workspaces/packages/solution/sub-project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/packages/solution/sub-project/index.ts + +solution/sub-project-2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/packages/lib/solution/common/nominal.d.ts +*refresh* /home/src/workspaces/packages/lib/solution/sub-project/index.d.ts +*refresh* /home/src/workspaces/packages/solution/sub-project-2/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/packages/solution/sub-project-2/index.ts diff --git a/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js new file mode 100644 index 0000000000..0a85460c6f --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js @@ -0,0 +1,1489 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": true + } +} + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/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: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1810 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +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 +Signatures:: + + +Edit [4]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1806 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [7]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [8]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1753 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1303 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [10]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'c.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/c.ts + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 2114 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1611 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [14]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [15]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [16]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js b/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js new file mode 100644 index 0000000000..141b3c4c82 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js @@ -0,0 +1,942 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": false + } +} + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/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: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 88 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 74 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [2]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [3]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 54 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [4]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [5]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 88 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [7]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [8]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 68 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 74 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [10]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 54 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'c.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts"],"semanticErrors":true} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 85, + "semanticErrors": true +} + +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 +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 + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":["./a.ts","./b.ts","./c.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 97 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +*not cached* /home/src/workspaces/project/c.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 + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts","./c.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 83 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +*not cached* /home/src/workspaces/project/c.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 + + +Edit [14]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts"],"semanticErrors":true} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 85, + "semanticErrors": true +} + +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 +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 + + +Edit [15]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [16]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +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 +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 diff --git a/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js new file mode 100644 index 0000000000..3b59a18d15 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js @@ -0,0 +1,1283 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a: number = "hello"; +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": true + } +} + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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: number; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1311 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'b.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +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 +Signatures:: + + +Edit [4]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [7]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [8]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello"; +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1398 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1303 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [10]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'c.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/c.ts + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1615 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1611 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [14]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [15]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [16]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noCheck/semantic-errors.js b/testdata/baselines/reference/tsbuild/noCheck/semantic-errors.js new file mode 100644 index 0000000000..2fb222fff8 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noCheck/semantic-errors.js @@ -0,0 +1,751 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a: number = "hello"; +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": false + } +} + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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: number; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 74 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'b.ts' is older than output 'a.js' + + + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [2]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [3]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 54 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [4]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [5]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 74 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [7]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [8]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello"; +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts"],"semanticErrors":true} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 76, + "semanticErrors": true +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 74 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [10]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 54 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'c.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts"],"semanticErrors":true} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 85, + "semanticErrors": true +} + +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 +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 + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts","./c.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 83 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +*not cached* /home/src/workspaces/project/c.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 + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +*not cached* /home/src/workspaces/project/c.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 + + +Edit [14]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts"],"semanticErrors":true} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 85, + "semanticErrors": true +} + +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 +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 + + +Edit [15]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [16]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +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 +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 diff --git a/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js new file mode 100644 index 0000000000..de8cd5cf35 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js @@ -0,0 +1,1345 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a = "hello +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": true + } +} + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/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 = "hello"; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1318 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +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 +Signatures:: + + +Edit [4]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1314 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [7]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [8]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1294 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1303 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [10]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'c.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/c.ts + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1622 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1611 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [14]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [15]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [16]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noCheck/syntax-errors.js b/testdata/baselines/reference/tsbuild/noCheck/syntax-errors.js new file mode 100644 index 0000000000..56f527bd2c --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noCheck/syntax-errors.js @@ -0,0 +1,887 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a = "hello +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": false + } +} + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/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 = "hello"; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 88 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 74 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [2]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [3]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 54 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [4]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [5]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 88 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [7]:: no change + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [8]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 68 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 74 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [10]:: No Change run with checking + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 54 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'c.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts"],"semanticErrors":true} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 85, + "semanticErrors": true +} + +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 +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 + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo -b -v --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":["./a.ts","./b.ts","./c.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 97 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +*not cached* /home/src/workspaces/project/c.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 + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":["./a.ts","./b.ts","./c.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 83 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +*not cached* /home/src/workspaces/project/c.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 + + +Edit [14]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts","./b.ts","./c.ts"],"semanticErrors":true} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + }, + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 85, + "semanticErrors": true +} + +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 +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 + + +Edit [15]:: no change + +tsgo -b -v --noCheck +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [16]:: No Change run with checking + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +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 +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 diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js b/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js new file mode 100644 index 0000000000..5972225167 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js @@ -0,0 +1,1661 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "size": 2590 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [0]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/noChangeFileWithEmitSpecificError.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/noChangeFileWithEmitSpecificError.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [2]:: Introduce error but still noEmit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","emitSignatures":[[2,"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|Dts", + 2 + ], + [ + "./src/directUse.ts", + "Dts", + [ + 4 + ] + ], + [ + "./src/indirectClass.ts", + "Js|Dts", + 3 + ], + [ + "./src/indirectUse.ts", + "Dts", + [ + 5 + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "emitSignatures": [ + { + "file": "./src/class.ts", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "original": [ + 2, + "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n" + ] + }, + { + "file": "./src/directUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 4, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + }, + { + "file": "./src/indirectUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 5, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + } + ], + "size": 3190 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: Fix error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "size": 2590 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [4]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [6]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [7]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [8]:: Introduce error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "size": 3093 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [9]:: No Change run with emit + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [10]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [11]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [12]:: No Change run with emit + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [13]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"latestChangedDtsFile":"./src/class.d.ts","emitSignatures":[[2,"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "emitSignatures": [ + { + "file": "./src/class.ts", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "original": [ + 2, + "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n" + ] + }, + { + "file": "./src/directUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 4, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + }, + { + "file": "./src/indirectUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 5, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + } + ], + "size": 2648 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [14]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/class.d.ts", + "size": 2562 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [15]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [16]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [17]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js new file mode 100644 index 0000000000..868e102cab --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js @@ -0,0 +1,1613 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true } +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [0]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/noChangeFileWithEmitSpecificError.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/noChangeFileWithEmitSpecificError.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [2]:: Introduce error but still noEmit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|Dts", + 2 + ], + [ + "./src/directUse.ts", + "Dts", + [ + 4 + ] + ], + [ + "./src/indirectClass.ts", + "Js|Dts", + 3 + ], + [ + "./src/indirectUse.ts", + "Dts", + [ + 5 + ] + ] + ], + "size": 2906 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: Fix error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/class.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [4]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [6]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [7]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [8]:: Introduce error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 3053 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [9]:: No Change run with emit + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [10]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [11]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [12]:: No Change run with emit + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [13]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "size": 2391 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [14]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [15]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [16]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [17]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js new file mode 100644 index 0000000000..e36127a4d1 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js @@ -0,0 +1,1444 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true } +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 1737 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/noChangeFileWithEmitSpecificError.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/noChangeFileWithEmitSpecificError.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [2]:: Introduce error but still noEmit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,4,3,5]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/directUse.ts", + "Js", + 4 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ], + [ + "./src/indirectUse.ts", + "Js", + 5 + ] + ], + "size": 2807 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(computed .d.ts) /home/src/workspaces/project/src/directUse.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: Fix error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/directUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2051 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [4]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [6]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [7]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [8]:: Introduce error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 2582 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [9]:: No Change run with emit + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [10]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [11]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [12]:: No Change run with emit + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [13]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ] + ], + "size": 2084 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [14]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2051 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [15]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [16]:: No Change run with noEmit + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [17]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/class.ts' is older than output 'tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js new file mode 100644 index 0000000000..62a76b588e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js @@ -0,0 +1,1127 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"emitSignatures":[2,3,4,5,6,7]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "Js|DtsEmit", + [ + 5, + 17 + ] + ], + [ + "./src/noChangeFile.ts", + "Js|DtsEmit", + [ + 6, + 17 + ] + ], + [ + "./src/noChangeFileWithEmitSpecificError.ts", + "Js|DtsEmit", + [ + 7, + 17 + ] + ] + ], + "emitSignatures": [ + { + "file": "./src/class.ts", + "original": 2 + }, + { + "file": "./src/indirectClass.ts", + "original": 3 + }, + { + "file": "./src/directUse.ts", + "original": 4 + }, + { + "file": "./src/indirectUse.ts", + "original": 5 + }, + { + "file": "./src/noChangeFile.ts", + "original": 6 + }, + { + "file": "./src/noChangeFileWithEmitSpecificError.ts", + "original": 7 + } + ], + "size": 1868 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "size": 2590 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [1]:: Introduce error with emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "size": 3093 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [2]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"latestChangedDtsFile":"./src/class.d.ts","emitSignatures":[[2,"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "emitSignatures": [ + { + "file": "./src/class.ts", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "original": [ + 2, + "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n" + ] + }, + { + "file": "./src/directUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 4, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + }, + { + "file": "./src/indirectUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 5, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + } + ], + "size": 2648 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/class.d.ts", + "size": 2562 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js new file mode 100644 index 0000000000..d3688f6b7e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -0,0 +1,1077 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "Js|DtsEmit", + [ + 5, + 17 + ] + ], + [ + "./src/noChangeFile.ts", + "Js|DtsEmit", + [ + 6, + 17 + ] + ], + [ + "./src/noChangeFileWithEmitSpecificError.ts", + "Js|DtsEmit", + [ + 7, + 17 + ] + ] + ], + "size": 1839 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [1]:: Introduce error with emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 3053 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [2]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "size": 2391 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts diff --git a/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js new file mode 100644 index 0000000000..66ce7033ab --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js @@ -0,0 +1,923 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[2,4,3,5,6,7]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/directUse.ts", + "Js", + 4 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ], + [ + "./src/indirectUse.ts", + "Js", + 5 + ], + [ + "./src/noChangeFile.ts", + "Js", + 6 + ], + [ + "./src/noChangeFileWithEmitSpecificError.ts", + "Js", + 7 + ] + ], + "size": 1778 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 1737 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Introduce error with emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'src/class.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 2770 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(computed .d.ts) /home/src/workspaces/project/src/directUse.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [2]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ] + ], + "size": 2084 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: No Change run with emit + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2051 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js new file mode 100644 index 0000000000..2604cb333a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -0,0 +1,735 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1037 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'b.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: With declaration enabled noEmit - Should report errors + +tsgo -b -v --noEmit --declaration +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ] + ], + "size": 1368 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: With declaration and declarationMap noEmit - Should report errors + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ], + [ + "./b.ts", + "Js|DtsEmit|DtsMap", + [ + 3, + 49 + ] + ] + ], + "size": 1390 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'b.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [4]:: Dts Emit with error + +tsgo -b -v --declaration +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *new* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/projects/project/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1753 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/projects/project/a.ts +(stored at emit) /home/src/projects/project/b.ts + + +Edit [5]:: Fix the error +//// [/home/src/projects/project/a.ts] *modified* +export const a = class { public p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1302 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: With declaration enabled noEmit + +tsgo -b -v --noEmit --declaration +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,16]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "DtsEmit", + [ + 3, + 16 + ] + ] + ], + "size": 1345 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: With declaration and declarationMap noEmit + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js new file mode 100644 index 0000000000..78b36fcdf6 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -0,0 +1,633 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1019 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: With declaration enabled noEmit - Should report errors + +tsgo -b -v --noEmit --declaration +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1341 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: With declaration and declarationMap noEmit - Should report errors + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,49]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ] + ], + "size": 1363 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [4]:: Dts Emit with error + +tsgo -b -v --declaration +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *new* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *new* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1578 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/projects/project/a.ts + + +Edit [5]:: Fix the error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { public p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"fd0a13eee55a55d7a29403dae06f20db-const a = class { public p = 10; };","signature":"659c028cd6db4a336891fd793cecc006-declare const a: {\n new (): {\n p: number;\n };\n};\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "fd0a13eee55a55d7a29403dae06f20db-const a = class { public p = 10; };", + "signature": "659c028cd6db4a336891fd793cecc006-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "fd0a13eee55a55d7a29403dae06f20db-const a = class { public p = 10; };", + "signature": "659c028cd6db4a336891fd793cecc006-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1133 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: With declaration enabled noEmit + +tsgo -b -v --noEmit --declaration +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"fd0a13eee55a55d7a29403dae06f20db-const a = class { public p = 10; };","signature":"659c028cd6db4a336891fd793cecc006-declare const a: {\n new (): {\n p: number;\n };\n};\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "fd0a13eee55a55d7a29403dae06f20db-const a = class { public p = 10; };", + "signature": "659c028cd6db4a336891fd793cecc006-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "fd0a13eee55a55d7a29403dae06f20db-const a = class { public p = 10; };", + "signature": "659c028cd6db4a336891fd793cecc006-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1169 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: With declaration and declarationMap noEmit + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000..dbbed51592 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,1646 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/c.ts] *new* +export const c = class { private p = 10; }; +//// [/home/src/projects/project/d.ts] *new* +export const d = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"affectedFilesPendingEmit":[2,3,4,5]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + } + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ], + [ + "./c.ts", + "Js", + 4 + ], + [ + "./d.ts", + "Js", + 5 + ] + ], + "size": 1217 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +*refresh* /home/src/projects/project/c.ts +*refresh* /home/src/projects/project/d.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'd.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: With declaration enabled noEmit - Should report errors + +tsgo -b -v --noEmit --declaration +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 a.ts:1 + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ], + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./c.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ], + [ + "./d.ts", + "Js|DtsEmit", + [ + 5, + 17 + ] + ] + ], + "size": 2084 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: With declaration and declarationMap noEmit - Should report errors + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 a.ts:1 + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ], + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ], + [ + "./b.ts", + "Js|DtsEmit|DtsMap", + [ + 3, + 49 + ] + ], + [ + "./c.ts", + "Js|DtsEmit|DtsMap", + [ + 4, + 49 + ] + ], + [ + "./d.ts", + "Js|DtsEmit|DtsMap", + [ + 5, + 49 + ] + ] + ], + "size": 2106 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'd.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [4]:: Dts Emit with error + +tsgo -b -v --declaration +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 a.ts:1 + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/project/a.d.ts] *new* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/projects/project/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/c.d.ts] *new* +export declare const c: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +const c = class { + p = 10; +}; +exports.c = c; + +//// [/home/src/projects/project/d.d.ts] *new* +export declare const d: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/d.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +const d = class { + p = 10; +}; +exports.d = d; + +//// [/home/src/projects/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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ], + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "size": 3087 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/projects/project/a.ts +(stored at emit) /home/src/projects/project/b.ts +(stored at emit) /home/src/projects/project/c.ts +(stored at emit) /home/src/projects/project/d.ts + + +Edit [5]:: Fix the error +//// [/home/src/projects/project/a.ts] *modified* +export const a = class { public p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 2663 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: With declaration enabled noEmit + +tsgo -b -v --noEmit --declaration +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "DtsEmit", + [ + 3, + 16 + ] + ], + [ + "./c.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./d.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "size": 2720 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: With declaration and declarationMap noEmit + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ], + [ + "./b.ts", + "DtsEmit|DtsMap", + [ + 3, + 48 + ] + ], + [ + "./c.ts", + "DtsEmit|DtsMap", + [ + 4, + 48 + ] + ], + [ + "./d.ts", + "DtsEmit|DtsMap", + [ + 5, + 48 + ] + ] + ], + "size": 2742 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [8]:: Fix the another +//// [/home/src/projects/project/c.ts] *modified* +export const c = class { public p = 10; }; + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 1 error in d.ts:1 + +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };","signature":"17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };", + "signature": "17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };", + "signature": "17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ], + [ + "./b.ts", + "DtsEmit|DtsMap", + [ + 3, + 48 + ] + ], + [ + "./c.ts", + "Js|DtsEmit|DtsMap", + [ + 4, + 49 + ] + ], + [ + "./d.ts", + "DtsEmit|DtsMap", + [ + 5, + 48 + ] + ] + ], + "size": 2318 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/c.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/c.ts diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js new file mode 100644 index 0000000000..468da11170 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js @@ -0,0 +1,347 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 45 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [1]:: With declaration enabled noEmit - Should report errors + +tsgo -b -v --noEmit --declaration +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 59 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [2]:: With declaration and declarationMap noEmit - Should report errors + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [3]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 45 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [4]:: Dts Emit with error + +tsgo -b -v --declaration +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *new* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *new* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 59 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(stored at emit) /home/src/projects/project/a.ts + + +Edit [5]:: Fix the error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { public p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 45 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: With declaration enabled noEmit + +tsgo -b -v --noEmit --declaration +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'a.js' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [7]:: With declaration and declarationMap noEmit + +tsgo -b -v --noEmit --declaration --declarationMap +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'a.js' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..fade69a22f --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,712 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ] + ], + "size": 1368 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ] + ], + "size": 1181 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.d.ts] *new* +export declare const a = "hello"; + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/projects/project/b.ts + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1795 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *modified* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1759 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js new file mode 100644 index 0000000000..6a76560995 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js @@ -0,0 +1,621 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1341 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1117 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.d.ts] *new* +declare const a = "hello"; + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1081 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1614 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *modified* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1578 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000..89554d564a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,525 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1069 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'b.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1172 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1139 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1393 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1362 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000..4875813312 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,459 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1051 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1082 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1324 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1293 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] 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/noEmit/dts-errors-without-dts-enabled.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000..d5c1bf0398 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-without-dts-enabled.js @@ -0,0 +1,237 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 45 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'a.js' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js new file mode 100644 index 0000000000..46da71ff3d --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js @@ -0,0 +1,346 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": true + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 59 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 45 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.d.ts] *new* +declare const a = "hello"; + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(stored at emit) /home/src/projects/project/a.ts + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 59 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *modified* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(stored at emit) /home/src/projects/project/a.ts + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..c23186cbd1 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,615 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a: number = "hello" +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"", + "signature": "a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1204 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1172 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1139 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1327 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1296 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js new file mode 100644 index 0000000000..c1fa7999c7 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js @@ -0,0 +1,547 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a: number = "hello" +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1184 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1082 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1258 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1227 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/semantic-errors.js b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors.js new file mode 100644 index 0000000000..e71f806852 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/semantic-errors.js @@ -0,0 +1,310 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a: number = "hello" +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./a.ts"],"semanticErrors":true} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 67, + "semanticErrors": true +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 45 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts"],"semanticErrors":true} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 67, + "semanticErrors": true +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..317904bb9e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,589 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = "hello +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1101 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +*not cached* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +*not cached* /home/src/projects/project/b.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1172 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1139 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"changeFileSet":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "changeFileSet": [ + "./a.ts" + ], + "size": 1189 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[1,2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts" + ], + "size": 1197 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js new file mode 100644 index 0000000000..3aa42cb522 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js @@ -0,0 +1,516 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = "hello +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","./a.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[1,2],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts" + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1081 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1082 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","./a.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"changeFileSet":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "changeFileSet": [ + "./a.ts" + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","./a.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1126 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/syntax-errors.js b/testdata/baselines/reference/tsbuild/noEmit/syntax-errors.js new file mode 100644 index 0000000000..29782c5915 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmit/syntax-errors.js @@ -0,0 +1,312 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = "hello +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + } +} + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 59 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 45 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [2]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'a.js' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [4]:: no change + +tsgo -b -v --noEmit +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'a.ts' is older than output 'a.js' + + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": "./a.ts" + } + ], + "size": 59 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [7]:: no change + +tsgo -b -v --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000..17ecd83a5b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,389 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 53, + "end": 54, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 53, + "end": 54, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "../src/main.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "../src/other.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ] + ], + "size": 1628 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1656 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js new file mode 100644 index 0000000000..97da5cd9bf --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js @@ -0,0 +1,241 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 109 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 95 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(stored at emit) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-incremental.js new file mode 100644 index 0000000000..b4048e52ec --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-incremental.js @@ -0,0 +1,283 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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; }; +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1289 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1437 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors.js b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors.js new file mode 100644 index 0000000000..36b6950f8c --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors.js @@ -0,0 +1,165 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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; }; +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 95 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output 'dev-build/shared/types/db.js' + + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000..d8fdb8837c --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration-with-incremental.js @@ -0,0 +1,353 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 46, + "end": 47, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js|Dts", + 2 + ], + [ + "../src/main.ts", + "Js|Dts", + 3 + ], + [ + "../src/other.ts", + "Js|Dts", + 4 + ] + ], + "size": 1445 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1587 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration.js b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration.js new file mode 100644 index 0000000000..b4aad115a3 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-declaration.js @@ -0,0 +1,225 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"semanticErrors":true} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 117, + "semanticErrors": true +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 95 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(stored at emit) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental.js new file mode 100644 index 0000000000..ffd63e121b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental.js @@ -0,0 +1,330 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 46, + "end": 47, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js", + 2 + ], + [ + "../src/main.ts", + "Js", + 3 + ], + [ + "../src/other.ts", + "Js", + 4 + ] + ], + "size": 1446 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1368 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors.js b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors.js new file mode 100644 index 0000000000..f23697e646 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/semantic-errors.js @@ -0,0 +1,211 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"semanticErrors":true} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 117, + "semanticErrors": true +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 95 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000..3b86ee7324 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-declaration-with-incremental.js @@ -0,0 +1,359 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "signature": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js|Dts", + 2 + ], + [ + "../src/main.ts", + "Js|Dts", + 3 + ], + [ + "../src/other.ts", + "Js|Dts", + 4 + ] + ], + "size": 1369 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1596 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-declaration.js b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-declaration.js new file mode 100644 index 0000000000..74f8b0e29b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-declaration.js @@ -0,0 +1,231 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 109 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 95 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(stored at emit) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js new file mode 100644 index 0000000000..d2e03dd47c --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental.js @@ -0,0 +1,336 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "signature": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js", + 2 + ], + [ + "../src/main.ts", + "Js", + 3 + ], + [ + "../src/other.ts", + "Js", + 4 + ] + ], + "size": 1370 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1377 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors.js b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors.js new file mode 100644 index 0000000000..fd5f14f793 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/noEmitOnError/syntax-errors.js @@ -0,0 +1,217 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 109 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts" + ], + "original": "../shared/types/db.ts" + }, + { + "files": [ + "../src/main.ts" + ], + "original": "../src/main.ts" + }, + { + "files": [ + "../src/other.ts" + ], + "original": "../src/other.ts" + } + ], + "size": 95 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [2]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + + diff --git a/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js new file mode 100644 index 0000000000..1d09ddcaa5 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js @@ -0,0 +1,135 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "dist", + "composite": true, + }, +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/dist/src/index.d.ts] *new* +export declare const x = 10; + +//// [/home/src/workspaces/project/dist/src/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/index.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":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/index.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": "../src/index.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1118 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/index.ts + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/index.ts' is older than output 'dist/tsconfig.tsbuildinfo' + + + + +Edit [1]:: Normal build without change, that does not block emit on error to show files that get emitted + +tsgo -p /home/src/workspaces/project/tsconfig.json +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js new file mode 100644 index 0000000000..148ff32fc4 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js @@ -0,0 +1,94 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "dist", + }, +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/dist/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/index.ts"]} +//// [/home/src/workspaces/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + } + ], + "size": 54 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/index.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/index.ts' is older than output 'dist/index.js' + + + + +Edit [1]:: Normal build without change, that does not block emit on error to show files that get emitted + +tsgo -p /home/src/workspaces/project/tsconfig.json +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/dist/index.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js new file mode 100644 index 0000000000..dd45df80af --- /dev/null +++ b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -0,0 +1,164 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "composite": true + }, +} +//// [/home/src/workspaces/project/types/type.ts] *new* +export type t = string; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/dist/index.d.ts] *new* +export declare const x = 10; + +//// [/home/src/workspaces/project/dist/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./src/index.ts","./types/type.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":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1},{"version":"37c1beee3ff062c5ae875b0377f00093-export type t = string;","signature":"09b8756df8837e9d9dd668b82d3aad6c-export type t = string;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./dist","rootDir":"./src"},"latestChangedDtsFile":"./types/type.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts", + "./types/type.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/index.ts", + "./types/type.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": "./src/index.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./types/type.ts", + "version": "37c1beee3ff062c5ae875b0377f00093-export type t = string;", + "signature": "09b8756df8837e9d9dd668b82d3aad6c-export type t = string;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "37c1beee3ff062c5ae875b0377f00093-export type t = string;", + "signature": "09b8756df8837e9d9dd668b82d3aad6c-export type t = string;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./dist", + "rootDir": "./src" + }, + "latestChangedDtsFile": "./types/type.d.ts", + "size": 1328 +} +//// [/home/src/workspaces/project/types/type.d.ts] *new* +export type t = string; + +//// [/home/src/workspaces/project/types/type.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/index.ts +*refresh* /home/src/workspaces/project/types/type.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/index.ts +(stored at emit) /home/src/workspaces/project/types/type.ts + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'types/type.ts' is older than output 'tsconfig.tsbuildinfo' + + + + +Edit [1]:: Normal build without change, that does not block emit on error to show files that get emitted + +tsgo -p /home/src/workspaces/project/tsconfig.json +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js new file mode 100644 index 0000000000..02a5df8acb --- /dev/null +++ b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js @@ -0,0 +1,109 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + }, +} +//// [/home/src/workspaces/project/types/type.ts] *new* +export type t = string; + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/dist/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./src/index.ts","./types/type.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": "./src/index.ts" + }, + { + "files": [ + "./types/type.ts" + ], + "original": "./types/type.ts" + } + ], + "size": 71 +} +//// [/home/src/workspaces/project/types/type.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/index.ts +*refresh* /home/src/workspaces/project/types/type.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'types/type.ts' is older than output 'dist/index.js' + + + + +Edit [1]:: Normal build without change, that does not block emit on error to show files that get emitted + +tsgo -p /home/src/workspaces/project/tsconfig.json +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/dist/index.js] *rewrite with same content* +//// [/home/src/workspaces/project/types/type.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified.js b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified.js new file mode 100644 index 0000000000..f64edf9e83 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified.js @@ -0,0 +1,95 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + }, +} + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/dist/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./src/index.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": "./src/index.ts" + } + ], + "size": 53 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/index.ts +Signatures:: + + +Edit [0]:: no change + +tsgo -b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/index.ts' is older than output 'dist/index.js' + + + + +Edit [1]:: Normal build without change, that does not block emit on error to show files that get emitted + +tsgo -p /home/src/workspaces/project/tsconfig.json +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/dist/index.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/builds-correctly.js b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/builds-correctly.js new file mode 100644 index 0000000000..ddc7bda5cb --- /dev/null +++ b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/builds-correctly.js @@ -0,0 +1,234 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/main/a.ts] *new* +import { b } from './b'; +const a = b; +//// [/home/src/workspaces/solution/src/main/b.ts] *new* +export const b = 0; +//// [/home/src/workspaces/solution/src/main/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" }, + ], +} +//// [/home/src/workspaces/solution/src/other/other.ts] *new* +export const Other = 0; +//// [/home/src/workspaces/solution/src/other/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true, + }, + "exclude": [ + "node_modules", + ], +} + +tsgo --b src/main /home/src/workspaces/solution/src/other +ExitStatus:: Success +Output:: +//// [/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/dist/main/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/solution/dist/main/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a = b_1.b; + +//// [/home/src/workspaces/solution/dist/main/b.d.ts] *new* +export declare const b = 0; + +//// [/home/src/workspaces/solution/dist/main/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 0; + +//// [/home/src/workspaces/solution/dist/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../src/main/b.ts","../../src/main/a.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":"2f7fab911757709567c90bfcebca3267-export const b = 0;","signature":"fbf340689494c12531e629cae5a8c1a2-export declare const b = 0;\n","impliedNodeFormat":1},{"version":"55c21d13f07678cedb8ef3bdf6dd6c91-import { b } from './b';\nconst a = b;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/solution/dist/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/main/b.ts", + "../../src/main/a.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../src/main/b.ts", + "../../src/main/a.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": "../../src/main/b.ts", + "version": "2f7fab911757709567c90bfcebca3267-export const b = 0;", + "signature": "fbf340689494c12531e629cae5a8c1a2-export declare const b = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2f7fab911757709567c90bfcebca3267-export const b = 0;", + "signature": "fbf340689494c12531e629cae5a8c1a2-export declare const b = 0;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../src/main/a.ts", + "version": "55c21d13f07678cedb8ef3bdf6dd6c91-import { b } from './b';\nconst a = b;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "55c21d13f07678cedb8ef3bdf6dd6c91-import { b } from './b';\nconst a = b;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../src/main/b.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "outDir": "..", + "rootDir": "../../src", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../../src/main/a.ts": [ + "../../src/main/b.ts" + ] + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1418 +} +//// [/home/src/workspaces/solution/dist/other/other.d.ts] *new* +export declare const Other = 0; + +//// [/home/src/workspaces/solution/dist/other/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Other = void 0; +exports.Other = 0; + +//// [/home/src/workspaces/solution/dist/other/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../../src/other/other.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":"d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;","signature":"9820e072d57306b22c4790242196d240-export declare const Other = 0;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipDefaultLibCheck":true},"latestChangedDtsFile":"./other.d.ts"} +//// [/home/src/workspaces/solution/dist/other/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/other/other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../../src/other/other.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": "../../src/other/other.ts", + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "outDir": "..", + "rootDir": "../../src", + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1197 +} + +src/other/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/other/other.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/other/other.ts + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/main/b.ts +*refresh* /home/src/workspaces/solution/src/main/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/main/b.ts +(stored at emit) /home/src/workspaces/solution/src/main/a.ts diff --git a/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js new file mode 100644 index 0000000000..9cf49fe183 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js @@ -0,0 +1,176 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/main/a.ts] *new* +import { b } from './b'; +const a = b; +//// [/home/src/workspaces/solution/src/main/b.ts] *new* +export const b = 0; +//// [/home/src/workspaces/solution/src/main/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" }, + ], +} +//// [/home/src/workspaces/solution/src/other/other.ts] *new* +export const Other = 0; +//// [/home/src/workspaces/solution/src/other/tsconfig.json] *new* +{ + "extends": "../../tsconfig.base.json", +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + + "outDir": "./dist/", + "skipDefaultLibCheck": true, + }, + "exclude": [ + "node_modules", + ], +} + +tsgo --b src/main --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * src/other/tsconfig.json + * src/main/tsconfig.json + +[HH:MM:SS AM] Project 'src/other/tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/other/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/main/tsconfig.json' is out of date because buildinfo file 'dist/tsconfig.tsbuildinfo' indicates that file 'src/other/other.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'src/main/tsconfig.json'... + +src/main/tsconfig.json:4:9 - error TS6377: Cannot write file '/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/home/src/workspaces/solution/src/other' + +4 { "path": "../other" }, +   ~~~~~~~~~~~~~~~~~~~~~~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'src/main/tsconfig.json'... + + +Found 1 error in src/main/tsconfig.json:4 + +//// [/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/dist/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/solution/dist/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a = b_1.b; + +//// [/home/src/workspaces/solution/dist/b.d.ts] *new* +export declare const b = 0; + +//// [/home/src/workspaces/solution/dist/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 0; + +//// [/home/src/workspaces/solution/dist/other.d.ts] *new* +export declare const Other = 0; + +//// [/home/src/workspaces/solution/dist/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Other = void 0; +exports.Other = 0; + +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/other/other.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":"d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;","signature":"9820e072d57306b22c4790242196d240-export declare const Other = 0;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"outDir":"./","skipDefaultLibCheck":true},"latestChangedDtsFile":"./other.d.ts"} +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/other/other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/other/other.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": "../src/other/other.ts", + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "outDir": "./", + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1172 +} + +src/other/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/other/other.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/other/other.ts + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/solution/src/main/b.ts +*not cached* /home/src/workspaces/solution/src/main/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/src/main/b.ts +(computed .d.ts) /home/src/workspaces/solution/src/main/a.ts diff --git a/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental-with-tsc.js b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental-with-tsc.js new file mode 100644 index 0000000000..617813e4ed --- /dev/null +++ b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental-with-tsc.js @@ -0,0 +1,151 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/main/a.ts] *new* +import { b } from './b'; +const a = b; +//// [/home/src/workspaces/solution/src/main/b.ts] *new* +export const b = 0; +//// [/home/src/workspaces/solution/src/main/tsconfig.json] *new* +{ + "compilerOptions": { "outDir": "../../dist/" }, + "references": [{ "path": "../other" }] +} +//// [/home/src/workspaces/solution/src/other/other.ts] *new* +export const Other = 0; +//// [/home/src/workspaces/solution/src/other/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true, + }, + "exclude": [ + "node_modules", + ], +} + +tsgo --b src/other --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src/other/tsconfig.json + +[HH:MM:SS AM] Project 'src/other/tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/other/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/dist/other.d.ts] *new* +export declare const Other = 0; + +//// [/home/src/workspaces/solution/dist/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Other = void 0; +exports.Other = 0; + +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/other/other.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":"d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;","signature":"9820e072d57306b22c4790242196d240-export declare const Other = 0;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./other.d.ts"} +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/other/other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/other/other.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": "../src/other/other.ts", + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1126 +} + +src/other/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/other/other.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/other/other.ts + + +Edit [0]:: Running tsc on main + +tsgo -p src/main +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/solution/dist/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a = b_1.b; + +//// [/home/src/workspaces/solution/dist/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 0; + + diff --git a/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental.js b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental.js new file mode 100644 index 0000000000..94b18a6cf3 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-without-incremental.js @@ -0,0 +1,164 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/main/a.ts] *new* +import { b } from './b'; +const a = b; +//// [/home/src/workspaces/solution/src/main/b.ts] *new* +export const b = 0; +//// [/home/src/workspaces/solution/src/main/tsconfig.json] *new* +{ + "compilerOptions": { "outDir": "../../dist/" }, + "references": [{ "path": "../other" }] +} +//// [/home/src/workspaces/solution/src/other/other.ts] *new* +export const Other = 0; +//// [/home/src/workspaces/solution/src/other/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true, + }, + "exclude": [ + "node_modules", + ], +} + +tsgo --b src/main --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * src/other/tsconfig.json + * src/main/tsconfig.json + +[HH:MM:SS AM] Project 'src/other/tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/other/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/main/tsconfig.json' is out of date because buildinfo file 'dist/tsconfig.tsbuildinfo' indicates that file 'src/other/other.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'src/main/tsconfig.json'... + +src/main/tsconfig.json:3:20 - error TS6377: Cannot write file '/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/home/src/workspaces/solution/src/other' + +3 "references": [{ "path": "../other" }] +   ~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in src/main/tsconfig.json:3 + +//// [/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/dist/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a = b_1.b; + +//// [/home/src/workspaces/solution/dist/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 0; + +//// [/home/src/workspaces/solution/dist/other.d.ts] *new* +export declare const Other = 0; + +//// [/home/src/workspaces/solution/dist/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Other = void 0; +exports.Other = 0; + +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/other/other.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":"d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;","signature":"9820e072d57306b22c4790242196d240-export declare const Other = 0;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./other.d.ts"} +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/other/other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/other/other.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": "../src/other/other.ts", + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1126 +} + +src/other/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/other/other.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/other/other.ts + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/solution/src/main/b.ts +*not cached* /home/src/workspaces/solution/src/main/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/src/main/b.ts +(computed .d.ts) /home/src/workspaces/solution/src/main/a.ts diff --git a/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js new file mode 100644 index 0000000000..28ddef0796 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js @@ -0,0 +1,212 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/main/a.ts] *new* +import { b } from './b'; +const a = b; +//// [/home/src/workspaces/solution/src/main/b.ts] *new* +export const b = 0; +//// [/home/src/workspaces/solution/src/main/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + "references": [{ "path": "../other" }] +} +//// [/home/src/workspaces/solution/src/other/other.ts] *new* +export const Other = 0; +//// [/home/src/workspaces/solution/src/other/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true, + }, + "exclude": [ + "node_modules", + ], +} + +tsgo --b src/main --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * src/other/tsconfig.json + * src/main/tsconfig.json + +[HH:MM:SS AM] Project 'src/other/tsconfig.json' is out of date because output file 'dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/other/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/main/tsconfig.json' is out of date because buildinfo file 'dist/tsconfig.tsbuildinfo' indicates that file 'src/other/other.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'src/main/tsconfig.json'... + +src/main/tsconfig.json:3:20 - error TS6377: Cannot write file '/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/home/src/workspaces/solution/src/other' + +3 "references": [{ "path": "../other" }] +   ~~~~~~~~~~~~~~~~~~~~~~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'src/main/tsconfig.json'... + + +Found 1 error in src/main/tsconfig.json:3 + +//// [/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/dist/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/solution/dist/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a = b_1.b; + +//// [/home/src/workspaces/solution/dist/b.d.ts] *new* +export declare const b = 0; + +//// [/home/src/workspaces/solution/dist/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 0; + +//// [/home/src/workspaces/solution/dist/other.d.ts] *new* +export declare const Other = 0; + +//// [/home/src/workspaces/solution/dist/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Other = void 0; +exports.Other = 0; + +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/other/other.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":"d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;","signature":"9820e072d57306b22c4790242196d240-export declare const Other = 0;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./other.d.ts"} +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/other/other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/other/other.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": "../src/other/other.ts", + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1126 +} + +src/other/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/other/other.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/other/other.ts + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/solution/src/main/b.ts +*not cached* /home/src/workspaces/solution/src/main/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/src/main/b.ts +(computed .d.ts) /home/src/workspaces/solution/src/main/a.ts + + +Edit [0]:: no change + +tsgo --b src/main --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * src/other/tsconfig.json + * src/main/tsconfig.json + +[HH:MM:SS AM] Project 'src/other/tsconfig.json' is up to date because newest input 'src/other/other.ts' is older than output 'dist/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'src/main/tsconfig.json' is out of date because buildinfo file 'dist/tsconfig.tsbuildinfo' indicates that file 'src/other/other.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'src/main/tsconfig.json'... + +src/main/tsconfig.json:3:20 - error TS6377: Cannot write file '/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/home/src/workspaces/solution/src/other' + +3 "references": [{ "path": "../other" }] +   ~~~~~~~~~~~~~~~~~~~~~~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'src/main/tsconfig.json'... + + +Found 1 error in src/main/tsconfig.json:3 + +//// [/home/src/workspaces/solution/dist/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/a.js] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b.js] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/tsconfig.tsbuildinfo] *mTime changed* + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/solution/src/main/b.ts +*not cached* /home/src/workspaces/solution/src/main/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/src/main/b.ts +(computed .d.ts) /home/src/workspaces/solution/src/main/a.ts diff --git a/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js new file mode 100644 index 0000000000..4b8785de11 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js @@ -0,0 +1,254 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/main/a.ts] *new* +import { b } from './b'; +const a = b; +//// [/home/src/workspaces/solution/src/main/b.ts] *new* +export const b = 0; +//// [/home/src/workspaces/solution/src/main/tsconfig.main.json] *new* +{ + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, + "references": [{ "path": "../other/tsconfig.other.json" }] +} +//// [/home/src/workspaces/solution/src/other/other.ts] *new* +export const Other = 0; +//// [/home/src/workspaces/solution/src/other/tsconfig.other.json] *new* +{ + "compilerOptions": { "composite": true, "outDir": "../../dist/" }, +} +//// [/home/src/workspaces/solution/tsconfig.base.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true, + }, + "exclude": [ + "node_modules", + ], +} + +tsgo --b src/main/tsconfig.main.json --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src/other/tsconfig.other.json + * src/main/tsconfig.main.json + +[HH:MM:SS AM] Project 'src/other/tsconfig.other.json' is out of date because output file 'dist/tsconfig.other.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/other/tsconfig.other.json'... + +[HH:MM:SS AM] Project 'src/main/tsconfig.main.json' is out of date because output file 'dist/tsconfig.main.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/main/tsconfig.main.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/dist/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/solution/dist/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a = b_1.b; + +//// [/home/src/workspaces/solution/dist/b.d.ts] *new* +export declare const b = 0; + +//// [/home/src/workspaces/solution/dist/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 0; + +//// [/home/src/workspaces/solution/dist/other.d.ts] *new* +export declare const Other = 0; + +//// [/home/src/workspaces/solution/dist/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Other = void 0; +exports.Other = 0; + +//// [/home/src/workspaces/solution/dist/tsconfig.main.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/main/b.ts","../src/main/a.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":"2f7fab911757709567c90bfcebca3267-export const b = 0;","signature":"fbf340689494c12531e629cae5a8c1a2-export declare const b = 0;\n","impliedNodeFormat":1},{"version":"55c21d13f07678cedb8ef3bdf6dd6c91-import { b } from './b';\nconst a = b;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/solution/dist/tsconfig.main.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/main/b.ts", + "../src/main/a.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/main/b.ts", + "../src/main/a.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": "../src/main/b.ts", + "version": "2f7fab911757709567c90bfcebca3267-export const b = 0;", + "signature": "fbf340689494c12531e629cae5a8c1a2-export declare const b = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2f7fab911757709567c90bfcebca3267-export const b = 0;", + "signature": "fbf340689494c12531e629cae5a8c1a2-export declare const b = 0;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main/a.ts", + "version": "55c21d13f07678cedb8ef3bdf6dd6c91-import { b } from './b';\nconst a = b;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "55c21d13f07678cedb8ef3bdf6dd6c91-import { b } from './b';\nconst a = b;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/main/b.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main/a.ts": [ + "../src/main/b.ts" + ] + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1344 +} +//// [/home/src/workspaces/solution/dist/tsconfig.other.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/other/other.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":"d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;","signature":"9820e072d57306b22c4790242196d240-export declare const Other = 0;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./other.d.ts"} +//// [/home/src/workspaces/solution/dist/tsconfig.other.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/other/other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/other/other.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": "../src/other/other.ts", + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d2f577239ee4ce2c34ee068494c1717b-export const Other = 0;", + "signature": "9820e072d57306b22c4790242196d240-export declare const Other = 0;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1126 +} + +src/other/tsconfig.other.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/other/other.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/other/other.ts + +src/main/tsconfig.main.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/main/b.ts +*refresh* /home/src/workspaces/solution/src/main/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/main/b.ts +(stored at emit) /home/src/workspaces/solution/src/main/a.ts + + +Edit [0]:: no change + +tsgo --b src/main/tsconfig.main.json --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src/other/tsconfig.other.json + * src/main/tsconfig.main.json + +[HH:MM:SS AM] Project 'src/other/tsconfig.other.json' is up to date because newest input 'src/other/other.ts' is older than output 'dist/tsconfig.other.tsbuildinfo' + +[HH:MM:SS AM] Project 'src/main/tsconfig.main.json' is up to date because newest input 'src/main/b.ts' is older than output 'dist/tsconfig.main.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js new file mode 100644 index 0000000000..ebb3b8f37a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js @@ -0,0 +1,111 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "files": [ "src/index.ts", "src/hello.json", ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Part of 'files' list in tsconfig.json +project/src/index.ts + Part of 'files' list in 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/dist/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/index.ts","../src/hello.json"]} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + }, + { + "files": [ + "../src/hello.json" + ], + "original": "../src/hello.json" + } + ], + "size": 74 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js new file mode 100644 index 0000000000..6aeb39923e --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js @@ -0,0 +1,173 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "files": [ "src/index.ts", "src/hello.json", ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/src/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Part of 'files' list in tsconfig.json +project/src/index.ts + Part of 'files' list in 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/dist/src/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/src/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/hello.json","../src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/hello.json", + "../src/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/hello.json", + "../src/index.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": "../src/hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "../src/index.ts", + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../src/index.ts": [ + "../src/hello.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1432 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js new file mode 100644 index 0000000000..03b9663617 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js @@ -0,0 +1,256 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/main/index.ts] *new* +import { foo } from '../strings/foo.json'; +console.log(foo); +//// [/home/src/workspaces/solution/project/main/tsconfig.json] *new* +{ + "extends": "../tsconfig.json", + "include": [ + "./**/*.ts", + ], + "references": [{ + "path": "../strings/tsconfig.json", + }], +} +//// [/home/src/workspaces/solution/project/strings/foo.json] *new* +{ + "foo": "bar baz" +} +//// [/home/src/workspaces/solution/project/strings/tsconfig.json] *new* +{ + "extends": "../tsconfig.json", + "include": ["foo.json"], + "references": [], +} +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "rootDir": "./", + "composite": true, + "resolveJsonModule": true, + "strict": true, + "esModuleInterop": true, + }, + "references": [ + { "path": "./strings/tsconfig.json" }, + { "path": "./main/tsconfig.json" }, + ], + "files": [], +} + +tsgo --b project --verbose --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/strings/tsconfig.json + * project/main/tsconfig.json + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/strings/tsconfig.json' is out of date because output file 'project/strings/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/strings/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/strings/foo.json + Matched by include pattern 'foo.json' in 'project/strings/tsconfig.json' +[HH:MM:SS AM] Project 'project/main/tsconfig.json' is out of date because output file 'project/main/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/main/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/strings/foo.json + Imported via '../strings/foo.json' from file 'project/main/index.ts' +project/main/index.ts + Matched by include pattern './**/*.ts' in 'project/main/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/main/index.d.ts] *new* +export {}; + +//// [/home/src/workspaces/solution/project/main/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const foo_json_1 = require("../strings/foo.json"); +console.log(foo_json_1.foo); + +//// [/home/src/workspaces/solution/project/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../strings/foo.json","./index.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":"0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}"},{"version":"a22713a27f380b4892020f4caa9bb85f-import { foo } from '../strings/foo.json';\nconsole.log(foo);","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"esModuleInterop":true,"module":1,"rootDir":"..","strict":true,"target":1},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/project/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../strings/foo.json", + "./index.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": "../strings/foo.json", + "version": "0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}", + "signature": "0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}" + } + }, + { + "fileName": "./index.ts", + "version": "a22713a27f380b4892020f4caa9bb85f-import { foo } from '../strings/foo.json';\nconsole.log(foo);", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "a22713a27f380b4892020f4caa9bb85f-import { foo } from '../strings/foo.json';\nconsole.log(foo);", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../strings/foo.json" + ] + ], + "options": { + "composite": true, + "esModuleInterop": true, + "module": 1, + "rootDir": "..", + "strict": true, + "target": 1 + }, + "referencedMap": { + "./index.ts": [ + "../strings/foo.json" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1336 +} +//// [/home/src/workspaces/solution/project/strings/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./foo.json"],"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":"0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}"}],"options":{"composite":true,"esModuleInterop":true,"module":1,"rootDir":"..","strict":true,"target":1}} +//// [/home/src/workspaces/solution/project/strings/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./foo.json" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./foo.json" + ], + "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": "./foo.json", + "version": "0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}", + "signature": "0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "0358fbc55b36110a5af2f042a2f514aa-{\n \"foo\": \"bar baz\"\n}" + } + } + ], + "options": { + "composite": true, + "esModuleInterop": true, + "module": 1, + "rootDir": "..", + "strict": true, + "target": 1 + }, + "size": 1041 +} + +project/strings/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/strings/foo.json +Signatures:: + +project/main/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/strings/foo.json +*refresh* /home/src/workspaces/solution/project/main/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/main/index.ts + + +Edit [0]:: no change + +tsgo --b project --verbose --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/strings/tsconfig.json + * project/main/tsconfig.json + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/strings/tsconfig.json' is up to date because newest input 'project/strings/foo.json' is older than output 'project/strings/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project/main/tsconfig.json' is up to date because newest input 'project/main/index.ts' is older than output 'project/main/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js new file mode 100644 index 0000000000..a066b6fa31 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js @@ -0,0 +1,111 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "files": [ "src/hello.json" ], "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Part of 'files' list in tsconfig.json + Imported via "./hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/hello.json","../src/index.ts"]} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/hello.json" + ], + "original": "../src/hello.json" + }, + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + } + ], + "size": 74 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js new file mode 100644 index 0000000000..75c1106d57 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js @@ -0,0 +1,173 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "files": [ "src/hello.json" ], "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/src/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Part of 'files' list in tsconfig.json + Imported via "./hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/src/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/src/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/hello.json","../src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/hello.json", + "../src/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/hello.json", + "../src/index.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": "../src/hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "../src/index.ts", + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../src/index.ts": [ + "../src/hello.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1432 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js new file mode 100644 index 0000000000..b91f4bdf71 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js @@ -0,0 +1,111 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/index.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./index.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*", "src/**/*.json" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/index.json +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/index.json + Imported via "./index.json" from file 'project/src/index.ts' + Matched by include pattern 'src/**/*' in 'project/tsconfig.json' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_json_1 = __importDefault(require("./index.json")); +exports.default = index_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/index.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/index.ts","../src/index.json"]} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + }, + { + "files": [ + "../src/index.json" + ], + "original": "../src/index.json" + } + ], + "size": 74 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/index.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js new file mode 100644 index 0000000000..e809cb4e10 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js @@ -0,0 +1,173 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/index.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./index.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*", "src/**/*.json" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/src/index.json +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/index.json + Imported via "./index.json" from file 'project/src/index.ts' + Matched by include pattern 'src/**/*' in 'project/tsconfig.json' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/src/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_json_1 = __importDefault(require("./index.json")); +exports.default = index_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/src/index.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/index.json","../src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"fe545b3049ca1f2ad9aac3a6ebf9aebb-import hello from \"./index.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.json", + "../src/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/index.json", + "../src/index.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": "../src/index.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "../src/index.ts", + "version": "fe545b3049ca1f2ad9aac3a6ebf9aebb-import hello from \"./index.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "fe545b3049ca1f2ad9aac3a6ebf9aebb-import hello from \"./index.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/index.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../src/index.ts": [ + "../src/index.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1432 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/index.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js new file mode 100644 index 0000000000..1cec780948 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js @@ -0,0 +1,111 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*", "src/**/*.json" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Matched by include pattern 'src/**/*' in 'project/tsconfig.json' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/index.ts","../src/hello.json"]} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + }, + { + "files": [ + "../src/hello.json" + ], + "original": "../src/hello.json" + } + ], + "size": 74 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js new file mode 100644 index 0000000000..dc8239edd9 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js @@ -0,0 +1,173 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*", "src/**/*.json" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/src/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Matched by include pattern 'src/**/*' in 'project/tsconfig.json' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/src/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/src/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/hello.json","../src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/hello.json", + "../src/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/hello.json", + "../src/index.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": "../src/hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "../src/index.ts", + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../src/index.ts": [ + "../src/hello.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1432 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js new file mode 100644 index 0000000000..5bd9751d2b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js @@ -0,0 +1,104 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/index.ts"]} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + } + ], + "size": 54 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-not-in-rootDir-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-not-in-rootDir-non-composite.js new file mode 100644 index 0000000000..ceaab60daa --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-not-in-rootDir-non-composite.js @@ -0,0 +1,98 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "../hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + "rootDir": "src", + }, + "include": [ "src/**/*" ], +} + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/hello.json + Imported via "../hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("../hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./src/index.ts"]} +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": "./src/index.ts" + } + ], + "size": 53 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-not-in-rootDir.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-not-in-rootDir.js new file mode 100644 index 0000000000..02cc15d857 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-not-in-rootDir.js @@ -0,0 +1,163 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "../hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + "rootDir": "src", + }, + "include": [ "src/**/*" ], +} + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/dist/index.d.ts +TSFILE: /home/src/workspaces/solution/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/hello.json + Imported via "../hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("../hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","./hello.json","./src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"a4ada5a36528c3fb01d6f98af94bc507-import hello from \"../hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./dist","rootDir":"./src","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./dist/index.d.ts"} +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "./hello.json", + "./src/index.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": "./hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "./src/index.ts", + "version": "a4ada5a36528c3fb01d6f98af94bc507-import hello from \"../hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "a4ada5a36528c3fb01d6f98af94bc507-import hello from \"../hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./dist", + "rootDir": "./src", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "./src/index.ts": [ + "./hello.json" + ] + }, + "latestChangedDtsFile": "./dist/index.d.ts", + "size": 1446 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js new file mode 100644 index 0000000000..0be2c66141 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js @@ -0,0 +1,107 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "../../hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/project/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +hello.json + Imported via "../../hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' in 'project/tsconfig.json' +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project/tsconfig.json'... + +message TS5074: Failed to update timestamp of file '/home/src/workspaces/solution/project/dist/index.js'. +//// [/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/dist/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/project/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("../../hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/index.ts"]} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + } + ], + "size": 54 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js new file mode 100644 index 0000000000..8a4dc3f779 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory.js @@ -0,0 +1,162 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "../../hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +hello.json + Imported via "../../hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/dist/src/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("../../hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../../hello.json","../src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"6f9721ccc194272bc2b0e0566ab15e63-import hello from \"../../hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../../hello.json", + "../src/index.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": "../../hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "../src/index.ts", + "version": "6f9721ccc194272bc2b0e0566ab15e63-import hello from \"../../hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f9721ccc194272bc2b0e0566ab15e63-import hello from \"../../hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../src/index.ts": [ + "../../hello.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1431 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir-non-composite.js new file mode 100644 index 0000000000..545fcf8cb2 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir-non-composite.js @@ -0,0 +1,98 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/src/index.js +TSFILE: /home/src/workspaces/solution/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./src/index.ts"]} +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": "./src/index.ts" + } + ], + "size": 53 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js new file mode 100644 index 0000000000..29840e7834 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-without-outDir.js @@ -0,0 +1,161 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/src/index.js +TSFILE: /home/src/workspaces/solution/project/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' 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/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","./src/hello.json","./src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/hello.json", + "./src/index.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": "./src/hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "./src/index.ts", + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "./src/index.ts": [ + "./src/hello.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1412 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js new file mode 100644 index 0000000000..8f1b0347f2 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js @@ -0,0 +1,182 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + + }, + "include": [ "src/**/*" ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +project/src/index.ts:1:19 - error TS6307: File '/home/src/workspaces/solution/project/src/hello.json' is not listed within the file list of project '/home/src/workspaces/solution/project/tsconfig.json'. Projects must list all files or use an 'include' pattern. + +1 import hello from "./hello.json" +   ~~~~~~~~~~~~~~ + +TSFILE: /home/src/workspaces/solution/project/dist/src/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' +project/src/index.ts + Matched by include pattern 'src/**/*' in 'project/tsconfig.json' + +Found 1 error in project/src/index.ts:1 + +//// [/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/dist/src/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/src/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[3],"fileNames":["lib.d.ts","../src/hello.json","../src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/hello.json", + "../src/index.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": "../src/hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "../src/index.ts", + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./", + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../src/index.ts": [ + "../src/hello.json" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../src/hello.json", + "../src/index.ts" + ], + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1479 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/solution/project/src/hello.json +*not cached* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap-non-composite.js new file mode 100644 index 0000000000..f879030840 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap-non-composite.js @@ -0,0 +1,127 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + "sourceMap": true, + }, + "files": [ "src/index.ts", "src/hello.json", ], +} + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/index.js.map +TSFILE: /home/src/workspaces/solution/project/dist/index.js +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Part of 'files' list in tsconfig.json +project/src/index.ts + Part of 'files' list in 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/dist/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; +//# sourceMappingURL=index.js.map +//// [/home/src/workspaces/solution/project/dist/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,8DAAgC;kBACjB,oBAAK,CAAC,KAAK"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../src/index.ts","../src/hello.json"]} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/index.ts" + ], + "original": "../src/index.ts" + }, + { + "files": [ + "../src/hello.json" + ], + "original": "../src/hello.json" + } + ], + "size": 74 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is up to date because newest input 'project/src/index.ts' is older than output 'project/dist/hello.json' + + diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js new file mode 100644 index 0000000000..cf389624e5 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js @@ -0,0 +1,190 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true, + "sourceMap": true, + }, + "files": [ "src/index.ts", "src/hello.json", ], +} + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/dist/src/hello.json +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js.map +TSFILE: /home/src/workspaces/solution/project/dist/src/index.js +TSFILE: /home/src/workspaces/solution/project/dist/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Part of 'files' list in tsconfig.json +project/src/index.ts + Part of 'files' list in 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/dist/src/hello.json] *new* +{ + "hello": "world" +} + +//// [/home/src/workspaces/solution/project/dist/src/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/dist/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; +//# sourceMappingURL=index.js.map +//// [/home/src/workspaces/solution/project/dist/src/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AAAA,8DAAgC;kBACjB,oBAAK,CAAC,KAAK"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/hello.json","../src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/hello.json", + "../src/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/hello.json", + "../src/index.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": "../src/hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "../src/index.ts", + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../src/hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "outDir": "./", + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "../src/index.ts": [ + "../src/hello.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1449 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts + + +Edit [0]:: no change + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is up to date because newest input 'project/src/index.ts' is older than output 'project/dist/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir-non-composite.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir-non-composite.js new file mode 100644 index 0000000000..a6a4b93f44 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir-non-composite.js @@ -0,0 +1,118 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": false, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + "skipDefaultLibCheck": true, + + }, + "files": [ "src/index.ts", "src/hello.json", ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/src/index.js +TSFILE: /home/src/workspaces/solution/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Part of 'files' list in tsconfig.json +project/src/index.ts + Part of 'files' list in 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/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./src/index.ts","./src/hello.json"]} +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": "./src/index.ts" + }, + { + "files": [ + "./src/hello.json" + ], + "original": "./src/hello.json" + } + ], + "size": 72 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is up to date because newest input 'project/src/index.ts' is older than output 'project/src/index.js' + + diff --git a/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js new file mode 100644 index 0000000000..01b7cb87c6 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js @@ -0,0 +1,179 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project/src/hello.json] *new* +{ + "hello": "world" +} +//// [/home/src/workspaces/solution/project/src/index.ts] *new* +import hello from "./hello.json" +export default hello.hello +//// [/home/src/workspaces/solution/project/tsconfig.json] *new* + { + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + "skipDefaultLibCheck": true, + + }, + "files": [ "src/index.ts", "src/hello.json", ], + } + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is out of date because output file 'project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project/tsconfig.json'... + +TSFILE: /home/src/workspaces/solution/project/src/index.js +TSFILE: /home/src/workspaces/solution/project/src/index.d.ts +TSFILE: /home/src/workspaces/solution/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project/src/hello.json + Imported via "./hello.json" from file 'project/src/index.ts' + Part of 'files' list in tsconfig.json +project/src/index.ts + Part of 'files' list in 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/index.d.ts] *new* +declare const _default: string; +export default _default; + +//// [/home/src/workspaces/solution/project/src/index.js] *new* +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const hello_json_1 = __importDefault(require("./hello.json")); +exports.default = hello_json_1.default.hello; + +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./src/hello.json","./src/index.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":"18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}"},{"version":"c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello","signature":"a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/index.d.ts"} +//// [/home/src/workspaces/solution/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/hello.json", + "./src/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/hello.json", + "./src/index.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": "./src/hello.json", + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "signature": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}", + "impliedNodeFormat": "None", + "original": { + "version": "18e7247c85a6a2e7a4ec2e284716edd8-{\n \"hello\": \"world\"\n}" + } + }, + { + "fileName": "./src/index.ts", + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c15eb6733af1bd811cd113368bb377e5-import hello from \"./hello.json\"\nexport default hello.hello", + "signature": "a44184f4ac1ed50126ac624c885b51a8-declare const _default: string;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/hello.json" + ] + ], + "options": { + "allowSyntheticDefaultImports": true, + "composite": true, + "esModuleInterop": true, + "module": 1, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "./src/index.ts": [ + "./src/hello.json" + ] + }, + "latestChangedDtsFile": "./src/index.d.ts", + "size": 1416 +} + +project/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project/src/hello.json +*refresh* /home/src/workspaces/solution/project/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project/src/index.ts + + +Edit [0]:: no change + +tsgo --b project --v --explainFiles --listEmittedFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project/tsconfig.json + +[HH:MM:SS AM] Project 'project/tsconfig.json' is up to date because newest input 'project/src/index.ts' is older than output 'project/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/roots/when-consecutive-and-non-consecutive-are-mixed.js b/testdata/baselines/reference/tsbuild/roots/when-consecutive-and-non-consecutive-are-mixed.js new file mode 100644 index 0000000000..dc06e690be --- /dev/null +++ b/testdata/baselines/reference/tsbuild/roots/when-consecutive-and-non-consecutive-are-mixed.js @@ -0,0 +1,535 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/anotherNonConsecutive.ts] *new* +import { random } from "./random2"; +export const nonConsecutive = "hello"; +//// [/home/src/workspaces/project/asArray1.ts] *new* +import { random } from "./random1"; +export const x = "hello"; +//// [/home/src/workspaces/project/asArray2.ts] *new* +export const x = "hello"; +//// [/home/src/workspaces/project/asArray3.ts] *new* +export const x = "hello"; +//// [/home/src/workspaces/project/file1.ts] *new* +export const x = "hello"; +//// [/home/src/workspaces/project/file2.ts] *new* +export const y = "world"; +//// [/home/src/workspaces/project/nonconsecutive.ts] *new* +import { random } from "./random"; + export const nonConsecutive = "hello"; +//// [/home/src/workspaces/project/random.d.ts] *new* +export const random = "hello"; +//// [/home/src/workspaces/project/random1.d.ts] *new* +export const random = "hello"; +//// [/home/src/workspaces/project/random2.d.ts] *new* +export const random = "hello"; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "include": ["file*.ts", "nonconsecutive*.ts", "asArray*.ts", "anotherNonConsecutive.ts"], +} + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/anotherNonConsecutive.d.ts] *new* +export declare const nonConsecutive = "hello"; + +//// [/home/src/workspaces/project/anotherNonConsecutive.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.nonConsecutive = void 0; +exports.nonConsecutive = "hello"; + +//// [/home/src/workspaces/project/asArray1.d.ts] *new* +export declare const x = "hello"; + +//// [/home/src/workspaces/project/asArray1.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "hello"; + +//// [/home/src/workspaces/project/asArray2.d.ts] *new* +export declare const x = "hello"; + +//// [/home/src/workspaces/project/asArray2.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "hello"; + +//// [/home/src/workspaces/project/asArray3.d.ts] *new* +export declare const x = "hello"; + +//// [/home/src/workspaces/project/asArray3.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "hello"; + +//// [/home/src/workspaces/project/file1.d.ts] *new* +export declare const x = "hello"; + +//// [/home/src/workspaces/project/file1.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "hello"; + +//// [/home/src/workspaces/project/file2.d.ts] *new* +export declare const y = "world"; + +//// [/home/src/workspaces/project/file2.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = "world"; + +//// [/home/src/workspaces/project/nonconsecutive.d.ts] *new* +export declare const nonConsecutive = "hello"; + +//// [/home/src/workspaces/project/nonconsecutive.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.nonConsecutive = void 0; +exports.nonConsecutive = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3],5,[7,9],11],"fileNames":["lib.d.ts","./file1.ts","./file2.ts","./random.d.ts","./nonconsecutive.ts","./random1.d.ts","./asArray1.ts","./asArray2.ts","./asArray3.ts","./random2.d.ts","./anotherNonConsecutive.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":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},{"version":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1},"cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";",{"version":"805bd15692edf65c8f946bb322e0a876-import { random } from \"./random\";\n export const nonConsecutive = \"hello\";","signature":"ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n","impliedNodeFormat":1},"cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";",{"version":"f1ff3ce44c97592c5ef5a510c8ed269d-import { random } from \"./random1\";\nexport const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},{"version":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},{"version":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},"cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";",{"version":"f5ecedece6d42fea3feb8b5832aacd89-import { random } from \"./random2\";\nexport const nonConsecutive = \"hello\";","signature":"ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n","impliedNodeFormat":1}],"fileIdsList":[[10],[6],[4]],"options":{"composite":true},"referencedMap":[[11,1],[7,2],[5,3]],"latestChangedDtsFile":"./anotherNonConsecutive.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file1.ts", + "./file2.ts" + ], + "original": [ + 2, + 3 + ] + }, + { + "files": [ + "./nonconsecutive.ts" + ], + "original": 5 + }, + { + "files": [ + "./asArray1.ts", + "./asArray2.ts", + "./asArray3.ts" + ], + "original": [ + 7, + 9 + ] + }, + { + "files": [ + "./anotherNonConsecutive.ts" + ], + "original": 11 + } + ], + "fileNames": [ + "lib.d.ts", + "./file1.ts", + "./file2.ts", + "./random.d.ts", + "./nonconsecutive.ts", + "./random1.d.ts", + "./asArray1.ts", + "./asArray2.ts", + "./asArray3.ts", + "./random2.d.ts", + "./anotherNonConsecutive.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": "./file1.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./random.d.ts", + "version": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "signature": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./nonconsecutive.ts", + "version": "805bd15692edf65c8f946bb322e0a876-import { random } from \"./random\";\n export const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "805bd15692edf65c8f946bb322e0a876-import { random } from \"./random\";\n export const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./random1.d.ts", + "version": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "signature": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./asArray1.ts", + "version": "f1ff3ce44c97592c5ef5a510c8ed269d-import { random } from \"./random1\";\nexport const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f1ff3ce44c97592c5ef5a510c8ed269d-import { random } from \"./random1\";\nexport const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./asArray2.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./asArray3.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./random2.d.ts", + "version": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "signature": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./anotherNonConsecutive.ts", + "version": "f5ecedece6d42fea3feb8b5832aacd89-import { random } from \"./random2\";\nexport const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5ecedece6d42fea3feb8b5832aacd89-import { random } from \"./random2\";\nexport const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./random2.d.ts" + ], + [ + "./random1.d.ts" + ], + [ + "./random.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./anotherNonConsecutive.ts": [ + "./random2.d.ts" + ], + "./asArray1.ts": [ + "./random1.d.ts" + ], + "./nonconsecutive.ts": [ + "./random.d.ts" + ] + }, + "latestChangedDtsFile": "./anotherNonConsecutive.d.ts", + "size": 2836 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/file1.ts +*refresh* /home/src/workspaces/project/file2.ts +*refresh* /home/src/workspaces/project/random.d.ts +*refresh* /home/src/workspaces/project/nonconsecutive.ts +*refresh* /home/src/workspaces/project/random1.d.ts +*refresh* /home/src/workspaces/project/asArray1.ts +*refresh* /home/src/workspaces/project/asArray2.ts +*refresh* /home/src/workspaces/project/asArray3.ts +*refresh* /home/src/workspaces/project/random2.d.ts +*refresh* /home/src/workspaces/project/anotherNonConsecutive.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/file1.ts +(stored at emit) /home/src/workspaces/project/file2.ts +(stored at emit) /home/src/workspaces/project/nonconsecutive.ts +(stored at emit) /home/src/workspaces/project/asArray1.ts +(stored at emit) /home/src/workspaces/project/asArray2.ts +(stored at emit) /home/src/workspaces/project/asArray3.ts +(stored at emit) /home/src/workspaces/project/anotherNonConsecutive.ts + + +Edit [0]:: delete file1 +//// [/home/src/workspaces/project/file1.d.ts] *deleted* +//// [/home/src/workspaces/project/file1.js] *deleted* +//// [/home/src/workspaces/project/file1.ts] *deleted* + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that file 'file1.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2,4,[6,8],10],"fileNames":["lib.d.ts","./file2.ts","./random.d.ts","./nonconsecutive.ts","./random1.d.ts","./asArray1.ts","./asArray2.ts","./asArray3.ts","./random2.d.ts","./anotherNonConsecutive.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":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1},"cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";",{"version":"805bd15692edf65c8f946bb322e0a876-import { random } from \"./random\";\n export const nonConsecutive = \"hello\";","signature":"ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n","impliedNodeFormat":1},"cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";",{"version":"f1ff3ce44c97592c5ef5a510c8ed269d-import { random } from \"./random1\";\nexport const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},{"version":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},{"version":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},"cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";",{"version":"f5ecedece6d42fea3feb8b5832aacd89-import { random } from \"./random2\";\nexport const nonConsecutive = \"hello\";","signature":"ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n","impliedNodeFormat":1}],"fileIdsList":[[9],[5],[3]],"options":{"composite":true},"referencedMap":[[10,1],[6,2],[4,3]],"latestChangedDtsFile":"./anotherNonConsecutive.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file2.ts" + ], + "original": 2 + }, + { + "files": [ + "./nonconsecutive.ts" + ], + "original": 4 + }, + { + "files": [ + "./asArray1.ts", + "./asArray2.ts", + "./asArray3.ts" + ], + "original": [ + 6, + 8 + ] + }, + { + "files": [ + "./anotherNonConsecutive.ts" + ], + "original": 10 + } + ], + "fileNames": [ + "lib.d.ts", + "./file2.ts", + "./random.d.ts", + "./nonconsecutive.ts", + "./random1.d.ts", + "./asArray1.ts", + "./asArray2.ts", + "./asArray3.ts", + "./random2.d.ts", + "./anotherNonConsecutive.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": "./file2.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./random.d.ts", + "version": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "signature": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./nonconsecutive.ts", + "version": "805bd15692edf65c8f946bb322e0a876-import { random } from \"./random\";\n export const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "805bd15692edf65c8f946bb322e0a876-import { random } from \"./random\";\n export const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./random1.d.ts", + "version": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "signature": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./asArray1.ts", + "version": "f1ff3ce44c97592c5ef5a510c8ed269d-import { random } from \"./random1\";\nexport const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f1ff3ce44c97592c5ef5a510c8ed269d-import { random } from \"./random1\";\nexport const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./asArray2.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./asArray3.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./random2.d.ts", + "version": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "signature": "cc6fd496b46fb211a7b922d3e31cdc4e-export const random = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./anotherNonConsecutive.ts", + "version": "f5ecedece6d42fea3feb8b5832aacd89-import { random } from \"./random2\";\nexport const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5ecedece6d42fea3feb8b5832aacd89-import { random } from \"./random2\";\nexport const nonConsecutive = \"hello\";", + "signature": "ed1a51017d86c01f126fd5c93a77072d-export declare const nonConsecutive = \"hello\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./random2.d.ts" + ], + [ + "./random1.d.ts" + ], + [ + "./random.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./anotherNonConsecutive.ts": [ + "./random2.d.ts" + ], + "./asArray1.ts": [ + "./random1.d.ts" + ], + "./nonconsecutive.ts": [ + "./random.d.ts" + ] + }, + "latestChangedDtsFile": "./anotherNonConsecutive.d.ts", + "size": 2636 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/roots/when-files-are-not-consecutive.js b/testdata/baselines/reference/tsbuild/roots/when-files-are-not-consecutive.js new file mode 100644 index 0000000000..9a30b979d9 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/roots/when-files-are-not-consecutive.js @@ -0,0 +1,246 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/file1.ts] *new* +export const x = "hello"; +//// [/home/src/workspaces/project/file2.ts] *new* +import { random } from "./random"; +export const y = "world"; +//// [/home/src/workspaces/project/random.d.ts] *new* +export const random = "world"; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "include": ["file*.ts"], +} + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/file1.d.ts] *new* +export declare const x = "hello"; + +//// [/home/src/workspaces/project/file1.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "hello"; + +//// [/home/src/workspaces/project/file2.d.ts] *new* +export declare const y = "world"; + +//// [/home/src/workspaces/project/file2.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = "world"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2,4],"fileNames":["lib.d.ts","./file1.ts","./random.d.ts","./file2.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":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},"c532960cfbb52b79226b1f24e7a00dee-export const random = \"world\";",{"version":"451897c48dcc1d64ace3fbee4cc28ab8-import { random } from \"./random\";\nexport const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./file2.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file1.ts" + ], + "original": 2 + }, + { + "files": [ + "./file2.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "./file1.ts", + "./random.d.ts", + "./file2.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": "./file1.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./random.d.ts", + "version": "c532960cfbb52b79226b1f24e7a00dee-export const random = \"world\";", + "signature": "c532960cfbb52b79226b1f24e7a00dee-export const random = \"world\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./file2.ts", + "version": "451897c48dcc1d64ace3fbee4cc28ab8-import { random } from \"./random\";\nexport const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "451897c48dcc1d64ace3fbee4cc28ab8-import { random } from \"./random\";\nexport const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./random.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./file2.ts": [ + "./random.d.ts" + ] + }, + "latestChangedDtsFile": "./file2.d.ts", + "size": 1472 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/file1.ts +*refresh* /home/src/workspaces/project/random.d.ts +*refresh* /home/src/workspaces/project/file2.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/file1.ts +(stored at emit) /home/src/workspaces/project/file2.ts + + +Edit [0]:: delete file1 +//// [/home/src/workspaces/project/file1.d.ts] *deleted* +//// [/home/src/workspaces/project/file1.js] *deleted* +//// [/home/src/workspaces/project/file1.ts] *deleted* + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that file 'file1.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","./random.d.ts","./file2.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},"c532960cfbb52b79226b1f24e7a00dee-export const random = \"world\";",{"version":"451897c48dcc1d64ace3fbee4cc28ab8-import { random } from \"./random\";\nexport const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./file2.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file2.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "./random.d.ts", + "./file2.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": "./random.d.ts", + "version": "c532960cfbb52b79226b1f24e7a00dee-export const random = \"world\";", + "signature": "c532960cfbb52b79226b1f24e7a00dee-export const random = \"world\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./file2.ts", + "version": "451897c48dcc1d64ace3fbee4cc28ab8-import { random } from \"./random\";\nexport const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "451897c48dcc1d64ace3fbee4cc28ab8-import { random } from \"./random\";\nexport const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./random.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./file2.ts": [ + "./random.d.ts" + ] + }, + "latestChangedDtsFile": "./file2.d.ts", + "size": 1275 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/roots/when-multiple-root-files-are-consecutive.js b/testdata/baselines/reference/tsbuild/roots/when-multiple-root-files-are-consecutive.js new file mode 100644 index 0000000000..5a33c66b61 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/roots/when-multiple-root-files-are-consecutive.js @@ -0,0 +1,287 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/file1.ts] *new* +export const x = "hello"; +//// [/home/src/workspaces/project/file2.ts] *new* +export const y = "world"; +//// [/home/src/workspaces/project/file3.ts] *new* +export const y = "world"; +//// [/home/src/workspaces/project/file4.ts] *new* +export const y = "world"; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "include": ["*.ts"], +} + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/file1.d.ts] *new* +export declare const x = "hello"; + +//// [/home/src/workspaces/project/file1.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "hello"; + +//// [/home/src/workspaces/project/file2.d.ts] *new* +export declare const y = "world"; + +//// [/home/src/workspaces/project/file2.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = "world"; + +//// [/home/src/workspaces/project/file3.d.ts] *new* +export declare const y = "world"; + +//// [/home/src/workspaces/project/file3.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = "world"; + +//// [/home/src/workspaces/project/file4.d.ts] *new* +export declare const y = "world"; + +//// [/home/src/workspaces/project/file4.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = "world"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./file1.ts","./file2.ts","./file3.ts","./file4.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":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},{"version":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1},{"version":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1},{"version":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./file4.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file1.ts", + "./file2.ts", + "./file3.ts", + "./file4.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./file1.ts", + "./file2.ts", + "./file3.ts", + "./file4.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": "./file1.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file3.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file4.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./file4.d.ts", + "size": 1698 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/file1.ts +*refresh* /home/src/workspaces/project/file2.ts +*refresh* /home/src/workspaces/project/file3.ts +*refresh* /home/src/workspaces/project/file4.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/file1.ts +(stored at emit) /home/src/workspaces/project/file2.ts +(stored at emit) /home/src/workspaces/project/file3.ts +(stored at emit) /home/src/workspaces/project/file4.ts + + +Edit [0]:: delete file1 +//// [/home/src/workspaces/project/file1.d.ts] *deleted* +//// [/home/src/workspaces/project/file1.js] *deleted* +//// [/home/src/workspaces/project/file1.ts] *deleted* + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that file 'file1.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./file2.ts","./file3.ts","./file4.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":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1},{"version":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1},{"version":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./file4.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file2.ts", + "./file3.ts", + "./file4.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./file2.ts", + "./file3.ts", + "./file4.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": "./file2.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file3.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file4.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./file4.d.ts", + "size": 1503 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js b/testdata/baselines/reference/tsbuild/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js new file mode 100644 index 0000000000..490ebbdb4b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js @@ -0,0 +1,884 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/projects/server/src/server.ts] *new* +import { MyClass } from ':shared/myClass.js'; +console.log('Hello, world!'); +//// [/home/src/workspaces/solution/projects/server/tsconfig.json] *new* +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "..", + "outDir": "./dist", + "paths": { + ":shared/*": ["./src/../../shared/src/*"], + }, + }, + "include": [ "../shared/src/**/*.ts", "src/**/*.ts" ], + "references": [ + { "path": "../shared" }, + ], +} +//// [/home/src/workspaces/solution/projects/shared/src/logging.ts] *new* +export function log(str: string) { + console.log(str); +} +//// [/home/src/workspaces/solution/projects/shared/src/myClass.ts] *new* +export class MyClass { } +//// [/home/src/workspaces/solution/projects/shared/src/random.ts] *new* +export function randomFn(str: string) { + console.log(str); +} +//// [/home/src/workspaces/solution/projects/shared/tsconfig.json] *new* +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + }, + "include": ["src/**/*.ts"], +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "projects/server" }, + { "path": "projects/shared" }, + ], +} + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is out of date because output file 'projects/shared/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'projects/shared/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/src/logging.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/myClass.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/random.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is out of date because output file 'projects/server/dist/server/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'projects/server/tsconfig.json'... + +======== Resolving module ':shared/myClass.js' from '/home/src/workspaces/solution/projects/server/src/server.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name ':shared/myClass.js'. +Module name ':shared/myClass.js', matched pattern ':shared/*'. +Trying substitution './src/../../shared/src/*', candidate module location: './src/../../shared/src/myClass.js'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/projects/shared/src/myClass.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/home/src/workspaces/solution/projects/shared/src/myClass.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/solution/projects/shared/src/myClass.ts' exists - use it as a name resolution result. +======== Module name ':shared/myClass.js' was successfully resolved to '/home/src/workspaces/solution/projects/shared/src/myClass.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/dist/src/logging.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/logging.ts' +projects/shared/dist/src/myClass.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/myClass.ts' +projects/shared/dist/src/random.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/random.ts' +projects/server/src/server.ts + Matched by include pattern 'src/**/*.ts' in 'projects/server/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/projects/server/dist/server/src/server.d.ts] *new* +export {}; + +//// [/home/src/workspaces/solution/projects/server/dist/server/src/server.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log('Hello, world!'); + +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","../../../shared/dist/src/logging.d.ts","../../../shared/dist/src/myClass.d.ts","../../../shared/dist/src/random.d.ts","../../src/server.ts","../../../shared/src/logging.ts","../../../shared/src/myClass.ts","../../../shared/src/random.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},"380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n","21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n",{"version":"12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true,"outDir":"..","rootDir":"../../.."},"referencedMap":[[5,1]],"latestChangedDtsFile":"./src/server.d.ts","resolvedRoot":[[2,6],[3,7],[4,8]]} +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/dist/src/random.d.ts", + "../../src/server.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/dist/src/random.d.ts", + "../../src/server.ts", + "../../../shared/src/logging.ts", + "../../../shared/src/myClass.ts", + "../../../shared/src/random.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": "../../../shared/dist/src/logging.d.ts", + "version": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "signature": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../shared/dist/src/myClass.d.ts", + "version": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../shared/dist/src/random.d.ts", + "version": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../src/server.ts", + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../../shared/dist/src/myClass.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../.." + }, + "referencedMap": { + "../../src/server.ts": [ + "../../../shared/dist/src/myClass.d.ts" + ] + }, + "latestChangedDtsFile": "./src/server.d.ts", + "resolvedRoot": [ + [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/src/logging.ts" + ], + [ + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/src/myClass.ts" + ], + [ + "../../../shared/dist/src/random.d.ts", + "../../../shared/src/random.ts" + ] + ], + "size": 1728 +} +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts] *new* +export declare function log(str: string): void; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.log = log; +function log(str) { + console.log(str); +} + +//// [/home/src/workspaces/solution/projects/shared/dist/src/myClass.d.ts] *new* +export declare class MyClass { +} + +//// [/home/src/workspaces/solution/projects/shared/dist/src/myClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MyClass = void 0; +class MyClass { +} +exports.MyClass = MyClass; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/random.d.ts] *new* +export declare function randomFn(str: string): void; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/random.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.randomFn = randomFn; +function randomFn(str) { + console.log(str); +} + +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../src/logging.ts","../src/myClass.ts","../src/random.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":"e8c4594410128d4531f2321647cc451d-export function log(str: string) {\n console.log(str);\n}","signature":"380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n","impliedNodeFormat":1},{"version":"22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }","signature":"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","impliedNodeFormat":1},{"version":"4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}","signature":"1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/random.d.ts"} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.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": "../src/logging.ts", + "version": "e8c4594410128d4531f2321647cc451d-export function log(str: string) {\n console.log(str);\n}", + "signature": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8c4594410128d4531f2321647cc451d-export function log(str: string) {\n console.log(str);\n}", + "signature": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/myClass.ts", + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/random.ts", + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/random.d.ts", + "size": 1637 +} + +projects/shared/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/projects/shared/src/logging.ts +*refresh* /home/src/workspaces/solution/projects/shared/src/myClass.ts +*refresh* /home/src/workspaces/solution/projects/shared/src/random.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/projects/shared/src/logging.ts +(stored at emit) /home/src/workspaces/solution/projects/shared/src/myClass.ts +(stored at emit) /home/src/workspaces/solution/projects/shared/src/random.ts + +projects/server/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/myClass.d.ts +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/random.d.ts +*refresh* /home/src/workspaces/solution/projects/server/src/server.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/projects/server/src/server.ts + + +Edit [0]:: no change + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is up to date because newest input 'projects/shared/src/random.ts' is older than output 'projects/shared/dist/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is up to date because newest input 'projects/shared/src/random.ts' is older than output 'projects/server/dist/server/tsconfig.tsbuildinfo' + + + + +Edit [1]:: edit logging file +//// [/home/src/workspaces/solution/projects/shared/src/logging.ts] *modified* +export function log(str: string) { + console.log(str); +}export const x = 10; + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is out of date because output 'projects/shared/dist/tsconfig.tsbuildinfo' is older than input 'projects/shared/src/logging.ts' + +[HH:MM:SS AM] Building project 'projects/shared/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/src/logging.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/myClass.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/random.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is out of date because output 'projects/server/dist/server/tsconfig.tsbuildinfo' is older than input 'projects/shared/src/logging.ts' + +[HH:MM:SS AM] Building project 'projects/server/tsconfig.json'... + +======== Resolving module ':shared/myClass.js' from '/home/src/workspaces/solution/projects/server/src/server.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name ':shared/myClass.js'. +Module name ':shared/myClass.js', matched pattern ':shared/*'. +Trying substitution './src/../../shared/src/*', candidate module location: './src/../../shared/src/myClass.js'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/projects/shared/src/myClass.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/home/src/workspaces/solution/projects/shared/src/myClass.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/solution/projects/shared/src/myClass.ts' exists - use it as a name resolution result. +======== Module name ':shared/myClass.js' was successfully resolved to '/home/src/workspaces/solution/projects/shared/src/myClass.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/dist/src/logging.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/logging.ts' +projects/shared/dist/src/myClass.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/myClass.ts' +projects/shared/dist/src/random.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/random.ts' +projects/server/src/server.ts + Matched by include pattern 'src/**/*.ts' in 'projects/server/tsconfig.json' +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","../../../shared/dist/src/logging.d.ts","../../../shared/dist/src/myClass.d.ts","../../../shared/dist/src/random.d.ts","../../src/server.ts","../../../shared/src/logging.ts","../../../shared/src/myClass.ts","../../../shared/src/random.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},"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n","21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n",{"version":"12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true,"outDir":"..","rootDir":"../../.."},"referencedMap":[[5,1]],"latestChangedDtsFile":"./src/server.d.ts","resolvedRoot":[[2,6],[3,7],[4,8]]} +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/dist/src/random.d.ts", + "../../src/server.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/dist/src/random.d.ts", + "../../src/server.ts", + "../../../shared/src/logging.ts", + "../../../shared/src/myClass.ts", + "../../../shared/src/random.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": "../../../shared/dist/src/logging.d.ts", + "version": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../shared/dist/src/myClass.d.ts", + "version": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../shared/dist/src/random.d.ts", + "version": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../src/server.ts", + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../../shared/dist/src/myClass.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../.." + }, + "referencedMap": { + "../../src/server.ts": [ + "../../../shared/dist/src/myClass.d.ts" + ] + }, + "latestChangedDtsFile": "./src/server.d.ts", + "resolvedRoot": [ + [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/src/logging.ts" + ], + [ + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/src/myClass.ts" + ], + [ + "../../../shared/dist/src/random.d.ts", + "../../../shared/src/random.ts" + ] + ], + "size": 1758 +} +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts] *modified* +export declare function log(str: string): void; +export declare const x = 10; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.log = log; +function log(str) { + console.log(str); +} +exports.x = 10; + +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../src/logging.ts","../src/myClass.ts","../src/random.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":"107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;","signature":"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n","impliedNodeFormat":1},{"version":"22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }","signature":"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","impliedNodeFormat":1},{"version":"4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}","signature":"1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/logging.d.ts"} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.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": "../src/logging.ts", + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/myClass.ts", + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/random.ts", + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/logging.d.ts", + "size": 1688 +} + +projects/shared/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/projects/shared/src/logging.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/projects/shared/src/logging.ts + +projects/server/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +Signatures:: +(used version) /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts + + +Edit [2]:: no change + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/shared/dist/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/server/dist/server/tsconfig.tsbuildinfo' + + + + +Edit [3]:: delete random file +//// [/home/src/workspaces/solution/projects/shared/src/random.ts] *deleted* + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is out of date because buildinfo file 'projects/shared/dist/tsconfig.tsbuildinfo' indicates that file 'projects/shared/src/random.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'projects/shared/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/src/logging.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/myClass.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is out of date because buildinfo file 'projects/server/dist/server/tsconfig.tsbuildinfo' indicates that file 'projects/shared/src/random.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'projects/server/tsconfig.json'... + +======== Resolving module ':shared/myClass.js' from '/home/src/workspaces/solution/projects/server/src/server.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name ':shared/myClass.js'. +Module name ':shared/myClass.js', matched pattern ':shared/*'. +Trying substitution './src/../../shared/src/*', candidate module location: './src/../../shared/src/myClass.js'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/projects/shared/src/myClass.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/home/src/workspaces/solution/projects/shared/src/myClass.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/solution/projects/shared/src/myClass.ts' exists - use it as a name resolution result. +======== Module name ':shared/myClass.js' was successfully resolved to '/home/src/workspaces/solution/projects/shared/src/myClass.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/dist/src/logging.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/logging.ts' +projects/shared/dist/src/myClass.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/myClass.ts' +projects/server/src/server.ts + Matched by include pattern 'src/**/*.ts' in 'projects/server/tsconfig.json' +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../../../shared/dist/src/logging.d.ts","../../../shared/dist/src/myClass.d.ts","../../src/server.ts","../../../shared/src/logging.ts","../../../shared/src/myClass.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},"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n","21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n",{"version":"12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true,"outDir":"..","rootDir":"../../.."},"referencedMap":[[4,1]],"latestChangedDtsFile":"./src/server.d.ts","resolvedRoot":[[2,5],[3,6]]} +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts", + "../../../shared/src/logging.ts", + "../../../shared/src/myClass.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": "../../../shared/dist/src/logging.d.ts", + "version": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../shared/dist/src/myClass.d.ts", + "version": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../src/server.ts", + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../../shared/dist/src/myClass.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../.." + }, + "referencedMap": { + "../../src/server.ts": [ + "../../../shared/dist/src/myClass.d.ts" + ] + }, + "latestChangedDtsFile": "./src/server.d.ts", + "resolvedRoot": [ + [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/src/logging.ts" + ], + [ + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/src/myClass.ts" + ] + ], + "size": 1591 +} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/logging.ts","../src/myClass.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":"107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;","signature":"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n","impliedNodeFormat":1},{"version":"22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }","signature":"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/logging.d.ts"} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/logging.ts", + "../src/myClass.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/logging.ts", + "../src/myClass.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": "../src/logging.ts", + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/myClass.ts", + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/logging.d.ts", + "size": 1432 +} + +projects/shared/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +projects/server/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/shared/dist/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/server/dist/server/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/roots/when-root-file-is-from-referenced-project.js b/testdata/baselines/reference/tsbuild/roots/when-root-file-is-from-referenced-project.js new file mode 100644 index 0000000000..3286e84fd3 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/roots/when-root-file-is-from-referenced-project.js @@ -0,0 +1,884 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/projects/server/src/server.ts] *new* +import { MyClass } from ':shared/myClass.js'; +console.log('Hello, world!'); +//// [/home/src/workspaces/solution/projects/server/tsconfig.json] *new* +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "..", + "outDir": "./dist", + "paths": { + ":shared/*": ["./src/../../shared/src/*"], + }, + }, + "include": [ "src/**/*.ts", "../shared/src/**/*.ts" ], + "references": [ + { "path": "../shared" }, + ], +} +//// [/home/src/workspaces/solution/projects/shared/src/logging.ts] *new* +export function log(str: string) { + console.log(str); +} +//// [/home/src/workspaces/solution/projects/shared/src/myClass.ts] *new* +export class MyClass { } +//// [/home/src/workspaces/solution/projects/shared/src/random.ts] *new* +export function randomFn(str: string) { + console.log(str); +} +//// [/home/src/workspaces/solution/projects/shared/tsconfig.json] *new* +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + }, + "include": ["src/**/*.ts"], +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, + "references": [ + { "path": "projects/server" }, + { "path": "projects/shared" }, + ], +} + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is out of date because output file 'projects/shared/dist/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'projects/shared/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/src/logging.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/myClass.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/random.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is out of date because output file 'projects/server/dist/server/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'projects/server/tsconfig.json'... + +======== Resolving module ':shared/myClass.js' from '/home/src/workspaces/solution/projects/server/src/server.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name ':shared/myClass.js'. +Module name ':shared/myClass.js', matched pattern ':shared/*'. +Trying substitution './src/../../shared/src/*', candidate module location: './src/../../shared/src/myClass.js'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/projects/shared/src/myClass.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/home/src/workspaces/solution/projects/shared/src/myClass.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/solution/projects/shared/src/myClass.ts' exists - use it as a name resolution result. +======== Module name ':shared/myClass.js' was successfully resolved to '/home/src/workspaces/solution/projects/shared/src/myClass.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/dist/src/myClass.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/myClass.ts' +projects/server/src/server.ts + Matched by include pattern 'src/**/*.ts' in 'projects/server/tsconfig.json' +projects/shared/dist/src/logging.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/logging.ts' +projects/shared/dist/src/random.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/random.ts' +//// [/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/projects/server/dist/server/src/server.d.ts] *new* +export {}; + +//// [/home/src/workspaces/solution/projects/server/dist/server/src/server.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log('Hello, world!'); + +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","../../../shared/dist/src/myClass.d.ts","../../src/server.ts","../../../shared/dist/src/logging.d.ts","../../../shared/dist/src/random.d.ts","../../../shared/src/myClass.ts","../../../shared/src/logging.ts","../../../shared/src/random.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},"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n",{"version":"12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n","1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n"],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"..","rootDir":"../../.."},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/server.d.ts","resolvedRoot":[[2,6],[4,7],[5,8]]} +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/random.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/random.d.ts", + "../../../shared/src/myClass.ts", + "../../../shared/src/logging.ts", + "../../../shared/src/random.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": "../../../shared/dist/src/myClass.d.ts", + "version": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../src/server.ts", + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../../shared/dist/src/logging.d.ts", + "version": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "signature": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../shared/dist/src/random.d.ts", + "version": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../../../shared/dist/src/myClass.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../.." + }, + "referencedMap": { + "../../src/server.ts": [ + "../../../shared/dist/src/myClass.d.ts" + ] + }, + "latestChangedDtsFile": "./src/server.d.ts", + "resolvedRoot": [ + [ + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/src/myClass.ts" + ], + [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/src/logging.ts" + ], + [ + "../../../shared/dist/src/random.d.ts", + "../../../shared/src/random.ts" + ] + ], + "size": 1728 +} +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts] *new* +export declare function log(str: string): void; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.log = log; +function log(str) { + console.log(str); +} + +//// [/home/src/workspaces/solution/projects/shared/dist/src/myClass.d.ts] *new* +export declare class MyClass { +} + +//// [/home/src/workspaces/solution/projects/shared/dist/src/myClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MyClass = void 0; +class MyClass { +} +exports.MyClass = MyClass; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/random.d.ts] *new* +export declare function randomFn(str: string): void; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/random.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.randomFn = randomFn; +function randomFn(str) { + console.log(str); +} + +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../src/logging.ts","../src/myClass.ts","../src/random.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":"e8c4594410128d4531f2321647cc451d-export function log(str: string) {\n console.log(str);\n}","signature":"380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n","impliedNodeFormat":1},{"version":"22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }","signature":"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","impliedNodeFormat":1},{"version":"4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}","signature":"1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/random.d.ts"} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.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": "../src/logging.ts", + "version": "e8c4594410128d4531f2321647cc451d-export function log(str: string) {\n console.log(str);\n}", + "signature": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e8c4594410128d4531f2321647cc451d-export function log(str: string) {\n console.log(str);\n}", + "signature": "380f2d6d625cf989bc9f9bcd67ce3afe-export declare function log(str: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/myClass.ts", + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/random.ts", + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/random.d.ts", + "size": 1637 +} + +projects/shared/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/projects/shared/src/logging.ts +*refresh* /home/src/workspaces/solution/projects/shared/src/myClass.ts +*refresh* /home/src/workspaces/solution/projects/shared/src/random.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/projects/shared/src/logging.ts +(stored at emit) /home/src/workspaces/solution/projects/shared/src/myClass.ts +(stored at emit) /home/src/workspaces/solution/projects/shared/src/random.ts + +projects/server/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/myClass.d.ts +*refresh* /home/src/workspaces/solution/projects/server/src/server.ts +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/random.d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/projects/server/src/server.ts + + +Edit [0]:: no change + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is up to date because newest input 'projects/shared/src/random.ts' is older than output 'projects/shared/dist/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is up to date because newest input 'projects/shared/src/random.ts' is older than output 'projects/server/dist/server/tsconfig.tsbuildinfo' + + + + +Edit [1]:: edit logging file +//// [/home/src/workspaces/solution/projects/shared/src/logging.ts] *modified* +export function log(str: string) { + console.log(str); +}export const x = 10; + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is out of date because output 'projects/shared/dist/tsconfig.tsbuildinfo' is older than input 'projects/shared/src/logging.ts' + +[HH:MM:SS AM] Building project 'projects/shared/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/src/logging.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/myClass.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/random.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is out of date because output 'projects/server/dist/server/tsconfig.tsbuildinfo' is older than input 'projects/shared/src/logging.ts' + +[HH:MM:SS AM] Building project 'projects/server/tsconfig.json'... + +======== Resolving module ':shared/myClass.js' from '/home/src/workspaces/solution/projects/server/src/server.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name ':shared/myClass.js'. +Module name ':shared/myClass.js', matched pattern ':shared/*'. +Trying substitution './src/../../shared/src/*', candidate module location: './src/../../shared/src/myClass.js'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/projects/shared/src/myClass.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/home/src/workspaces/solution/projects/shared/src/myClass.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/solution/projects/shared/src/myClass.ts' exists - use it as a name resolution result. +======== Module name ':shared/myClass.js' was successfully resolved to '/home/src/workspaces/solution/projects/shared/src/myClass.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/dist/src/myClass.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/myClass.ts' +projects/server/src/server.ts + Matched by include pattern 'src/**/*.ts' in 'projects/server/tsconfig.json' +projects/shared/dist/src/logging.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/logging.ts' +projects/shared/dist/src/random.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/random.ts' +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","../../../shared/dist/src/myClass.d.ts","../../src/server.ts","../../../shared/dist/src/logging.d.ts","../../../shared/dist/src/random.d.ts","../../../shared/src/myClass.ts","../../../shared/src/logging.ts","../../../shared/src/random.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},"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n",{"version":"12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n","1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n"],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"..","rootDir":"../../.."},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/server.d.ts","resolvedRoot":[[2,6],[4,7],[5,8]]} +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/random.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/dist/src/random.d.ts", + "../../../shared/src/myClass.ts", + "../../../shared/src/logging.ts", + "../../../shared/src/random.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": "../../../shared/dist/src/myClass.d.ts", + "version": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../src/server.ts", + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../../shared/dist/src/logging.d.ts", + "version": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../../shared/dist/src/random.d.ts", + "version": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../../../shared/dist/src/myClass.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../.." + }, + "referencedMap": { + "../../src/server.ts": [ + "../../../shared/dist/src/myClass.d.ts" + ] + }, + "latestChangedDtsFile": "./src/server.d.ts", + "resolvedRoot": [ + [ + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/src/myClass.ts" + ], + [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/src/logging.ts" + ], + [ + "../../../shared/dist/src/random.d.ts", + "../../../shared/src/random.ts" + ] + ], + "size": 1758 +} +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts] *modified* +export declare function log(str: string): void; +export declare const x = 10; + +//// [/home/src/workspaces/solution/projects/shared/dist/src/logging.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.log = log; +function log(str) { + console.log(str); +} +exports.x = 10; + +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../src/logging.ts","../src/myClass.ts","../src/random.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":"107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;","signature":"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n","impliedNodeFormat":1},{"version":"22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }","signature":"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","impliedNodeFormat":1},{"version":"4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}","signature":"1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/logging.d.ts"} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/logging.ts", + "../src/myClass.ts", + "../src/random.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": "../src/logging.ts", + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/myClass.ts", + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/random.ts", + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4f1c4e78a007da37552cba1c9b98db63-export function randomFn(str: string) {\n console.log(str);\n}", + "signature": "1d6adcd8c4dee61b744fc1ff84370372-export declare function randomFn(str: string): void;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/logging.d.ts", + "size": 1688 +} + +projects/shared/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/projects/shared/src/logging.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/projects/shared/src/logging.ts + +projects/server/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +Signatures:: +(used version) /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts + + +Edit [2]:: no change + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/shared/dist/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/server/dist/server/tsconfig.tsbuildinfo' + + + + +Edit [3]:: delete random file +//// [/home/src/workspaces/solution/projects/shared/src/random.ts] *deleted* + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is out of date because buildinfo file 'projects/shared/dist/tsconfig.tsbuildinfo' indicates that file 'projects/shared/src/random.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'projects/shared/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/src/logging.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +projects/shared/src/myClass.ts + Matched by include pattern 'src/**/*.ts' in 'projects/shared/tsconfig.json' +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is out of date because buildinfo file 'projects/server/dist/server/tsconfig.tsbuildinfo' indicates that file 'projects/shared/src/random.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'projects/server/tsconfig.json'... + +======== Resolving module ':shared/myClass.js' from '/home/src/workspaces/solution/projects/server/src/server.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +'paths' option is specified, looking for a pattern to match module name ':shared/myClass.js'. +Module name ':shared/myClass.js', matched pattern ':shared/*'. +Trying substitution './src/../../shared/src/*', candidate module location: './src/../../shared/src/myClass.js'. +Loading module as file / folder, candidate module location '/home/src/workspaces/solution/projects/shared/src/myClass.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/home/src/workspaces/solution/projects/shared/src/myClass.js' has a '.js' extension - stripping it. +File '/home/src/workspaces/solution/projects/shared/src/myClass.ts' exists - use it as a name resolution result. +======== Module name ':shared/myClass.js' was successfully resolved to '/home/src/workspaces/solution/projects/shared/src/myClass.ts'. ======== +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +projects/shared/dist/src/myClass.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/myClass.ts' +projects/server/src/server.ts + Matched by include pattern 'src/**/*.ts' in 'projects/server/tsconfig.json' +projects/shared/dist/src/logging.d.ts + Matched by include pattern '../shared/src/**/*.ts' in 'projects/server/tsconfig.json' + File is output of project reference source 'projects/shared/src/logging.ts' +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../../../shared/dist/src/myClass.d.ts","../../src/server.ts","../../../shared/dist/src/logging.d.ts","../../../shared/src/myClass.ts","../../../shared/src/logging.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},"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n",{"version":"12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n"],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"..","rootDir":"../../.."},"referencedMap":[[3,1]],"latestChangedDtsFile":"./src/server.d.ts","resolvedRoot":[[2,5],[4,6]]} +//// [/home/src/workspaces/solution/projects/server/dist/server/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts", + "../../../shared/dist/src/logging.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../../shared/dist/src/myClass.d.ts", + "../../src/server.ts", + "../../../shared/dist/src/logging.d.ts", + "../../../shared/src/myClass.ts", + "../../../shared/src/logging.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": "../../../shared/dist/src/myClass.d.ts", + "version": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../src/server.ts", + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12354a7ec5afade35d10a2c1fa79eb29-import { MyClass } from ':shared/myClass.js';\nconsole.log('Hello, world!');", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../../shared/dist/src/logging.d.ts", + "version": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../../../shared/dist/src/myClass.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../.." + }, + "referencedMap": { + "../../src/server.ts": [ + "../../../shared/dist/src/myClass.d.ts" + ] + }, + "latestChangedDtsFile": "./src/server.d.ts", + "resolvedRoot": [ + [ + "../../../shared/dist/src/myClass.d.ts", + "../../../shared/src/myClass.ts" + ], + [ + "../../../shared/dist/src/logging.d.ts", + "../../../shared/src/logging.ts" + ] + ], + "size": 1591 +} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../src/logging.ts","../src/myClass.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":"107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;","signature":"5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n","impliedNodeFormat":1},{"version":"22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }","signature":"21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/logging.d.ts"} +//// [/home/src/workspaces/solution/projects/shared/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/logging.ts", + "../src/myClass.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../src/logging.ts", + "../src/myClass.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": "../src/logging.ts", + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "107fb48a395fd47390346ab424ebcc12-export function log(str: string) {\n console.log(str);\n}export const x = 10;", + "signature": "5178e2a779ca8b29fb07201995347a09-export declare function log(str: string): void;\nexport declare const x = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/myClass.ts", + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "22f018e389f527d25fc2ad2b2c6c9702-export class MyClass { }", + "signature": "21b0030a128ccc5aedc6fdbe3cdf12e3-export declare class MyClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/logging.d.ts", + "size": 1432 +} + +projects/shared/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +projects/server/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --b projects/server -v --traceResolution --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * projects/shared/tsconfig.json + * projects/server/tsconfig.json + +[HH:MM:SS AM] Project 'projects/shared/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/shared/dist/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'projects/server/tsconfig.json' is up to date because newest input 'projects/shared/src/logging.ts' is older than output 'projects/server/dist/server/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/roots/when-two-root-files-are-consecutive.js b/testdata/baselines/reference/tsbuild/roots/when-two-root-files-are-consecutive.js new file mode 100644 index 0000000000..0516d44027 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/roots/when-two-root-files-are-consecutive.js @@ -0,0 +1,206 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/file1.ts] *new* +export const x = "hello"; +//// [/home/src/workspaces/project/file2.ts] *new* +export const y = "world"; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "include": ["*.ts"], +} + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/file1.d.ts] *new* +export declare const x = "hello"; + +//// [/home/src/workspaces/project/file1.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "hello"; + +//// [/home/src/workspaces/project/file2.d.ts] *new* +export declare const y = "world"; + +//// [/home/src/workspaces/project/file2.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = "world"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./file1.ts","./file2.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":"cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";","signature":"0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n","impliedNodeFormat":1},{"version":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./file2.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file1.ts", + "./file2.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./file1.ts", + "./file2.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": "./file1.ts", + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc7052ed344567798ec87f1c0f8f276c-export const x = \"hello\";", + "signature": "0c71c4d05f424f4dc52c978a9207cdf6-export declare const x = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./file2.d.ts", + "size": 1308 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/file1.ts +*refresh* /home/src/workspaces/project/file2.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/file1.ts +(stored at emit) /home/src/workspaces/project/file2.ts + + +Edit [0]:: delete file1 +//// [/home/src/workspaces/project/file1.d.ts] *deleted* +//// [/home/src/workspaces/project/file1.js] *deleted* +//// [/home/src/workspaces/project/file1.ts] *deleted* + +tsgo --b -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that file 'file1.ts' was root file of compilation but not any more. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./file2.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":"42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";","signature":"64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./file2.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./file2.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./file2.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": "./file2.ts", + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "42f7437ec4aafe7a26fc38ec3ba035fe-export const y = \"world\";", + "signature": "64ca81919be0c5adb4964999189ddb2c-export declare const y = \"world\";\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./file2.d.ts", + "size": 1109 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/sample/always-builds-under-with-force-option.js b/testdata/baselines/reference/tsbuild/sample/always-builds-under-with-force-option.js new file mode 100644 index 0000000000..f8ea0d9f23 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/always-builds-under-with-force-option.js @@ -0,0 +1,481 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --force +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: no change + +tsgo --b tests --force +ExitStatus:: Success +Output:: +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/anotherModule.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/user/username/projects/sample1/tests/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js b/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js new file mode 100644 index 0000000000..bda501271a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js @@ -0,0 +1,75 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b logic2/tsconfig.json --verbose +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * logic2/tsconfig.json + +[HH:MM:SS AM] Project 'logic2/tsconfig.json' is out of date because config file does not exist. + +error TS6053: File '/user/username/projects/sample1/logic2/tsconfig.json' not found. + +Found 1 error. + + diff --git a/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-declarationDir-is-specified.js b/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-declarationDir-is-specified.js new file mode 100644 index 0000000000..c3265da6f8 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-declarationDir-is-specified.js @@ -0,0 +1,428 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "declarationDir": "out/decls", + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/out/decls/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"declarationDir":"./out/decls","sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./out/decls/index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationDir": "./out/decls", + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./out/decls/index.d.ts", + "size": 1893 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/out/decls/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/out/decls/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/out/decls/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/out/decls/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/out/decls/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/out/decls/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2048 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/out/decls/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-outDir-is-specified.js b/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-outDir-is-specified.js new file mode 100644 index 0000000000..2e36adda35 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-outDir-is-specified.js @@ -0,0 +1,428 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "outDir": "outDir", + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/outDir/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/outDir/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/outDir/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/outDir/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../../core/index.d.ts","../../core/anotherModule.d.ts","../index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"outDir":"./","sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../../core/index.d.ts", + "../../core/anotherModule.d.ts", + "../index.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": "../../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../core/index.d.ts", + "../../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "outDir": "./", + "sourceMap": true + }, + "referencedMap": { + "../index.ts": [ + "../../core/index.d.ts", + "../../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1873 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/outDir/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/outDir/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/outDir/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/outDir/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/outDir/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/outDir/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2045 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/outDir/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js b/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js new file mode 100644 index 0000000000..63474a2a35 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js @@ -0,0 +1,160 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b core --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./anotherModule.ts","./index.ts","./some_decl.d.ts"]} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts" + ], + "original": "./anotherModule.ts" + }, + { + "files": [ + "./index.ts" + ], + "original": "./index.ts" + }, + { + "files": [ + "./some_decl.d.ts" + ], + "original": "./some_decl.d.ts" + } + ], + "size": 89 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/builds-downstream-projects-even-if-upstream-projects-have-errors.js b/testdata/baselines/reference/tsbuild/sample/builds-downstream-projects-even-if-upstream-projects-have-errors.js new file mode 100644 index 0000000000..fc975d6e23 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/builds-downstream-projects-even-if-upstream-projects-have-errors.js @@ -0,0 +1,502 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.muitply(); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +logic/index.ts:3:14 - error TS2339: Property 'muitply' does not exist on type 'typeof import("/user/username/projects/sample1/core/index")'. + +3 return c.muitply(); +   ~~~~~~~ + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + + +Found 1 error in logic/index.ts:3 + +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): any; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.muitply(); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;AAAA,CACtB;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"4da0a6ee7d4a662685afc8fe143c994d-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.muitply();\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":85,"end":92,"code":2339,"category":1,"message":"Property 'muitply' does not exist on type 'typeof import(\"/user/username/projects/sample1/core/index\")'."}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "4da0a6ee7d4a662685afc8fe143c994d-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.muitply();\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4da0a6ee7d4a662685afc8fe143c994d-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.muitply();\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 85, + "end": 92, + "code": 2339, + "category": 1, + "message": "Property 'muitply' does not exist on type 'typeof import(\"/user/username/projects/sample1/core/index\")'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 2070 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "07587a8dc02fb971c487c21dd8f4849b-export declare function getSecondsInDay(): any;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2035 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: no change + +tsgo --b tests --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/some_decl.d.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because buildinfo file 'logic/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +logic/index.ts:3:14 - error TS2339: Property 'muitply' does not exist on type 'typeof import("/user/username/projects/sample1/core/index")'. + +3 return c.muitply(); +   ~~~~~~~ + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... + + +Found 1 error in logic/index.ts:3 + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/sample/can-detect-when-and-what-to-rebuild.js b/testdata/baselines/reference/tsbuild/sample/can-detect-when-and-what-to-rebuild.js new file mode 100644 index 0000000000..4de6163398 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/can-detect-when-and-what-to-rebuild.js @@ -0,0 +1,797 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: no change + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/some_decl.d.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date because newest input 'tests/index.ts' is older than output 'tests/tsconfig.tsbuildinfo' + + + + +Edit [1]:: Only builds the leaf node project +//// [/user/username/projects/sample1/tests/index.ts] *modified* +const m = 10; + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/some_decl.d.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'tests/index.ts' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/tests/index.d.ts] *modified* +declare const m = 10; + +//// [/user/username/projects/sample1/tests/index.js] *modified* +const m = 10; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.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":"56d1f0295f08f455bf238abf352169ad-const m = 10;","signature":"5371dd1e5a6ad97b9e819afc1cbf0769-declare const m = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./index.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": "./index.ts", + "version": "56d1f0295f08f455bf238abf352169ad-const m = 10;", + "signature": "5371dd1e5a6ad97b9e819afc1cbf0769-declare const m = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "56d1f0295f08f455bf238abf352169ad-const m = 10;", + "signature": "5371dd1e5a6ad97b9e819afc1cbf0769-declare const m = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1153 +} + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/tests/index.ts + + +Edit [2]:: Detects type-only changes in upstream projects +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "WELCOME PLANET"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output 'core/tsconfig.tsbuildinfo' is older than input 'core/index.ts' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/index.d.ts.map] *modified* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAyB,CAAC;AACnD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "WELCOME PLANET"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"5db513b8d1d81d749259481c8a605be6-export const someString: string = \"WELCOME PLANET\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "5db513b8d1d81d749259481c8a605be6-export const someString: string = \"WELCOME PLANET\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5db513b8d1d81d749259481c8a605be6-export const someString: string = \"WELCOME PLANET\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1821 +} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + + +Edit [3]:: rebuilds when tsconfig changes +//// [/user/username/projects/sample1/tests/tsconfig.json] *modified* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, "target": "es2020", + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/index.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'tests/tsconfig.json' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/home/src/tslibs/TS/Lib/lib.es2020.full.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; }; +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.es2020.full.d.ts","./index.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":"56d1f0295f08f455bf238abf352169ad-const m = 10;","signature":"5371dd1e5a6ad97b9e819afc1cbf0769-declare const m = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"target":7},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.es2020.full.d.ts", + "./index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2020.full.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": "./index.ts", + "version": "56d1f0295f08f455bf238abf352169ad-const m = 10;", + "signature": "5371dd1e5a6ad97b9e819afc1cbf0769-declare const m = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "56d1f0295f08f455bf238abf352169ad-const m = 10;", + "signature": "5371dd1e5a6ad97b9e819afc1cbf0769-declare const m = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "target": 7 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1176 +} + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /home/src/tslibs/TS/Lib/lib.es2020.full.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js b/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js new file mode 100644 index 0000000000..5a1bbd8d55 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js @@ -0,0 +1,70 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b logic2 --clean +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +error TS6053: File '/user/username/projects/sample1/logic2/tsconfig.json' not found. + +Found 1 error. + + diff --git a/testdata/baselines/reference/tsbuild/sample/does-not-write-any-files-in-a-dry-build.js b/testdata/baselines/reference/tsbuild/sample/does-not-write-any-files-in-a-dry-build.js new file mode 100644 index 0000000000..0a972aa01b --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/does-not-write-any-files-in-a-dry-build.js @@ -0,0 +1,72 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --dry +ExitStatus:: Success +Output:: +[HH:MM:SS AM] A non-dry build would build project '/user/username/projects/sample1/core/tsconfig.json' + +[HH:MM:SS AM] A non-dry build would build project '/user/username/projects/sample1/logic/tsconfig.json' + +[HH:MM:SS AM] A non-dry build would build project '/user/username/projects/sample1/tests/tsconfig.json' + + diff --git a/testdata/baselines/reference/tsbuild/sample/explainFiles.js b/testdata/baselines/reference/tsbuild/sample/explainFiles.js new file mode 100644 index 0000000000..fa3112b13d --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/explainFiles.js @@ -0,0 +1,994 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --explainFiles --v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +core/anotherModule.ts + Matched by default include pattern '**/*' +core/index.ts + Matched by default include pattern '**/*' +core/some_decl.d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +core/index.d.ts + Imported via '../core/index' from file 'logic/index.ts' + File is output of project reference source 'core/index.ts' +core/anotherModule.d.ts + Imported via '../core/anotherModule' from file 'logic/index.ts' + File is output of project reference source 'core/anotherModule.ts' +logic/index.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +core/index.d.ts + Imported via '../core/index' from file 'tests/index.ts' + File is output of project reference source 'core/index.ts' +core/anotherModule.d.ts + Imported via '../core/anotherModule' from file 'tests/index.ts' + File is output of project reference source 'core/anotherModule.ts' +logic/index.d.ts + Imported via '../logic/index' from file 'tests/index.ts' + File is output of project reference source 'logic/index.ts' +tests/index.ts + Part of 'files' list in 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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } + +tsgo --b tests --explainFiles --v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output 'core/tsconfig.tsbuildinfo' is older than input 'core/index.ts' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +core/anotherModule.ts + Matched by default include pattern '**/*' +core/index.ts + Matched by default include pattern '**/*' +core/some_decl.d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output 'logic/tsconfig.tsbuildinfo' is older than input 'core' + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +core/index.d.ts + Imported via '../core/index' from file 'logic/index.ts' + File is output of project reference source 'core/index.ts' +core/anotherModule.d.ts + Imported via '../core/anotherModule' from file 'logic/index.ts' + File is output of project reference source 'core/anotherModule.ts' +logic/index.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'core' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +core/index.d.ts + Imported via '../core/index' from file 'tests/index.ts' + File is output of project reference source 'core/index.ts' +core/anotherModule.d.ts + Imported via '../core/anotherModule' from file 'tests/index.ts' + File is output of project reference source 'core/anotherModule.ts' +logic/index.d.ts + Imported via '../logic/index' from file 'tests/index.ts' + File is output of project reference source 'logic/index.ts' +tests/index.ts + Part of 'files' list in tsconfig.json +//// [/user/username/projects/sample1/core/index.d.ts] *modified* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *modified* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAChE,qBAAa,SAAS;CAAI"} +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1883 +} +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1916 +} +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2075 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts + + +Edit [1]:: incremental-declaration-doesnt-change +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } +class someClass2 { } + +tsgo --b tests --explainFiles --v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output 'core/tsconfig.tsbuildinfo' is older than input 'core/index.ts' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +core/anotherModule.ts + Matched by default include pattern '**/*' +core/index.ts + Matched by default include pattern '**/*' +core/some_decl.d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; +class someClass2 { +} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1905 +} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + + +Edit [2]:: no change + +tsgo --b tests --explainFiles --v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/index.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date because newest input 'tests/index.ts' is older than output 'tests/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/sample/indicates-that-it-would-skip-builds-during-a-dry-build.js b/testdata/baselines/reference/tsbuild/sample/indicates-that-it-would-skip-builds-during-a-dry-build.js new file mode 100644 index 0000000000..0f87cbd2cf --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/indicates-that-it-would-skip-builds-during-a-dry-build.js @@ -0,0 +1,442 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: --dry + +tsgo --b tests --dry +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Project '/user/username/projects/sample1/core/tsconfig.json' is up to date + +[HH:MM:SS AM] Project '/user/username/projects/sample1/logic/tsconfig.json' is up to date + +[HH:MM:SS AM] Project '/user/username/projects/sample1/tests/tsconfig.json' is up to date + + diff --git a/testdata/baselines/reference/tsbuild/sample/listEmittedFiles.js b/testdata/baselines/reference/tsbuild/sample/listEmittedFiles.js new file mode 100644 index 0000000000..e714739a80 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/listEmittedFiles.js @@ -0,0 +1,888 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --listEmittedFiles +ExitStatus:: Success +Output:: +TSFILE: /user/username/projects/sample1/core/anotherModule.js +TSFILE: /user/username/projects/sample1/core/anotherModule.d.ts.map +TSFILE: /user/username/projects/sample1/core/anotherModule.d.ts +TSFILE: /user/username/projects/sample1/core/index.js +TSFILE: /user/username/projects/sample1/core/index.d.ts.map +TSFILE: /user/username/projects/sample1/core/index.d.ts +TSFILE: /user/username/projects/sample1/core/tsconfig.tsbuildinfo +TSFILE: /user/username/projects/sample1/logic/index.js.map +TSFILE: /user/username/projects/sample1/logic/index.js +TSFILE: /user/username/projects/sample1/logic/index.d.ts +TSFILE: /user/username/projects/sample1/logic/tsconfig.tsbuildinfo +TSFILE: /user/username/projects/sample1/tests/index.js +TSFILE: /user/username/projects/sample1/tests/index.d.ts +TSFILE: /user/username/projects/sample1/tests/tsconfig.tsbuildinfo +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } + +tsgo --b tests --listEmittedFiles +ExitStatus:: Success +Output:: +TSFILE: /user/username/projects/sample1/core/index.js +TSFILE: /user/username/projects/sample1/core/index.d.ts.map +TSFILE: /user/username/projects/sample1/core/index.d.ts +TSFILE: /user/username/projects/sample1/core/tsconfig.tsbuildinfo +TSFILE: /user/username/projects/sample1/logic/index.js.map +TSFILE: /user/username/projects/sample1/logic/index.js +TSFILE: /user/username/projects/sample1/logic/tsconfig.tsbuildinfo +TSFILE: /user/username/projects/sample1/tests/index.js +TSFILE: /user/username/projects/sample1/tests/tsconfig.tsbuildinfo +//// [/user/username/projects/sample1/core/index.d.ts] *modified* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *modified* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAChE,qBAAa,SAAS;CAAI"} +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1883 +} +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1916 +} +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2075 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts + + +Edit [1]:: incremental-declaration-doesnt-change +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } +class someClass2 { } + +tsgo --b tests --listEmittedFiles +ExitStatus:: Success +Output:: +TSFILE: /user/username/projects/sample1/core/index.js +TSFILE: /user/username/projects/sample1/core/index.d.ts.map +TSFILE: /user/username/projects/sample1/core/tsconfig.tsbuildinfo +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; +class someClass2 { +} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1905 +} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + + +Edit [2]:: no change + +tsgo --b tests --listEmittedFiles +ExitStatus:: Success +Output:: + diff --git a/testdata/baselines/reference/tsbuild/sample/listFiles.js b/testdata/baselines/reference/tsbuild/sample/listFiles.js new file mode 100644 index 0000000000..3f6d7f9965 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/listFiles.js @@ -0,0 +1,892 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --listFiles +ExitStatus:: Success +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } + +tsgo --b tests --listFiles +ExitStatus:: Success +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts +//// [/user/username/projects/sample1/core/index.d.ts] *modified* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *modified* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAChE,qBAAa,SAAS;CAAI"} +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1883 +} +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1916 +} +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2075 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts + + +Edit [1]:: incremental-declaration-doesnt-change +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } +class someClass2 { } + +tsgo --b tests --listFiles +ExitStatus:: Success +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; +class someClass2 { +} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1905 +} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + + +Edit [2]:: no change + +tsgo --b tests --listFiles +ExitStatus:: Success +Output:: + diff --git a/testdata/baselines/reference/tsbuild/sample/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js b/testdata/baselines/reference/tsbuild/sample/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js new file mode 100644 index 0000000000..0a3b7949b0 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js @@ -0,0 +1,524 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: convert tsbuildInfo version to something that is say to previous version +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTsPreviousVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTsPreviousVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTsPreviousVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output for it was generated with version 'FakeTsPreviousVersion' that differs with current version 'FakeTSVersion' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output for it was generated with version 'FakeTsPreviousVersion' that differs with current version 'FakeTSVersion' + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output for it was generated with version 'FakeTsPreviousVersion' that differs with current version 'FakeTSVersion' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/anotherModule.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/user/username/projects/sample1/tests/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/rebuilds-from-start-if-force-option-is-set.js b/testdata/baselines/reference/tsbuild/sample/rebuilds-from-start-if-force-option-is-set.js new file mode 100644 index 0000000000..fe5b8a8b51 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/rebuilds-from-start-if-force-option-is-set.js @@ -0,0 +1,498 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: --force build + +tsgo --b tests --verbose --force +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/anotherModule.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/user/username/projects/sample1/tests/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/rebuilds-when-extended-config-file-changes.js b/testdata/baselines/reference/tsbuild/sample/rebuilds-when-extended-config-file-changes.js new file mode 100644 index 0000000000..529bf18c46 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/rebuilds-when-extended-config-file-changes.js @@ -0,0 +1,572 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.base.json] *new* +{ + "compilerOptions": { + "target": "es5" + } +} +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "extends": "./tsconfig.base.json", "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"target":1},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "target": 1 + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2049 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: change extended file +//// [/user/username/projects/sample1/tests/tsconfig.base.json] *modified* +{ + "compilerOptions": { } +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/some_decl.d.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'tests/tsconfig.base.json' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +tests/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/sample/removes-all-files-it-built.js b/testdata/baselines/reference/tsbuild/sample/removes-all-files-it-built.js new file mode 100644 index 0000000000..4dbbe4597f --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/removes-all-files-it-built.js @@ -0,0 +1,458 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: removes all files it built + +tsgo --b tests --clean +ExitStatus:: Success +Output:: +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *deleted* +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *deleted* +//// [/user/username/projects/sample1/core/anotherModule.js] *deleted* +//// [/user/username/projects/sample1/core/index.d.ts] *deleted* +//// [/user/username/projects/sample1/core/index.d.ts.map] *deleted* +//// [/user/username/projects/sample1/core/index.js] *deleted* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *deleted* +//// [/user/username/projects/sample1/logic/index.d.ts] *deleted* +//// [/user/username/projects/sample1/logic/index.js] *deleted* +//// [/user/username/projects/sample1/logic/index.js.map] *deleted* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *deleted* +//// [/user/username/projects/sample1/tests/index.d.ts] *deleted* +//// [/user/username/projects/sample1/tests/index.js] *deleted* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *deleted* + + + +Edit [1]:: no change --clean + +tsgo --b tests --clean +ExitStatus:: Success +Output:: + diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js new file mode 100644 index 0000000000..11c9af0739 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js @@ -0,0 +1,425 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"], +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose --force +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +logic/index.ts:5:22 - error TS2307: Cannot find module '../core/anotherModule' or its corresponding type declarations. + +5 import * as mod from '../core/anotherModule'; +   ~~~~~~~~~~~~~~~~~~~~~~~ + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +tests/index.ts:7:22 - error TS2307: Cannot find module '../core/anotherModule' or its corresponding type declarations. + +7 import * as mod from '../core/anotherModule'; +   ~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 logic/index.ts:5 + 1 tests/index.ts:7 + +//// [/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; }; +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; + +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.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":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./index.ts", + "./some_decl.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": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1539 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +export declare const m: any; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../core/index.d.ts","./index.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},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":126,"end":149,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 126, + "end": 149, + "code": 2307, + "category": 1, + "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +export declare const m: any; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../logic/index.d.ts","./index.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},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":144,"end":167,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "signature": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 144, + "end": 167, + "code": 2307, + "category": 1, + "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1913 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js new file mode 100644 index 0000000000..7a726b775a --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js @@ -0,0 +1,425 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"], +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +logic/index.ts:5:22 - error TS2307: Cannot find module '../core/anotherModule' or its corresponding type declarations. + +5 import * as mod from '../core/anotherModule'; +   ~~~~~~~~~~~~~~~~~~~~~~~ + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +tests/index.ts:7:22 - error TS2307: Cannot find module '../core/anotherModule' or its corresponding type declarations. + +7 import * as mod from '../core/anotherModule'; +   ~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 logic/index.ts:5 + 1 tests/index.ts:7 + +//// [/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; }; +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; + +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.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":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./index.ts", + "./some_decl.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": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1539 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +export declare const m: any; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../core/index.d.ts","./index.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},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":126,"end":149,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 126, + "end": 149, + "code": 2307, + "category": 1, + "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +export declare const m: any; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../logic/index.d.ts","./index.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},"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":144,"end":167,"code":2307,"category":1,"message":"Cannot find module '../core/anotherModule' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "signature": "40bb9a18ac3dbfd340fea197221fa9dd-export declare function getSecondsInDay(): number;\nexport declare const m: any;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "ce0233db1f3aabecabdb072a4f4c8d1e-export declare const m: any;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 144, + "end": 167, + "code": 2307, + "category": 1, + "message": "Cannot find module '../core/anotherModule' or its corresponding type declarations." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1913 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/sample.js b/testdata/baselines/reference/tsbuild/sample/sample.js new file mode 100644 index 0000000000..2adc9789dc --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/sample.js @@ -0,0 +1,1167 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output 'core/tsconfig.tsbuildinfo' is older than input 'core/index.ts' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output 'logic/tsconfig.tsbuildinfo' is older than input 'core' + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'core' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/index.d.ts] *modified* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *modified* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAChE,qBAAa,SAAS;CAAI"} +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ce98c7b232474711a6089b586825cf2a-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1883 +} +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1916 +} +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2075 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts + + +Edit [1]:: incremental-declaration-doesnt-change +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } +class someClass2 { } + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output 'core/tsconfig.tsbuildinfo' is older than input 'core/index.ts' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass = exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +class someClass { +} +exports.someClass = someClass; +class someClass2 { +} + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }","signature":"f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6da67e68a6a36fe29a41c2a1fe0b71b2-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }\nexport class someClass { }\nclass someClass2 { }", + "signature": "f678e4b80b87bcfac584b8a641b31960-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1905 +} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + + +Edit [2]:: no change + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/index.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date because newest input 'tests/index.ts' is older than output 'tests/tsconfig.tsbuildinfo' + + + + +Edit [3]:: when logic config changes declaration dir +//// [/user/username/projects/sample1/logic/tsconfig.json] *modified* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationDir": "decls", + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/index.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output 'logic/tsconfig.tsbuildinfo' is older than input 'logic/tsconfig.json' + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'logic' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/logic/decls/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js.map] *rewrite with same content* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"declarationDir":"./decls","skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./decls/index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "declarationDir": "./decls", + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./decls/index.d.ts", + "size": 1949 +} +//// [/user/username/projects/sample1/tests/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/decls/index.d.ts","./index.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},"4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/decls/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "4c69c21de8985cc5cf2addb044c738b6-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/decls/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/decls/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/decls/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/decls/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2081 +} + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/decls/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/logic/decls/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts + + +Edit [4]:: no change + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/index.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date because newest input 'tests/index.ts' is older than output 'tests/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js new file mode 100644 index 0000000000..e356660329 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -0,0 +1,646 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; }multiply(); +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose --stopBuildOnErrors +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +core/index.ts:3:65 - error TS2554: Expected 2 arguments, but got 0. + +3 export function multiply(a: number, b: number) { return a * b; }multiply(); +   ~~~~~~~~ + + core/index.ts:3:26 - An argument for 'a' was not provided. + 3 export function multiply(a: number, b: number) { return a * b; }multiply(); +    ~~~~~~~~~ + +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project 'logic/tsconfig.json' because its dependency 'core' has errors + +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'logic' was not built + +[HH:MM:SS AM] Skipping build of project 'tests/tsconfig.json' because its dependency 'logic' was not built + + +Found 1 error in core/index.ts:3 + +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +multiply(); + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"message":"Expected 2 arguments, but got 0.","relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"message":"An argument for 'a' was not provided."}]}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 177, + "end": 185, + "code": 2554, + "category": 1, + "message": "Expected 2 arguments, but got 0.", + "relatedInformation": [ + { + "pos": 138, + "end": 147, + "code": 6210, + "category": 3, + "message": "An argument for 'a' was not provided." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 2078 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + + +Edit [0]:: no change + +tsgo --b tests --verbose --stopBuildOnErrors +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +core/index.ts:3:65 - error TS2554: Expected 2 arguments, but got 0. + +3 export function multiply(a: number, b: number) { return a * b; }multiply(); +   ~~~~~~~~ + + core/index.ts:3:26 - An argument for 'a' was not provided. + 3 export function multiply(a: number, b: number) { return a * b; }multiply(); +    ~~~~~~~~~ + +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project 'logic/tsconfig.json' because its dependency 'core' has errors + +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'logic' was not built + +[HH:MM:SS AM] Skipping build of project 'tests/tsconfig.json' because its dependency 'logic' was not built + + +Found 1 error in core/index.ts:3 + + +core/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: fix error +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +tsgo --b tests --verbose --stopBuildOnErrors +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js new file mode 100644 index 0000000000..c498d0fbe7 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -0,0 +1,647 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; }multiply(); +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose --stopBuildOnErrors +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +core/index.ts:3:65 - error TS2554: Expected 2 arguments, but got 0. + +3 export function multiply(a: number, b: number) { return a * b; }multiply(); +   ~~~~~~~~ + + core/index.ts:3:26 - An argument for 'a' was not provided. + 3 export function multiply(a: number, b: number) { return a * b; }multiply(); +    ~~~~~~~~~ + +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project 'logic/tsconfig.json' because its dependency 'core' has errors + +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project 'tests/tsconfig.json' because its dependency 'core' has errors + + +Found 1 error in core/index.ts:3 + +//// [/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } +multiply(); + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"semanticDiagnosticsPerFile":[[3,[{"pos":177,"end":185,"code":2554,"category":1,"message":"Expected 2 arguments, but got 0.","relatedInformation":[{"pos":138,"end":147,"code":6210,"category":3,"message":"An argument for 'a' was not provided."}]}]]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4bf9c557eaa1c988144310898522b7b5-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }multiply();", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 177, + "end": 185, + "code": 2554, + "category": 1, + "message": "Expected 2 arguments, but got 0.", + "relatedInformation": [ + { + "pos": 138, + "end": 147, + "code": 6210, + "category": 3, + "message": "An argument for 'a' was not provided." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 2078 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + + +Edit [0]:: no change + +tsgo --b tests --verbose --stopBuildOnErrors +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +core/index.ts:3:65 - error TS2554: Expected 2 arguments, but got 0. + +3 export function multiply(a: number, b: number) { return a * b; }multiply(); +   ~~~~~~~~ + + core/index.ts:3:26 - An argument for 'a' was not provided. + 3 export function multiply(a: number, b: number) { return a * b; }multiply(); +    ~~~~~~~~~ + +[HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project 'logic/tsconfig.json' because its dependency 'core' has errors + +[HH:MM:SS AM] Project 'tests/tsconfig.json' can't be built because its dependency 'core' has errors + +[HH:MM:SS AM] Skipping build of project 'tests/tsconfig.json' because its dependency 'core' has errors + + +Found 1 error in core/index.ts:3 + + +core/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: fix error +//// [/user/username/projects/sample1/core/index.ts] *modified* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +tsgo --b tests --verbose --stopBuildOnErrors +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/tsbuildinfo-has-error.js b/testdata/baselines/reference/tsbuild/sample/tsbuildinfo-has-error.js new file mode 100644 index 0000000000..4069a8e8c7 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/tsbuildinfo-has-error.js @@ -0,0 +1,120 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/main.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +Some random string + +tsgo --b -i -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] 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/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./main.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": "./main.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "size": 915 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/main.ts +Signatures:: + + +Edit [0]:: tsbuildinfo written has error +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +Some random string{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} + +tsgo --b -i -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/home/src/workspaces/project/main.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/main.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/sample/when-declaration-option-changes.js b/testdata/baselines/reference/tsbuild/sample/when-declaration-option-changes.js new file mode 100644 index 0000000000..e8f06d8b91 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/when-declaration-option-changes.js @@ -0,0 +1,297 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b core --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/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; }; +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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},"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }",{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"skipDefaultLibCheck":true}} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "skipDefaultLibCheck": true + }, + "size": 1346 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/core/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b core --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true,"skipDefaultLibCheck":true}} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true, + "skipDefaultLibCheck": true + }, + "size": 1741 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js b/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js new file mode 100644 index 0000000000..19114f67c1 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js @@ -0,0 +1,703 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: Disable declarationMap +//// [/user/username/projects/sample1/core/tsconfig.json] *modified* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": false, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *modified* +export declare const World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *modified* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":false,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": false, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1819 +} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +core/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Enable declarationMap +//// [/user/username/projects/sample1/core/tsconfig.json] *modified* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because buildinfo file 'core/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *modified* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.d.ts] *modified* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +core/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/sample/when-esModuleInterop-option-changes.js b/testdata/baselines/reference/tsbuild/sample/when-esModuleInterop-option-changes.js new file mode 100644 index 0000000000..ad887c9a82 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/when-esModuleInterop-option-changes.js @@ -0,0 +1,626 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "esModuleInterop": false, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"esModuleInterop":false,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "esModuleInterop": false, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2062 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/tests/tsconfig.json] *modified* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "esModuleInterop": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date because newest input 'core/some_decl.d.ts' is older than output 'core/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date because newest input 'logic/index.ts' is older than output 'logic/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'tests/tsconfig.json' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/tests/index.js] *modified* +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = __importStar(require("../core/index")); +const logic = __importStar(require("../logic/index")); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = __importStar(require("../core/anotherModule")); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "esModuleInterop": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2061 +} + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/sample/when-input-file-text-does-not-change-but-its-modified-time-changes.js b/testdata/baselines/reference/tsbuild/sample/when-input-file-text-does-not-change-but-its-modified-time-changes.js new file mode 100644 index 0000000000..c0fbf9ee98 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/when-input-file-text-does-not-change-but-its-modified-time-changes.js @@ -0,0 +1,474 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1879 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: upstream project changes without changing file text +//// [/user/username/projects/sample1/core/index.ts] *mTime changed* + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + diff --git a/testdata/baselines/reference/tsbuild/sample/when-logic-specifies-tsBuildInfoFile.js b/testdata/baselines/reference/tsbuild/sample/when-logic-specifies-tsBuildInfoFile.js new file mode 100644 index 0000000000..b00d0590df --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/when-logic-specifies-tsBuildInfoFile.js @@ -0,0 +1,447 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "ownFile.tsbuildinfo", + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b tests --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/ownFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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; }; +//// [/user/username/projects/sample1/core/anotherModule.d.ts] *new* +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] *new* +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.d.ts] *new* +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/user/username/projects/sample1/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1818 +} +//// [/user/username/projects/sample1/logic/index.d.ts] *new* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/logic/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *new* +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,MAAY,CAAC,4BAAsB;AACnC,2BAAkC;IAC9B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAAA,CAC7B;AACD,MAAY,GAAG,oCAA8B;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} +//// [/user/username/projects/sample1/logic/ownFile.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true,"tsBuildInfoFile":"./ownFile.tsbuildinfo"},"referencedMap":[[4,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/logic/ownFile.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "590556060bc156a64834010df8cda255-import * as c from '../core/index';\nexport function getSecondsInDay() {\n return c.multiply(10, 15);\n}\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true, + "tsBuildInfoFile": "./ownFile.tsbuildinfo" + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1921 +} +//// [/user/username/projects/sample1/tests/index.d.ts] *new* +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + +//// [/user/username/projects/sample1/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +const c = require("../core/index"); +const logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +const mod = require("../core/anotherModule"); +exports.m = mod; + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.d.ts","./index.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},"fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;","signature":"4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts", + "./index.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": "../core/index.d.ts", + "version": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "fc70810d80f598d415c6f21c113a400b-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "5ef600f6f6585506cfe942fc161e76c5-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../logic/index.d.ts", + "version": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7fa4162f733e6b9e7f7d9d9410e62f61-import * as c from '../core/index';\nimport * as logic from '../logic/index';\n\nc.leftPad(\"\", 10);\nlogic.getSecondsInDay();\n\nimport * as mod from '../core/anotherModule';\nexport const m = mod;", + "signature": "4b3c99afe665034856f74c660f74d6fd-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2038 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/core/anotherModule.ts +(stored at emit) /user/username/projects/sample1/core/index.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/when-module-option-changes.js b/testdata/baselines/reference/tsbuild/sample/when-module-option-changes.js new file mode 100644 index 0000000000..0a25a6d1df --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/when-module-option-changes.js @@ -0,0 +1,319 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "module": "node18", + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b core --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +//// [/home/src/tslibs/TS/Lib/lib.es2022.full.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; }; +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.es2022.full.d.ts","./anotherModule.ts","./index.ts","./some_decl.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},"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }",{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"module":101}} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "module": 101 + }, + "size": 1344 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/core/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "module": "nodenext", + }, +} + +tsgo --b core --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output 'core/tsconfig.tsbuildinfo' is older than input 'core/tsconfig.json' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.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; }; +//// [/user/username/projects/sample1/core/anotherModule.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/index.js] *rewrite with same content* +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.esnext.full.d.ts","./anotherModule.ts","./index.ts","./some_decl.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":"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","signature":"5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"module":199}} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.esnext.full.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.full.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "module": 199 + }, + "size": 1720 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: +(used version) /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +(computed .d.ts) /user/username/projects/sample1/core/anotherModule.ts +(computed .d.ts) /user/username/projects/sample1/core/index.ts +(used version) /user/username/projects/sample1/core/some_decl.d.ts diff --git a/testdata/baselines/reference/tsbuild/sample/when-target-option-changes.js b/testdata/baselines/reference/tsbuild/sample/when-target-option-changes.js new file mode 100644 index 0000000000..b2100cff48 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/sample/when-target-option-changes.js @@ -0,0 +1,327 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.d.ts] *new* +/// +/// +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts] *new* +/// +/// +//// [/user/username/projects/sample1/core/anotherModule.ts] *new* +export const World = "hello"; +//// [/user/username/projects/sample1/core/index.ts] *new* +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +//// [/user/username/projects/sample1/core/some_decl.d.ts] *new* +declare const dts: any; +//// [/user/username/projects/sample1/core/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "listFiles": true, + "listEmittedFiles": true, + "target": "esnext", + }, +} +//// [/user/username/projects/sample1/logic/index.ts] *new* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} +//// [/user/username/projects/sample1/tests/index.ts] *new* +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/user/username/projects/sample1/tests/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" }, + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b core --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output file 'core/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +TSFILE: /user/username/projects/sample1/core/anotherModule.js +TSFILE: /user/username/projects/sample1/core/index.js +TSFILE: /user/username/projects/sample1/core/tsconfig.tsbuildinfo +/home/src/tslibs/TS/Lib/lib.esnext.d.ts +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts +//// [/home/src/tslibs/TS/Lib/lib.esnext.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; }; +//// [/user/username/projects/sample1/core/anotherModule.js] *new* +export const World = "hello"; + +//// [/user/username/projects/sample1/core/index.js] *new* +export const someString = "HELLO WORLD"; +export function leftPad(s, n) { return s + n; } +export function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[3,5]],"fileNames":["lib.esnext.d.ts","lib.esnext.full.d.ts","./anotherModule.ts","./index.ts","./some_decl.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},"77c880b8984a58da26cd0cab7e052e50-/// \n/// ","19cd44ed7278957051fca663f821c916-export const World = \"hello\";","2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }",{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"target":99}} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 3, + 5 + ] + } + ], + "fileNames": [ + "lib.esnext.d.ts", + "lib.esnext.full.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.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": "lib.esnext.full.d.ts", + "version": "77c880b8984a58da26cd0cab7e052e50-/// \n/// ", + "signature": "77c880b8984a58da26cd0cab7e052e50-/// \n/// ", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "target": 99 + }, + "size": 1471 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /user/username/projects/sample1/core/anotherModule.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts +Signatures:: + + +Edit [0]:: incremental-declaration-changes +//// [/user/username/projects/sample1/core/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "listFiles": true, + "listEmittedFiles": true, + "target": "es5", + }, +} + +tsgo --b core --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + +[HH:MM:SS AM] Project 'core/tsconfig.json' is out of date because output 'core/tsconfig.tsbuildinfo' is older than input 'core/tsconfig.json' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +TSFILE: /user/username/projects/sample1/core/anotherModule.js +TSFILE: /user/username/projects/sample1/core/index.js +TSFILE: /user/username/projects/sample1/core/tsconfig.tsbuildinfo +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/tslibs/TS/Lib/lib.esnext.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/some_decl.d.ts +//// [/user/username/projects/sample1/core/anotherModule.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someString = void 0; +exports.leftPad = leftPad; +exports.multiply = multiply; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +function multiply(a, b) { return a * b; } + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[3,5]],"fileNames":["lib.d.ts","lib.esnext.d.ts","./anotherModule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":["77c880b8984a58da26cd0cab7e052e50-/// \n/// ",{"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},"19cd44ed7278957051fca663f821c916-export const World = \"hello\";","2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }",{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"target":1}} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 3, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "lib.esnext.d.ts", + "./anotherModule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "77c880b8984a58da26cd0cab7e052e50-/// \n/// ", + "signature": "77c880b8984a58da26cd0cab7e052e50-/// \n/// ", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "lib.esnext.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": "./anotherModule.ts", + "version": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "signature": "19cd44ed7278957051fca663f821c916-export const World = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "signature": "2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./some_decl.d.ts", + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "signature": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6ceab83400a6167be2fb5feab881ded0-declare const dts: any;", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "target": 1 + }, + "size": 1458 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +Signatures:: +(used version) /home/src/tslibs/TS/Lib/lib.d.ts diff --git a/testdata/baselines/reference/tsbuild/solution/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js b/testdata/baselines/reference/tsbuild/solution/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js new file mode 100644 index 0000000000..66c7c6fef3 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/solution/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js @@ -0,0 +1,123 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/core/index.ts] *new* +export function multiply(a: number, b: number) { return a * b; } +//// [/home/src/workspaces/solution/core/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + }, +} +//// [/home/src/workspaces/solution/with-references/tsconfig.json] *new* +{ + "references": [ + { "path": "../core" }, + ], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b with-references +ExitStatus:: Success +Output:: +//// [/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/core/index.d.ts] *new* +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map +//// [/home/src/workspaces/solution/core/index.d.ts.map] *new* +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} +//// [/home/src/workspaces/solution/core/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.multiply = multiply; +function multiply(a, b) { return a * b; } + +//// [/home/src/workspaces/solution/core/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.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":"3e196dbeb0efd6f81808db37973c4e6d-export function multiply(a: number, b: number) { return a * b; }","signature":"0d04cb6a9ce77a203776db1857b08505-export declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./index.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": "./index.ts", + "version": "3e196dbeb0efd6f81808db37973c4e6d-export function multiply(a: number, b: number) { return a * b; }", + "signature": "0d04cb6a9ce77a203776db1857b08505-export declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3e196dbeb0efd6f81808db37973c4e6d-export function multiply(a: number, b: number) { return a * b; }", + "signature": "0d04cb6a9ce77a203776db1857b08505-export declare function multiply(a: number, b: number): number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1242 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/core/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/core/index.ts diff --git a/testdata/baselines/reference/tsbuild/solution/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js b/testdata/baselines/reference/tsbuild/solution/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js new file mode 100644 index 0000000000..d34cea0112 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/solution/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js @@ -0,0 +1,27 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/no-references/tsconfig.json] *new* +{ + "references": [], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --b no-references +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +no-references/tsconfig.json:3:14 - error TS18002: The 'files' list in config file '/home/src/workspaces/solution/no-references/tsconfig.json' is empty. + +3 "files": [], +   ~~ + + +Found 1 error in no-references/tsconfig.json:3 + + diff --git a/testdata/baselines/reference/tsbuild/solution/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/testdata/baselines/reference/tsbuild/solution/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js new file mode 100644 index 0000000000..5a18ca0fe9 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/solution/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js @@ -0,0 +1,314 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/src/folder/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/solution/src/folder/tsconfig.json] *new* +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} +//// [/home/src/workspaces/solution/src/folder2/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/solution/src/folder2/tsconfig.json] *new* +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} +//// [/home/src/workspaces/solution/src/tsconfig.json] *new* + { + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./folder" }, + { "path": "./folder2" }, + ] +} +//// [/home/src/workspaces/solution/tests/index.ts] *new* +export const x = 10; +//// [/home/src/workspaces/solution/tests/tsconfig.json] *new* +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../src" } + ] +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./src" }, + { "path": "./tests" } + ] +} + +tsgo --b --v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src/folder/tsconfig.json + * src/folder2/tsconfig.json + * src/tsconfig.json + * tests/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'src/folder/tsconfig.json' is out of date because output file 'src/folder/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/folder/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/folder2/tsconfig.json' is out of date because output file 'src/folder2/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/folder2/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output file 'tests/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tests/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/src/folder/index.d.ts] *new* +export declare const x = 10; + +//// [/home/src/workspaces/solution/src/folder/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/solution/src/folder/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.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":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/src/folder/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./index.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": "./index.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1095 +} +//// [/home/src/workspaces/solution/src/folder2/index.d.ts] *new* +export declare const x = 10; + +//// [/home/src/workspaces/solution/src/folder2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/solution/src/folder2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.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":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/src/folder2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./index.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": "./index.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1095 +} +//// [/home/src/workspaces/solution/tests/index.d.ts] *new* +export declare const x = 10; + +//// [/home/src/workspaces/solution/tests/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/solution/tests/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.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":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspaces/solution/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./index.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": "./index.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1095 +} + +src/folder/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/folder/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/folder/index.ts + +src/folder2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/src/folder2/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/src/folder2/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/tests/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/tests/index.ts + + +Edit [0]:: no change + +tsgo --b --v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src/folder/tsconfig.json + * src/folder2/tsconfig.json + * src/tsconfig.json + * tests/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'src/folder/tsconfig.json' is up to date because newest input 'src/folder/index.ts' is older than output 'src/folder/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'src/folder2/tsconfig.json' is up to date because newest input 'src/folder2/index.ts' is older than output 'src/folder2/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is up to date because newest input 'tests/index.ts' is older than output 'tests/tsconfig.tsbuildinfo' + + diff --git a/testdata/baselines/reference/tsbuild/solution/when-solution-is-referenced-indirectly.js b/testdata/baselines/reference/tsbuild/solution/when-solution-is-referenced-indirectly.js new file mode 100644 index 0000000000..3e92b927fc --- /dev/null +++ b/testdata/baselines/reference/tsbuild/solution/when-solution-is-referenced-indirectly.js @@ -0,0 +1,384 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/project1/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [] +} +//// [/home/src/workspaces/solution/project2/src/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/solution/project2/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [] +} +//// [/home/src/workspaces/solution/project3/src/c.ts] *new* +export const c = 10; +//// [/home/src/workspaces/solution/project3/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [ + { "path": "../project1" }, + { "path": "../project2" } + ] +} +//// [/home/src/workspaces/solution/project4/src/d.ts] *new* +export const d = 10; +//// [/home/src/workspaces/solution/project4/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true }, + "references": [{ "path": "../project3" }] +} + +tsgo --b project4 --verbose --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/tsconfig.json + * project2/tsconfig.json + * project3/tsconfig.json + * project4/tsconfig.json + +[HH:MM:SS AM] Project 'project2/tsconfig.json' is out of date because output file 'project2/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project2/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project2/src/b.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'project3/tsconfig.json' is out of date because output file 'project3/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project3/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project3/src/c.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'project4/tsconfig.json' is out of date because output file 'project4/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'project4/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project4/src/d.ts + Matched by default include pattern '**/*' +//// [/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/project2/src/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/workspaces/solution/project2/src/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/workspaces/solution/project2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/b.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":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./src/b.d.ts"} +//// [/home/src/workspaces/solution/project2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/b.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/b.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": "./src/b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./src/b.d.ts", + "size": 1095 +} +//// [/home/src/workspaces/solution/project3/src/c.d.ts] *new* +export declare const c = 10; + +//// [/home/src/workspaces/solution/project3/src/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = 10; + +//// [/home/src/workspaces/solution/project3/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/c.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":"8bc1c94c71c8b47587db189712f5ab2c-export const c = 10;","signature":"6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./src/c.d.ts"} +//// [/home/src/workspaces/solution/project3/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/c.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/c.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": "./src/c.ts", + "version": "8bc1c94c71c8b47587db189712f5ab2c-export const c = 10;", + "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8bc1c94c71c8b47587db189712f5ab2c-export const c = 10;", + "signature": "6bc89426f721fe78f6ac43d3e4d9058f-export declare const c = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./src/c.d.ts", + "size": 1095 +} +//// [/home/src/workspaces/solution/project4/src/d.d.ts] *new* +export declare const d = 10; + +//// [/home/src/workspaces/solution/project4/src/d.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +exports.d = 10; + +//// [/home/src/workspaces/solution/project4/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/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":"c3e4ecb1ad42999b9e5a8cbb3d993726-export const d = 10;","signature":"3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./src/d.d.ts"} +//// [/home/src/workspaces/solution/project4/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/d.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/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": "./src/d.ts", + "version": "c3e4ecb1ad42999b9e5a8cbb3d993726-export const d = 10;", + "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c3e4ecb1ad42999b9e5a8cbb3d993726-export const d = 10;", + "signature": "3624f737ffc30774e872b3f5a7340537-export declare const d = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./src/d.d.ts", + "size": 1095 +} + +project2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project2/src/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project2/src/b.ts + +project3/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project3/src/c.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project3/src/c.ts + +project4/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/solution/project4/src/d.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/project4/src/d.ts + + +Edit [0]:: modify project3 file +//// [/home/src/workspaces/solution/project3/src/c.ts] *modified* +export const cc = 10; + +tsgo --b project4 --verbose --explainFiles +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/tsconfig.json + * project2/tsconfig.json + * project3/tsconfig.json + * project4/tsconfig.json + +[HH:MM:SS AM] Project 'project2/tsconfig.json' is up to date because newest input 'project2/src/b.ts' is older than output 'project2/tsconfig.tsbuildinfo' + +[HH:MM:SS AM] Project 'project3/tsconfig.json' is out of date because output 'project3/tsconfig.tsbuildinfo' is older than input 'project3/src/c.ts' + +[HH:MM:SS AM] Building project 'project3/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project3/src/c.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Project 'project4/tsconfig.json' is out of date because output 'project4/tsconfig.tsbuildinfo' is older than input 'project3' + +[HH:MM:SS AM] Building project 'project4/tsconfig.json'... + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +project4/src/d.ts + Matched by default include pattern '**/*' +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project4/tsconfig.json'... + +//// [/home/src/workspaces/solution/project3/src/c.d.ts] *modified* +export declare const cc = 10; + +//// [/home/src/workspaces/solution/project3/src/c.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cc = void 0; +exports.cc = 10; + +//// [/home/src/workspaces/solution/project3/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/c.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":"0c1eb6b93bf327534ca72bc76ad6f9dc-export const cc = 10;","signature":"5a5b90c913f1887b69f44d96c9a641ad-export declare const cc = 10;\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./src/c.d.ts"} +//// [/home/src/workspaces/solution/project3/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/c.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/c.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": "./src/c.ts", + "version": "0c1eb6b93bf327534ca72bc76ad6f9dc-export const cc = 10;", + "signature": "5a5b90c913f1887b69f44d96c9a641ad-export declare const cc = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0c1eb6b93bf327534ca72bc76ad6f9dc-export const cc = 10;", + "signature": "5a5b90c913f1887b69f44d96c9a641ad-export declare const cc = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./src/c.d.ts", + "size": 1097 +} +//// [/home/src/workspaces/solution/project4/tsconfig.tsbuildinfo] *mTime changed* + +project3/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/solution/project3/src/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/solution/project3/src/c.ts + +project4/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/transitiveReferences/builds-correctly.js b/testdata/baselines/reference/tsbuild/transitiveReferences/builds-correctly.js new file mode 100644 index 0000000000..3a984200d9 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/transitiveReferences/builds-correctly.js @@ -0,0 +1,264 @@ +currentDirectory::/user/username/projects/transitiveReferences +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/transitiveReferences/a.ts] *new* +export class A {} +//// [/user/username/projects/transitiveReferences/b.ts] *new* +import {A} from '@ref/a'; +export const b = new A(); +//// [/user/username/projects/transitiveReferences/c.ts] *new* +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; +//// [/user/username/projects/transitiveReferences/refs/a.d.ts] *new* +export class X {} +export class A {} +//// [/user/username/projects/transitiveReferences/tsconfig.a.json] *new* +{ + "files": ["a.ts"], + "compilerOptions": { + "composite": true, + }, +} +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] *new* +{ + "files": ["b.ts"], + "compilerOptions": { + "composite": true, + "paths": { + "@ref/*": ["./*"], + }, + }, + "references": [{ "path": "tsconfig.a.json" }], +} +//// [/user/username/projects/transitiveReferences/tsconfig.c.json] *new* +{ + "files": ["c.ts"], + "compilerOptions": { + "paths": { + "@ref/*": ["./refs/*"], + }, + }, + "references": [{ "path": "tsconfig.b.json" }], +} + +tsgo --b tsconfig.c.json --listFiles +ExitStatus:: Success +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/transitiveReferences/a.ts +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.ts +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts +//// [/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; }; +//// [/user/username/projects/transitiveReferences/a.d.ts] *new* +export declare class A { +} + +//// [/user/username/projects/transitiveReferences/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.A = void 0; +class A { +} +exports.A = A; + +//// [/user/username/projects/transitiveReferences/b.d.ts] *new* +import { A } from '@ref/a'; +export declare const b: A; + +//// [/user/username/projects/transitiveReferences/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +const a_1 = require("@ref/a"); +exports.b = new a_1.A(); + +//// [/user/username/projects/transitiveReferences/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a_1 = require("@ref/a"); +b_1.b; +a_1.X; + +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"0a3004c9585165dfcdd47d90e20f798d-export class A {}","signature":"0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./a.d.ts"} +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "0a3004c9585165dfcdd47d90e20f798d-export class A {}", + "signature": "0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0a3004c9585165dfcdd47d90e20f798d-export class A {}", + "signature": "0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1083 +} +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","./a.d.ts","./b.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},"0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n",{"version":"22b83bc3eaf6d7b067d7a6659b0b318f-import {A} from '@ref/a';\nexport const b = new A();","signature":"92d534c2dbda627a55a8cdaeb4843b7a-import { A } from '@ref/a';\nexport declare const b: A;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./b.d.ts"} +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./b.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.d.ts", + "./b.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.d.ts", + "version": "0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n", + "signature": "0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "22b83bc3eaf6d7b067d7a6659b0b318f-import {A} from '@ref/a';\nexport const b = new A();", + "signature": "92d534c2dbda627a55a8cdaeb4843b7a-import { A } from '@ref/a';\nexport declare const b: A;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "22b83bc3eaf6d7b067d7a6659b0b318f-import {A} from '@ref/a';\nexport const b = new A();", + "signature": "92d534c2dbda627a55a8cdaeb4843b7a-import { A } from '@ref/a';\nexport declare const b: A;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./a.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "latestChangedDtsFile": "./b.d.ts", + "size": 1266 +} +//// [/user/username/projects/transitiveReferences/tsconfig.c.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./c.ts"]} +//// [/user/username/projects/transitiveReferences/tsconfig.c.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 45 +} + +tsconfig.a.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/transitiveReferences/a.ts +Signatures:: +(stored at emit) /user/username/projects/transitiveReferences/a.ts + +tsconfig.b.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/transitiveReferences/a.d.ts +*refresh* /user/username/projects/transitiveReferences/b.ts +Signatures:: +(stored at emit) /user/username/projects/transitiveReferences/b.ts + +tsconfig.c.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/transitiveReferences/a.d.ts +*refresh* /user/username/projects/transitiveReferences/b.d.ts +*refresh* /user/username/projects/transitiveReferences/refs/a.d.ts +*refresh* /user/username/projects/transitiveReferences/c.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js b/testdata/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js new file mode 100644 index 0000000000..7045a5c3e2 --- /dev/null +++ b/testdata/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js @@ -0,0 +1,286 @@ +currentDirectory::/user/username/projects/transitiveReferences +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/transitiveReferences/a.ts] *new* +export class A {} +//// [/user/username/projects/transitiveReferences/b.ts] *new* +import {A} from 'a'; +export const b = new A(); +//// [/user/username/projects/transitiveReferences/c.ts] *new* +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; +//// [/user/username/projects/transitiveReferences/refs/a.d.ts] *new* +export class X {} +export class A {} +//// [/user/username/projects/transitiveReferences/tsconfig.a.json] *new* +{ + "files": ["a.ts"], + "compilerOptions": { + "composite": true, + }, +} +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] *new* +{ + "files": ["b.ts"], + "compilerOptions": { + "composite": true, + "module": "nodenext", + }, + "references": [{ "path": "tsconfig.a.json" }], +} +//// [/user/username/projects/transitiveReferences/tsconfig.c.json] *new* +{ + "files": ["c.ts"], + "compilerOptions": { + "paths": { + "@ref/*": ["./refs/*"], + }, + }, + "references": [{ "path": "tsconfig.b.json" }], +} + +tsgo --b tsconfig.c.json --listFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/transitiveReferences/a.ts +b.ts:1:17 - error TS2307: Cannot find module 'a' or its corresponding type declarations. + +1 import {A} from 'a'; +   ~~~ + +/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +/user/username/projects/transitiveReferences/b.ts +/home/src/tslibs/TS/Lib/lib.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Found 1 error in b.ts:1 + +//// [/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/tslibs/TS/Lib/lib.esnext.full.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; }; +//// [/user/username/projects/transitiveReferences/a.d.ts] *new* +export declare class A { +} + +//// [/user/username/projects/transitiveReferences/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.A = void 0; +class A { +} +exports.A = A; + +//// [/user/username/projects/transitiveReferences/b.d.ts] *new* +export declare const b: any; + +//// [/user/username/projects/transitiveReferences/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +const a_1 = require("a"); +exports.b = new a_1.A(); + +//// [/user/username/projects/transitiveReferences/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const b_1 = require("./b"); +const a_1 = require("@ref/a"); +b_1.b; +a_1.X; + +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"0a3004c9585165dfcdd47d90e20f798d-export class A {}","signature":"0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./a.d.ts"} +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "0a3004c9585165dfcdd47d90e20f798d-export class A {}", + "signature": "0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0a3004c9585165dfcdd47d90e20f798d-export class A {}", + "signature": "0ccee316fe0e81d05228833d759a8fea-export declare class A {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1083 +} +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.esnext.full.d.ts","./b.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":"d0c1e70086e2297c6733a209dc8aebd5-import {A} from 'a';\nexport const b = new A();","signature":"5c4caa93805477a2ce78ec8e61b569d7-export declare const b: any;\n","impliedNodeFormat":1}],"options":{"composite":true,"module":199},"semanticDiagnosticsPerFile":[[2,[{"pos":16,"end":19,"code":2307,"category":1,"message":"Cannot find module 'a' or its corresponding type declarations."}]]],"latestChangedDtsFile":"./b.d.ts"} +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./b.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.esnext.full.d.ts", + "./b.ts" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.full.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": "./b.ts", + "version": "d0c1e70086e2297c6733a209dc8aebd5-import {A} from 'a';\nexport const b = new A();", + "signature": "5c4caa93805477a2ce78ec8e61b569d7-export declare const b: any;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d0c1e70086e2297c6733a209dc8aebd5-import {A} from 'a';\nexport const b = new A();", + "signature": "5c4caa93805477a2ce78ec8e61b569d7-export declare const b: any;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "module": 199 + }, + "semanticDiagnosticsPerFile": [ + [ + "./b.ts", + [ + { + "pos": 16, + "end": 19, + "code": 2307, + "category": 1, + "message": "Cannot find module 'a' or its corresponding type declarations." + } + ] + ] + ], + "latestChangedDtsFile": "./b.d.ts", + "size": 1296 +} +//// [/user/username/projects/transitiveReferences/tsconfig.c.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./c.ts"]} +//// [/user/username/projects/transitiveReferences/tsconfig.c.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./c.ts" + ], + "original": "./c.ts" + } + ], + "size": 45 +} + +tsconfig.a.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/transitiveReferences/a.ts +Signatures:: +(stored at emit) /user/username/projects/transitiveReferences/a.ts + +tsconfig.b.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /user/username/projects/transitiveReferences/b.ts +Signatures:: +(stored at emit) /user/username/projects/transitiveReferences/b.ts + +tsconfig.c.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/transitiveReferences/b.d.ts +*refresh* /user/username/projects/transitiveReferences/refs/a.d.ts +*refresh* /user/username/projects/transitiveReferences/c.ts +Signatures:: diff --git a/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js b/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js index 466c49d180..b874e0df4d 100644 --- a/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js +++ b/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js @@ -34,6 +34,12 @@ COMMON COMMANDS COMMAND LINE FLAGS +--help, -h +Print this message. + +--watch, -w +Watch input files. + --all Show all compiler options. @@ -49,17 +55,41 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. ---help, -h -Print this message. - ---watch, -w -Watch input files. - --build, -b Build one or more projects and their dependencies, if out of date COMMON COMPILER OPTIONS +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library declarations. one of: es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext @@ -114,36 +144,6 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This type: boolean default: false ---pretty -Enable color and formatting in TypeScript's output to make compiler errors easier to read. -type: boolean -default: true - ---declaration, -d -Generate .d.ts files from TypeScript and JavaScript files in your project. -type: boolean -default: `false`, unless `composite` is set - ---declarationMap -Create sourcemaps for d.ts files. -type: boolean -default: false - ---emitDeclarationOnly -Only output d.ts files and not JavaScript files. -type: boolean -default: false - ---sourceMap -Create source map files for emitted JavaScript files. -type: boolean -default: false - ---noEmit -Disable emitting files from a compilation. -type: boolean -default: false - You can learn about all of the compiler options at https://aka.ms/tsc diff --git a/testdata/baselines/reference/tsc/commandLine/help.js b/testdata/baselines/reference/tsc/commandLine/help.js index ab9b182ffa..74d5bff71e 100644 --- a/testdata/baselines/reference/tsc/commandLine/help.js +++ b/testdata/baselines/reference/tsc/commandLine/help.js @@ -33,6 +33,12 @@ tsc: The TypeScript Compiler - Version FakeTSVersion COMMAND LINE FLAGS +--help, -h +Print this message. + +--watch, -w +Watch input files. + --all Show all compiler options. @@ -48,17 +54,41 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. ---help, -h -Print this message. - ---watch, -w -Watch input files. - --build, -b Build one or more projects and their dependencies, if out of date COMMON COMPILER OPTIONS +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library declarations. one of: es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext @@ -113,36 +143,6 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This type: boolean default: false ---pretty -Enable color and formatting in TypeScript's output to make compiler errors easier to read. -type: boolean -default: true - ---declaration, -d -Generate .d.ts files from TypeScript and JavaScript files in your project. -type: boolean -default: `false`, unless `composite` is set - ---declarationMap -Create sourcemaps for d.ts files. -type: boolean -default: false - ---emitDeclarationOnly -Only output d.ts files and not JavaScript files. -type: boolean -default: false - ---sourceMap -Create source map files for emitted JavaScript files. -type: boolean -default: false - ---noEmit -Disable emitting files from a compilation. -type: boolean -default: false - You can learn about all of the compiler options at https://aka.ms/tsc diff --git a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js index 617b39a1ac..755231ecf2 100644 --- a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js +++ b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js @@ -34,6 +34,12 @@ tsc: The TypeScript Compiler - Version FakeTSVersion COMMAND LINE FLAGS +--help, -h +Print this message. + +--watch, -w +Watch input files. + --all Show all compiler options. @@ -49,17 +55,41 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. ---help, -h -Print this message. - ---watch, -w -Watch input files. - --build, -b Build one or more projects and their dependencies, if out of date COMMON COMPILER OPTIONS +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library declarations. one of: es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext @@ -114,36 +144,6 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This type: boolean default: false ---pretty -Enable color and formatting in TypeScript's output to make compiler errors easier to read. -type: boolean -default: true - ---declaration, -d -Generate .d.ts files from TypeScript and JavaScript files in your project. -type: boolean -default: `false`, unless `composite` is set - ---declarationMap -Create sourcemaps for d.ts files. -type: boolean -default: false - ---emitDeclarationOnly -Only output d.ts files and not JavaScript files. -type: boolean -default: false - ---sourceMap -Create source map files for emitted JavaScript files. -type: boolean -default: false - ---noEmit -Disable emitting files from a compilation. -type: boolean -default: false - You can learn about all of the compiler options at https://aka.ms/tsc diff --git a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 9bbaffbc42..a53b791e93 100644 --- a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -34,6 +34,12 @@ tsc: The TypeScript Compiler - Version FakeTSVersion COMMAND LINE FLAGS + --help, -h Print this message. + + + --watch, -w Watch input files. + +  --all Show all compiler options. @@ -49,16 +55,52 @@ tsc: The TypeScript Compiler - Version FakeTSVersion  --showConfig Print the final configuration instead of building. - --help, -h Print this message. + --build, -b Build one or more projects and their dependencies, if out of date - --watch, -w Watch input files. +COMMON COMPILER OPTIONS + --pretty Enable color and formatting in TypeScript's output to make compiler errors easier to read. - --build, -b Build one or more projects and their dependencies, if out of date + type: boolean + default: true + + + --declaration, -d Generate .d.ts files from TypeScript and JavaScript files in your project. + + type: boolean + + default: `false`, unless `composite` is set + + + --declarationMap Create sourcemaps for d.ts files. + + type: boolean + + default: false + + + --emitDeclarationOnly Only output d.ts files and not JavaScript files. + + type: boolean + + default: false + + + --sourceMap Create source map files for emitted JavaScript files. + + type: boolean + + default: false + + + --noEmit Disable emitting files from a compilation. + + type: boolean + + default: false -COMMON COMPILER OPTIONS  --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library decla rations. @@ -152,48 +194,6 @@ tsc: The TypeScript Compiler - Version FakeTSVersion default: false - --pretty Enable color and formatting in TypeScript's output to make compiler errors easier to read. - - type: boolean - - default: true - - - --declaration, -d Generate .d.ts files from TypeScript and JavaScript files in your project. - - type: boolean - - default: `false`, unless `composite` is set - - - --declarationMap Create sourcemaps for d.ts files. - - type: boolean - - default: false - - - --emitDeclarationOnly Only output d.ts files and not JavaScript files. - - type: boolean - - default: false - - - --sourceMap Create source map files for emitted JavaScript files. - - type: boolean - - default: false - - - --noEmit Disable emitting files from a compilation. - - type: boolean - - default: false - - You can learn about all of the compiler options at https://aka.ms/tsc diff --git a/testdata/baselines/reference/tsc/composite/converting-to-modules.js b/testdata/baselines/reference/tsc/composite/converting-to-modules.js new file mode 100644 index 0000000000..a7d6e9c3f5 --- /dev/null +++ b/testdata/baselines/reference/tsc/composite/converting-to-modules.js @@ -0,0 +1,172 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/main.ts] *new* +const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "module": "none", + "composite": true, + }, +} + +tsgo +ExitStatus:: Success +Output:: +//// [/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/src/main.d.ts] *new* +declare const x = 10; + +//// [/home/src/workspaces/project/src/main.js] *new* +const x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/main.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":"4447ab8c90027f28bdaff9f2056779ce-const x = 10;","signature":"4be7af7f970696121f4f582a5d074177-declare const x = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./src/main.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/main.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": "./src/main.ts", + "version": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/main.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/main.ts + + +Edit [0]:: convert to modules +//// [/home/src/workspaces/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "module": "es2015", + "composite": true, + }, +} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/main.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/main.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":"4447ab8c90027f28bdaff9f2056779ce-const x = 10;","signature":"4be7af7f970696121f4f582a5d074177-declare const x = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"module":5},"latestChangedDtsFile":"./src/main.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/main.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": "./src/main.ts", + "version": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "module": 5 + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1124 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js b/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js new file mode 100644 index 0000000000..3dfafa66b8 --- /dev/null +++ b/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-error-on-jsx-element.js @@ -0,0 +1,162 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/node_modules/solid-js/jsx-runtime.d.ts] *new* +export namespace JSX { + type IntrinsicElements = { div: {}; }; +} +//// [/home/src/projects/project/node_modules/solid-js/package.json] *new* +{ + "name": "solid-js", + "type": "module" +} +//// [/home/src/projects/project/src/main.tsx] *new* +export default
; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "module": "Node16", + "jsx": "react-jsx", + "jsxImportSource": "solid-js", + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/main.tsx:1:16 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("solid-js/jsx-runtime")' call instead. + To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`. + +1 export default
; +   ~~~~~~ + + +Found 1 error in src/main.tsx:1 + +//// [/home/src/projects/project/src/main.d.ts] *new* +declare const _default: any; +export default _default; + +//// [/home/src/projects/project/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("solid-js/jsx-runtime"); +exports.default = jsx_runtime_1.jsx("div", {}); + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.es2022.full.d.ts","./node_modules/solid-js/jsx-runtime.d.ts","./src/main.tsx"],"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":"00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}","impliedNodeFormat":99},{"version":"5af15af7f9b4d97300f8dcfb2bf5b7c4-export default
;","signature":"ca37c00363f904fe93e299b145186400-declare const _default: any;\nexport default _default;\n","impliedNodeFormat":1}],"options":{"composite":true,"jsx":4,"jsxImportSource":"solid-js","module":100},"semanticDiagnosticsPerFile":[[3,[{"pos":15,"end":21,"code":1479,"category":1,"message":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"solid-js/jsx-runtime\")' call instead.","messageChain":[{"pos":15,"end":21,"code":1483,"category":3,"message":"To convert this file to an ECMAScript module, create a local package.json file with `{ \"type\": \"module\" }`."}]}]]],"latestChangedDtsFile":"./src/main.d.ts"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/main.tsx" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./node_modules/solid-js/jsx-runtime.d.ts", + "./src/main.tsx" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./node_modules/solid-js/jsx-runtime.d.ts", + "version": "00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}", + "signature": "00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}", + "impliedNodeFormat": "ESNext", + "original": { + "version": "00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./src/main.tsx", + "version": "5af15af7f9b4d97300f8dcfb2bf5b7c4-export default
;", + "signature": "ca37c00363f904fe93e299b145186400-declare const _default: any;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5af15af7f9b4d97300f8dcfb2bf5b7c4-export default
;", + "signature": "ca37c00363f904fe93e299b145186400-declare const _default: any;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "jsx": 4, + "jsxImportSource": "solid-js", + "module": 100 + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/main.tsx", + [ + { + "pos": 15, + "end": 21, + "code": 1479, + "category": 1, + "message": "The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"solid-js/jsx-runtime\")' call instead.", + "messageChain": [ + { + "pos": 15, + "end": 21, + "code": 1483, + "category": 3, + "message": "To convert this file to an ECMAScript module, create a local package.json file with `{ \"type\": \"module\" }`." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1905 +} +//// [/home/src/tslibs/TS/Lib/lib.es2022.full.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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /home/src/projects/project/node_modules/solid-js/jsx-runtime.d.ts +*refresh* /home/src/projects/project/src/main.tsx +Signatures:: +(stored at emit) /home/src/projects/project/src/main.tsx diff --git a/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-no-crash-no-jsx-element.js b/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-no-crash-no-jsx-element.js new file mode 100644 index 0000000000..1b88deb5da --- /dev/null +++ b/testdata/baselines/reference/tsc/composite/synthetic-jsx-import-of-ESM-module-from-CJS-module-no-crash-no-jsx-element.js @@ -0,0 +1,129 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/node_modules/solid-js/jsx-runtime.d.ts] *new* +export namespace JSX { + type IntrinsicElements = { div: {}; }; +} +//// [/home/src/projects/project/node_modules/solid-js/package.json] *new* +{ + "name": "solid-js", + "type": "module" +} +//// [/home/src/projects/project/src/main.ts] *new* +export default 42; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "module": "Node16", + "jsx": "react-jsx", + "jsxImportSource": "solid-js", + }, +} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/src/main.d.ts] *new* +declare const _default: number; +export default _default; + +//// [/home/src/projects/project/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = 42; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.es2022.full.d.ts","./node_modules/solid-js/jsx-runtime.d.ts","./src/main.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":"00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}","impliedNodeFormat":99},{"version":"666fdc0c7a7f134c8c14dc85be1ebc28-export default 42;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1}],"options":{"composite":true,"jsx":4,"jsxImportSource":"solid-js","module":100},"latestChangedDtsFile":"./src/main.d.ts"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/main.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./node_modules/solid-js/jsx-runtime.d.ts", + "./src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./node_modules/solid-js/jsx-runtime.d.ts", + "version": "00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}", + "signature": "00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}", + "impliedNodeFormat": "ESNext", + "original": { + "version": "00e459cbb1596f8c4bdf988b0589433f-export namespace JSX {\n type IntrinsicElements = { div: {}; };\n}", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./src/main.ts", + "version": "666fdc0c7a7f134c8c14dc85be1ebc28-export default 42;", + "signature": "18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "666fdc0c7a7f134c8c14dc85be1ebc28-export default 42;", + "signature": "18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "jsx": 4, + "jsxImportSource": "solid-js", + "module": 100 + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1373 +} +//// [/home/src/tslibs/TS/Lib/lib.es2022.full.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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /home/src/projects/project/node_modules/solid-js/jsx-runtime.d.ts +*refresh* /home/src/projects/project/src/main.ts +Signatures:: +(stored at emit) /home/src/projects/project/src/main.ts diff --git a/testdata/baselines/reference/tsc/composite/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js b/testdata/baselines/reference/tsc/composite/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js new file mode 100644 index 0000000000..047a319921 --- /dev/null +++ b/testdata/baselines/reference/tsc/composite/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js @@ -0,0 +1,51 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/main.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo", + }, + "include": [ + "src/**/*.ts", + ], +} + +tsgo --composite false --tsBuildInfoFile null +ExitStatus:: Success +Output:: +//// [/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/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + diff --git a/testdata/baselines/reference/tsc/composite/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js b/testdata/baselines/reference/tsc/composite/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js new file mode 100644 index 0000000000..4c32e8b1cb --- /dev/null +++ b/testdata/baselines/reference/tsc/composite/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js @@ -0,0 +1,51 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/main.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo", + }, + "include": [ + "src/**/*.ts", + ], +} + +tsgo --composite false +ExitStatus:: Success +Output:: +//// [/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/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + diff --git a/testdata/baselines/reference/tsc/composite/when-setting-composite-false-on-command-line.js b/testdata/baselines/reference/tsc/composite/when-setting-composite-false-on-command-line.js new file mode 100644 index 0000000000..70d9612868 --- /dev/null +++ b/testdata/baselines/reference/tsc/composite/when-setting-composite-false-on-command-line.js @@ -0,0 +1,50 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/main.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts", + ], +} + +tsgo --composite false +ExitStatus:: Success +Output:: +//// [/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/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + diff --git a/testdata/baselines/reference/tsc/composite/when-setting-composite-null-on-command-line.js b/testdata/baselines/reference/tsc/composite/when-setting-composite-null-on-command-line.js new file mode 100644 index 0000000000..285f20672a --- /dev/null +++ b/testdata/baselines/reference/tsc/composite/when-setting-composite-null-on-command-line.js @@ -0,0 +1,109 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/main.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts", + ], +} + +tsgo --composite null +ExitStatus:: Success +Output:: +//// [/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/src/main.d.ts] *new* +export declare const x = 10; + +//// [/home/src/workspaces/project/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/main.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":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1}],"options":{"composite":true,"module":1,"target":1},"latestChangedDtsFile":"./src/main.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/main.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./src/main.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": "./src/main.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "module": 1, + "target": 1 + }, + "latestChangedDtsFile": "./src/main.d.ts", + "size": 1123 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/main.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/main.ts diff --git a/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js b/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js new file mode 100644 index 0000000000..d7050ec3e8 --- /dev/null +++ b/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors-with-incremental.js @@ -0,0 +1,261 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/index.ts] *new* +import ky from 'ky'; +export const api = ky.extend({}); +//// [/home/src/workspaces/project/node_modules/ky/distribution/index.d.ts] *new* +type KyInstance = { + extend(options: Record): KyInstance; +} +declare const ky: KyInstance; +export default ky; +//// [/home/src/workspaces/project/node_modules/ky/package.json] *new* +{ + "name": "ky", + "type": "module", + "main": "./distribution/index.js" +} +//// [/home/src/workspaces/project/package.json] *new* +{ + "type": "module" +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "composite": true, + "incremental": true, + "declaration": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --explainFiles --listEmittedFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/index.js +TSFILE: /home/src/workspaces/project/index.d.ts +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.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/index.d.ts] *new* +export declare const api: { + extend(options: Record): KyInstance; +}; + +//// [/home/src/workspaces/project/index.js] *new* +import ky from 'ky'; +export const api = ky.extend({}); + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","./node_modules/ky/distribution/index.d.ts","./index.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":"b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;","impliedNodeFormat":99},{"version":"0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});","signature":"5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"declaration":true,"module":199,"skipLibCheck":true,"skipDefaultLibCheck":true},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":34,"end":37,"code":4023,"category":1,"message":"Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named."}]]],"latestChangedDtsFile":"./index.d.ts","emitSignatures":[[3,"5229c9e2248679a39697053812e5f6bb-export declare const api: {\n extend(options: Record): KyInstance;\n};\n"]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.esnext.full.d.ts", + "./node_modules/ky/distribution/index.d.ts", + "./index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.esnext.full.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": "./node_modules/ky/distribution/index.d.ts", + "version": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;", + "signature": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "b9b50c37c18e43d94b0dd4fb43967f10-type KyInstance = {\n extend(options: Record): KyInstance;\n}\ndeclare const ky: KyInstance;\nexport default ky;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./index.ts", + "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", + "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "impliedNodeFormat": "ESNext", + "original": { + "version": "0f5091e963c17913313e4969c59e6eb4-import ky from 'ky';\nexport const api = ky.extend({});", + "signature": "5816fe34b5cf354b0d0d19bc77874616-export declare const api: {\n extend(options: Record): KyInstance;\n};\n\n(34,3): error4023: Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named.", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./node_modules/ky/distribution/index.d.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "module": 199, + "skipLibCheck": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "./index.ts": [ + "./node_modules/ky/distribution/index.d.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 34, + "end": 37, + "code": 4023, + "category": 1, + "message": "Exported variable 'api' has or is using name 'KyInstance' from external module \"/home/src/workspaces/project/node_modules/ky/distribution/index\" but cannot be named." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "emitSignatures": [ + { + "file": "./index.ts", + "signature": "5229c9e2248679a39697053812e5f6bb-export declare const api: {\n extend(options: Record): KyInstance;\n};\n", + "original": [ + 3, + "5229c9e2248679a39697053812e5f6bb-export declare const api: {\n extend(options: Record): KyInstance;\n};\n" + ] + } + ], + "size": 2171 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/node_modules/ky/distribution/index.d.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/index.ts + + +Edit [0]:: no change + +tsgo --explainFiles --listEmittedFiles +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: build -b + +tsgo -b --explainFiles --listEmittedFiles --v +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors.js b/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors.js new file mode 100644 index 0000000000..5af9d580ed --- /dev/null +++ b/testdata/baselines/reference/tsc/declarationEmit/reports-dts-generation-errors.js @@ -0,0 +1,176 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/index.ts] *new* +import ky from 'ky'; +export const api = ky.extend({}); +//// [/home/src/workspaces/project/node_modules/ky/distribution/index.d.ts] *new* +type KyInstance = { + extend(options: Record): KyInstance; +} +declare const ky: KyInstance; +export default ky; +//// [/home/src/workspaces/project/node_modules/ky/package.json] *new* +{ + "name": "ky", + "type": "module", + "main": "./distribution/index.js" +} +//// [/home/src/workspaces/project/package.json] *new* +{ + "type": "module" +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "composite": false, + "incremental": false, + "declaration": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + }, +} + +tsgo --explainFiles --listEmittedFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/index.js +TSFILE: /home/src/workspaces/project/index.d.ts +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/tslibs/TS/Lib/lib.esnext.full.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/index.d.ts] *new* +export declare const api: { + extend(options: Record): KyInstance; +}; + +//// [/home/src/workspaces/project/index.js] *new* +import ky from 'ky'; +export const api = ky.extend({}); + + + + +Edit [0]:: no change + +tsgo --explainFiles --listEmittedFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/index.js +TSFILE: /home/src/workspaces/project/index.d.ts +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/workspaces/project/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/index.js] *rewrite with same content* + + + +Edit [1]:: build -b + +tsgo -b --explainFiles --listEmittedFiles --v +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +index.ts:2:14 - error TS4023: Exported variable 'api' has or is using name 'KyInstance' from external module "/home/src/workspaces/project/node_modules/ky/distribution/index" but cannot be named. + +2 export const api = ky.extend({}); +   ~~~ + +TSFILE: /home/src/workspaces/project/index.js +TSFILE: /home/src/workspaces/project/index.d.ts +TSFILE: /home/src/workspaces/project/tsconfig.tsbuildinfo +../../tslibs/TS/Lib/lib.esnext.full.d.ts + Default library for target 'ESNext' +node_modules/ky/distribution/index.d.ts + Imported via 'ky' from file 'index.ts' + File is ECMAScript module because 'node_modules/ky/package.json' has field "type" with value "module" +index.ts + Matched by default include pattern '**/*' + File is ECMAScript module because 'package.json' has field "type" with value "module" + +Found 1 error in index.ts:2 + +//// [/home/src/workspaces/project/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/index.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":["./index.ts"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./index.ts" + ], + "original": "./index.ts" + } + ], + "size": 63 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /home/src/workspaces/project/node_modules/ky/distribution/index.d.ts +*refresh* /home/src/workspaces/project/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/index.ts diff --git a/testdata/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js b/testdata/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js new file mode 100644 index 0000000000..69a543c78f --- /dev/null +++ b/testdata/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js @@ -0,0 +1,134 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/pkg1/dist/index.d.ts] *new* +export * from './types'; +//// [/user/username/projects/myproject/pkg1/dist/types.d.ts] *new* +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] *new* +{ + "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] *new* +export * from './types'; +//// [/user/username/projects/myproject/pkg2/dist/types.d.ts] *new* +export {MetadataAccessor} from '@raymondfeng/pkg1'; +//// [/user/username/projects/myproject/pkg2/node_modules/@raymondfeng/pkg1] -> /user/username/projects/myproject/pkg1 *new* +//// [/user/username/projects/myproject/pkg2/package.json] *new* +{ + "name": "@raymondfeng/pkg2", + "version": "1.0.0", + "main": "dist/index.js", + "typings": "dist/index.d.ts" +} +//// [/user/username/projects/myproject/pkg3/node_modules/@raymondfeng/pkg2] -> /user/username/projects/myproject/pkg2 *new* +//// [/user/username/projects/myproject/pkg3/src/index.ts] *new* +export * from './keys'; +//// [/user/username/projects/myproject/pkg3/src/keys.ts] *new* +import {MetadataAccessor} from "@raymondfeng/pkg2"; +export const ADMIN = MetadataAccessor.create('1'); +//// [/user/username/projects/myproject/pkg3/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "target": "es5", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "declaration": true, + }, +} + +tsgo -p pkg3 --explainFiles +ExitStatus:: Success +Output:: +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +pkg1/dist/types.d.ts + Imported via './types' from file 'pkg1/dist/index.d.ts' +pkg1/dist/index.d.ts + Imported via '@raymondfeng/pkg1' from file 'pkg2/dist/types.d.ts' with packageId '@raymondfeng/pkg1@1.0.0' +pkg2/dist/types.d.ts + Imported via './types' from file 'pkg2/dist/index.d.ts' +pkg2/dist/index.d.ts + Imported via "@raymondfeng/pkg2" from file 'pkg3/src/keys.ts' with packageId '@raymondfeng/pkg2@1.0.0' +pkg3/src/keys.ts + Imported via './keys' from file 'pkg3/src/index.ts' + Matched by default include pattern '**/*' +pkg3/src/index.ts + Matched by default include pattern '**/*' +//// [/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; }; +//// [/user/username/projects/myproject/pkg2/node_modules/@raymondfeng/pkg1] *deleted* +//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] *new* +export * from './keys'; + +//// [/user/username/projects/myproject/pkg3/dist/index.js] *new* +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./keys"), exports); + +//// [/user/username/projects/myproject/pkg3/dist/keys.d.ts] *new* +import { MetadataAccessor } from "@raymondfeng/pkg2"; +export declare const ADMIN: MetadataAccessor; + +//// [/user/username/projects/myproject/pkg3/dist/keys.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ADMIN = void 0; +const pkg2_1 = require("@raymondfeng/pkg2"); +exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); + +//// [/user/username/projects/myproject/pkg3/node_modules/@raymondfeng/pkg2] *deleted* + diff --git a/testdata/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js b/testdata/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js new file mode 100644 index 0000000000..0d5bb3bf95 --- /dev/null +++ b/testdata/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js @@ -0,0 +1,218 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/temp/yarn/data/link/plugin-two] -> /user/username/projects/myproject/plugin-two *new* +//// [/user/username/projects/myproject/plugin-one/index.ts] *new* +import pluginTwo from "plugin-two"; // include this to add reference to symlink +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 }; +//// [/user/username/projects/myproject/plugin-one/node_modules/plugin-two] -> /temp/yarn/data/link/plugin-two *new* +//// [/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts] *new* +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; +//// [/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json] *new* +{ + "name": "typescript-fsa", + "version": "3.0.0-beta-2" +} +//// [/user/username/projects/myproject/plugin-one/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "traceResolution": true, + }, +} +//// [/user/username/projects/myproject/plugin-two/dist/commonjs/index.d.ts] *new* +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; +//// [/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts] *new* +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; +//// [/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json] *new* +{ + "name": "typescript-fsa", + "version": "3.0.0-beta-2" +} +//// [/user/username/projects/myproject/plugin-two/package.json] *new* +{ + "name": "plugin-two", + "version": "0.1.3", + "main": "dist/commonjs/index.js" +} + +tsgo -p plugin-one --explainFiles +ExitStatus:: Success +Output:: +======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/plugin-one/package.json' does not exist. +File '/user/username/projects/myproject/package.json' does not exist. +File '/user/username/projects/package.json' does not exist. +File '/user/username/package.json' does not exist. +File '/user/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'plugin-two' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/package.json'. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'dist/commonjs/index.js' that references '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js'. +File name '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.d.ts', result '/user/username/projects/myproject/plugin-two/dist/commonjs/index.d.ts'. +======== Module name 'plugin-two' was successfully resolved to '/user/username/projects/myproject/plugin-two/dist/commonjs/index.d.ts' with Package ID 'plugin-two@0.1.3'. ======== +======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/plugin-one/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json'. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts', result '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts'. +======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa@3.0.0-beta-2'. ======== +======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-two/dist/commonjs/index.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/plugin-two/dist/commonjs/package.json' does not exist. +File '/user/username/projects/myproject/plugin-two/dist/package.json' does not exist. +Found 'package.json' at '/user/username/projects/myproject/plugin-two/package.json'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/user/username/projects/myproject/plugin-two/dist/commonjs/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/plugin-two/dist/commonjs/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/plugin-two/dist/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/plugin-two/dist/node_modules/@types' does not exist, skipping all lookups in it. +Found 'package.json' at '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json'. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa.ts' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa.tsx' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.ts' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.tsx' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts', result '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts'. +======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa@3.0.0-beta-2'. ======== +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +plugin-two/node_modules/typescript-fsa/index.d.ts + Imported via "typescript-fsa" from file 'plugin-two/dist/commonjs/index.d.ts' with packageId 'typescript-fsa@3.0.0-beta-2' +plugin-two/dist/commonjs/index.d.ts + Imported via "plugin-two" from file 'plugin-one/index.ts' with packageId 'plugin-two@0.1.3' +plugin-one/node_modules/typescript-fsa/index.d.ts + Imported via "typescript-fsa" from file 'plugin-one/index.ts' with packageId 'typescript-fsa@3.0.0-beta-2' +plugin-one/index.ts + Matched by default include pattern '**/*' +//// [/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; }; +//// [/temp/yarn/data/link/plugin-two] *deleted* +//// [/user/username/projects/myproject/plugin-one/index.d.ts] *new* +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + +//// [/user/username/projects/myproject/plugin-one/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +const typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +const action = (0, typescript_fsa_1.actionCreatorFactory)("somekey"); +const featureOne = action("feature-one"); +exports.actions = { featureOne }; + +//// [/user/username/projects/myproject/plugin-one/node_modules/plugin-two] *deleted* + diff --git a/testdata/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js b/testdata/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js new file mode 100644 index 0000000000..4cd10abfa2 --- /dev/null +++ b/testdata/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js @@ -0,0 +1,213 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/plugin-one/action.ts] *new* +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 }; +//// [/user/username/projects/myproject/plugin-one/index.ts] *new* +import pluginTwo from "plugin-two"; // include this to add reference to symlink +//// [/user/username/projects/myproject/plugin-one/node_modules/plugin-two] -> /user/username/projects/myproject/plugin-two *new* +//// [/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts] *new* +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; +//// [/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json] *new* +{ + "name": "typescript-fsa", + "version": "3.0.0-beta-2" +} +//// [/user/username/projects/myproject/plugin-one/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "traceResolution": true, + }, +} +//// [/user/username/projects/myproject/plugin-two/index.d.ts] *new* +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; +//// [/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts] *new* +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; +//// [/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json] *new* +{ + "name": "typescript-fsa", + "version": "3.0.0-beta-2" +} + +tsgo -p plugin-one --explainFiles +ExitStatus:: Success +Output:: +======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/action.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/plugin-one/package.json' does not exist. +File '/user/username/projects/myproject/package.json' does not exist. +File '/user/username/projects/package.json' does not exist. +File '/user/username/package.json' does not exist. +File '/user/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json'. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts', result '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts'. +======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa@3.0.0-beta-2'. ======== +======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/plugin-one/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'plugin-two' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/package.json' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.d.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/index.ts' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/index.tsx' does not exist. +File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/index.d.ts', result '/user/username/projects/myproject/plugin-two/index.d.ts'. +======== Module name 'plugin-two' was successfully resolved to '/user/username/projects/myproject/plugin-two/index.d.ts'. ======== +======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-two/index.d.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/user/username/projects/myproject/plugin-two/package.json' does not exist. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json'. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa.ts' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa.tsx' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.ts' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.tsx' does not exist. +File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts', result '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts'. +======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa@3.0.0-beta-2'. ======== +../../../../home/src/tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +plugin-one/node_modules/typescript-fsa/index.d.ts + Imported via "typescript-fsa" from file 'plugin-one/action.ts' with packageId 'typescript-fsa@3.0.0-beta-2' +plugin-one/action.ts + Matched by default include pattern '**/*' +plugin-two/node_modules/typescript-fsa/index.d.ts + Imported via "typescript-fsa" from file 'plugin-two/index.d.ts' with packageId 'typescript-fsa@3.0.0-beta-2' +plugin-two/index.d.ts + Imported via "plugin-two" from file 'plugin-one/index.ts' +plugin-one/index.ts + Matched by default include pattern '**/*' +//// [/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; }; +//// [/user/username/projects/myproject/plugin-one/action.d.ts] *new* +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + +//// [/user/username/projects/myproject/plugin-one/action.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +const typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +const action = (0, typescript_fsa_1.actionCreatorFactory)("somekey"); +const featureOne = action("feature-one"); +exports.actions = { featureOne }; + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] *new* +export {}; + +//// [/user/username/projects/myproject/plugin-one/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/plugin-one/node_modules/plugin-two] *deleted* + diff --git a/testdata/baselines/reference/tsc/declarationEmit/when-using-Windows-paths-and-uppercase-letters.js b/testdata/baselines/reference/tsc/declarationEmit/when-using-Windows-paths-and-uppercase-letters.js new file mode 100644 index 0000000000..6b382550cf --- /dev/null +++ b/testdata/baselines/reference/tsc/declarationEmit/when-using-Windows-paths-and-uppercase-letters.js @@ -0,0 +1,129 @@ +currentDirectory::D:/Work/pkg1 +useCaseSensitiveFileNames::false +Input:: +//// [D:/Work/pkg1/package.json] *new* +{ + "name": "ts-specifier-bug", + "version": "1.0.0", + "main": "index.js" +} +//// [D:/Work/pkg1/src/main.ts] *new* + import { PartialType } from './utils'; + + class Common {} + + export class Sub extends PartialType(Common) { + id: string; + } +//// [D:/Work/pkg1/src/utils/index.ts] *new* + 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] *new* + export type MyReturnType = { + new (...args: any[]): any; + }; + + export interface MyType extends Function { + new (...args: any[]): T; + } +//// [D:/Work/pkg1/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "target": "es2017", + "outDir": "./dist", + }, + "include": ["src"], +} + +tsgo -p D:\Work\pkg1 --explainFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/utils/index.ts:8:27 - error TS2352: Conversion of type 'typeof PartialClassType' to type 'MyReturnType' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + Cannot assign an abstract constructor type to a non-abstract constructor type. + +8 return PartialClassType as MyReturnType; +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +../../home/src/tslibs/TS/Lib/lib.es2017.full.d.ts + Default library for target 'ES2017' +src/utils/type-helpers.ts + Imported via './type-helpers' from file 'src/utils/index.ts' + Matched by include pattern 'src' in 'tsconfig.json' +src/utils/index.ts + Imported via './utils' from file 'src/main.ts' + Matched by include pattern 'src' in 'tsconfig.json' +src/main.ts + Matched by include pattern 'src' in 'tsconfig.json' + +Found 1 error in src/utils/index.ts:8 + +//// [D:/Work/pkg1/dist/main.d.ts] *new* +declare const Sub_base: import("./utils/type-helpers").MyReturnType; +export declare class Sub extends Sub_base { + id: string; +} +export {}; + +//// [D:/Work/pkg1/dist/main.js] *new* +import { PartialType } from './utils'; +class Common { +} +export class Sub extends PartialType(Common) { + id; +} + +//// [D:/Work/pkg1/dist/utils/index.d.ts] *new* +import { MyType, MyReturnType } from './type-helpers'; +export declare function PartialType(classRef: MyType): MyReturnType; + +//// [D:/Work/pkg1/dist/utils/index.js] *new* +export function PartialType(classRef) { + class PartialClassType { + constructor() { } + } + return PartialClassType; +} + +//// [D:/Work/pkg1/dist/utils/type-helpers.d.ts] *new* +export type MyReturnType = { + new (...args: any[]): any; +}; +export interface MyType extends Function { + new (...args: any[]): T; +} + +//// [D:/Work/pkg1/dist/utils/type-helpers.js] *new* +export {}; + +//// [D:/home/src/tslibs/TS/Lib/lib.es2017.full.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; }; + diff --git a/testdata/baselines/reference/tsc/extends/configDir-template-showConfig.js b/testdata/baselines/reference/tsc/extends/configDir-template-showConfig.js index 6e13d50e15..4808a12b3a 100644 --- a/testdata/baselines/reference/tsc/extends/configDir-template-showConfig.js +++ b/testdata/baselines/reference/tsc/extends/configDir-template-showConfig.js @@ -8,7 +8,7 @@ Input:: "compilerOptions": { "typeRoots": ["root1", "${configDir}/root2", "root3"], "types": [], - } + }, } //// [/home/src/projects/configs/second/tsconfig.json] *new* { @@ -17,9 +17,7 @@ Input:: "declarationDir": "${configDir}/decls", "paths": { "@myscope/*": ["${configDir}/types/*"], - "other/*": ["other/*"], }, - "baseUrl": "${configDir}", }, "watchOptions": { "excludeFiles": ["${configDir}/main.ts"], @@ -29,12 +27,6 @@ Input:: // some comment export const y = 10; import { x } from "@myscope/sometype"; -//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] *new* -export const k = 10; -//// [/home/src/projects/myproject/src/secondary.ts] *new* -// some comment -export const z = 10; -import { k } from "other/sometype2"; //// [/home/src/projects/myproject/tsconfig.json] *new* { "extends": "../configs/first/tsconfig.json", @@ -45,7 +37,6 @@ import { k } from "other/sometype2"; }, } //// [/home/src/projects/myproject/types/sometype.ts] *new* -// some comment export const x = 10; tsgo --showConfig @@ -58,9 +49,6 @@ Output:: "paths": { "@myscope/*": [ "/home/src/projects/myproject/types/*" - ], - "other/*": [ - "other/*" ] }, "traceResolution": true, @@ -70,7 +58,6 @@ Output:: "/home/src/projects/configs/first/root3" ], "types": [], - "baseUrl": "/home/src/projects/myproject", "configFilePath": "/home/src/projects/myproject/tsconfig.json", "pathsBasePath": "/home/src/projects/configs/second", "showConfig": true diff --git a/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js b/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js index 02de299024..9fef469d7a 100644 --- a/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js +++ b/testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js @@ -8,7 +8,7 @@ Input:: "compilerOptions": { "typeRoots": ["root1", "${configDir}/root2", "root3"], "types": [], - } + }, } //// [/home/src/projects/configs/second/tsconfig.json] *new* { @@ -17,9 +17,7 @@ Input:: "declarationDir": "${configDir}/decls", "paths": { "@myscope/*": ["${configDir}/types/*"], - "other/*": ["other/*"], }, - "baseUrl": "${configDir}", }, "watchOptions": { "excludeFiles": ["${configDir}/main.ts"], @@ -29,12 +27,6 @@ Input:: // some comment export const y = 10; import { x } from "@myscope/sometype"; -//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] *new* -export const k = 10; -//// [/home/src/projects/myproject/src/secondary.ts] *new* -// some comment -export const z = 10; -import { k } from "other/sometype2"; //// [/home/src/projects/myproject/tsconfig.json] *new* { "extends": "../configs/first/tsconfig.json", @@ -45,11 +37,10 @@ import { k } from "other/sometype2"; }, } //// [/home/src/projects/myproject/types/sometype.ts] *new* -// some comment export const x = 10; tsgo --explainFiles --outDir ${configDir}/outDir -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: ======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'Bundler'. @@ -60,63 +51,12 @@ Trying substitution '/home/src/projects/myproject/types/*', candidate module loc Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, JavaScript, Declaration, JSON. File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. ======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== -======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== -Module resolution kind is not specified, using 'Bundler'. -Resolving in CJS mode with conditions 'require', 'types'. -'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. -Module name 'other/sometype2', matched pattern 'other/*'. -Trying substitution 'other/*', candidate module location: 'other/sometype2'. -Loading module as file / folder, candidate module location '/home/src/projects/configs/second/other/sometype2', target file types: TypeScript, JavaScript, Declaration, JSON. -File '/home/src/projects/myproject/src/package.json' does not exist. -File '/home/src/projects/myproject/package.json' does not exist. -File '/home/src/projects/package.json' does not exist. -File '/home/src/package.json' does not exist. -File '/home/package.json' does not exist. -File '/package.json' does not exist. -Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. -Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. -Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/src/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/node_modules' does not exist, skipping all lookups in it. -Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/node_modules' does not exist, skipping all lookups in it. -Directory '/node_modules/@types' does not exist, skipping all lookups in it. -Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. -Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/node_modules' does not exist, skipping all lookups in it. -Directory '/node_modules' does not exist, skipping all lookups in it. -======== Module name 'other/sometype2' was not resolved. ======== -tsconfig.json:3:5 - error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? - -3 "compilerOptions": { -   ~~~~~~~~~~~~~~~~~ - -tsconfig.json:3:5 - error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration. - Use '"paths": {"*": ["./*"]}' instead. - -3 "compilerOptions": { -   ~~~~~~~~~~~~~~~~~ - ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' types/sometype.ts - Imported via @myscope/sometype from file 'main.ts' + Imported via "@myscope/sometype" from file 'main.ts' main.ts Part of 'files' list in tsconfig.json -src/secondary.ts - Matched by include pattern '${configDir}/src' in 'tsconfig.json' - -Found 2 errors in the same file, starting at: tsconfig.json:3 - //// [/home/src/projects/myproject/${configDir}/outDir/main.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -124,30 +64,17 @@ exports.y = void 0; // some comment exports.y = 10; -//// [/home/src/projects/myproject/${configDir}/outDir/src/secondary.js] *new* -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.z = void 0; -// some comment -exports.z = 10; - //// [/home/src/projects/myproject/${configDir}/outDir/types/sometype.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; -// some comment exports.x = 10; //// [/home/src/projects/myproject/decls/main.d.ts] *new* // some comment export declare const y = 10; -//// [/home/src/projects/myproject/decls/src/secondary.d.ts] *new* -// some comment -export declare const z = 10; - //// [/home/src/projects/myproject/decls/types/sometype.d.ts] *new* -// some comment export declare const x = 10; //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* diff --git a/testdata/baselines/reference/tsc/extends/configDir-template.js b/testdata/baselines/reference/tsc/extends/configDir-template.js index 6a0adf8b7d..3b4a94d027 100644 --- a/testdata/baselines/reference/tsc/extends/configDir-template.js +++ b/testdata/baselines/reference/tsc/extends/configDir-template.js @@ -8,7 +8,7 @@ Input:: "compilerOptions": { "typeRoots": ["root1", "${configDir}/root2", "root3"], "types": [], - } + }, } //// [/home/src/projects/configs/second/tsconfig.json] *new* { @@ -17,9 +17,7 @@ Input:: "declarationDir": "${configDir}/decls", "paths": { "@myscope/*": ["${configDir}/types/*"], - "other/*": ["other/*"], }, - "baseUrl": "${configDir}", }, "watchOptions": { "excludeFiles": ["${configDir}/main.ts"], @@ -29,12 +27,6 @@ Input:: // some comment export const y = 10; import { x } from "@myscope/sometype"; -//// [/home/src/projects/myproject/root2/other/sometype2/index.d.ts] *new* -export const k = 10; -//// [/home/src/projects/myproject/src/secondary.ts] *new* -// some comment -export const z = 10; -import { k } from "other/sometype2"; //// [/home/src/projects/myproject/tsconfig.json] *new* { "extends": "../configs/first/tsconfig.json", @@ -45,11 +37,10 @@ import { k } from "other/sometype2"; }, } //// [/home/src/projects/myproject/types/sometype.ts] *new* -// some comment export const x = 10; tsgo --explainFiles -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: ======== Resolving module '@myscope/sometype' from '/home/src/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'Bundler'. @@ -60,73 +51,17 @@ Trying substitution '/home/src/projects/myproject/types/*', candidate module loc Loading module as file / folder, candidate module location '/home/src/projects/myproject/types/sometype', target file types: TypeScript, JavaScript, Declaration, JSON. File '/home/src/projects/myproject/types/sometype.ts' exists - use it as a name resolution result. ======== Module name '@myscope/sometype' was successfully resolved to '/home/src/projects/myproject/types/sometype.ts'. ======== -======== Resolving module 'other/sometype2' from '/home/src/projects/myproject/src/secondary.ts'. ======== -Module resolution kind is not specified, using 'Bundler'. -Resolving in CJS mode with conditions 'require', 'types'. -'paths' option is specified, looking for a pattern to match module name 'other/sometype2'. -Module name 'other/sometype2', matched pattern 'other/*'. -Trying substitution 'other/*', candidate module location: 'other/sometype2'. -Loading module as file / folder, candidate module location '/home/src/projects/configs/second/other/sometype2', target file types: TypeScript, JavaScript, Declaration, JSON. -File '/home/src/projects/myproject/src/package.json' does not exist. -File '/home/src/projects/myproject/package.json' does not exist. -File '/home/src/projects/package.json' does not exist. -File '/home/src/package.json' does not exist. -File '/home/package.json' does not exist. -File '/package.json' does not exist. -Loading module 'other/sometype2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. -Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. -Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/src/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/home/node_modules' does not exist, skipping all lookups in it. -Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. -Directory '/node_modules' does not exist, skipping all lookups in it. -Directory '/node_modules/@types' does not exist, skipping all lookups in it. -Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON. -Directory '/home/src/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/myproject/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. -Directory '/home/src/node_modules' does not exist, skipping all lookups in it. -Directory '/home/node_modules' does not exist, skipping all lookups in it. -Directory '/node_modules' does not exist, skipping all lookups in it. -======== Module name 'other/sometype2' was not resolved. ======== -tsconfig.json:3:5 - error TS5090: Non-relative paths are not allowed. Did you forget a leading './'? - -3 "compilerOptions": { -   ~~~~~~~~~~~~~~~~~ - -tsconfig.json:3:5 - error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration. - Use '"paths": {"*": ["./*"]}' instead. - -3 "compilerOptions": { -   ~~~~~~~~~~~~~~~~~ - ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' types/sometype.ts - Imported via @myscope/sometype from file 'main.ts' + Imported via "@myscope/sometype" from file 'main.ts' main.ts Part of 'files' list in tsconfig.json -src/secondary.ts - Matched by include pattern '${configDir}/src' in 'tsconfig.json' - -Found 2 errors in the same file, starting at: tsconfig.json:3 - //// [/home/src/projects/myproject/decls/main.d.ts] *new* // some comment export declare const y = 10; -//// [/home/src/projects/myproject/decls/src/secondary.d.ts] *new* -// some comment -export declare const z = 10; - //// [/home/src/projects/myproject/decls/types/sometype.d.ts] *new* -// some comment export declare const x = 10; //// [/home/src/projects/myproject/outDir/main.js] *new* @@ -136,18 +71,10 @@ exports.y = void 0; // some comment exports.y = 10; -//// [/home/src/projects/myproject/outDir/src/secondary.js] *new* -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.z = void 0; -// some comment -exports.z = 10; - //// [/home/src/projects/myproject/outDir/types/sometype.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.x = void 0; -// some comment exports.x = 10; //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* diff --git a/testdata/baselines/reference/tsc/extends/resolves-the-symlink-path.js b/testdata/baselines/reference/tsc/extends/resolves-the-symlink-path.js new file mode 100644 index 0000000000..05d6d6bee7 --- /dev/null +++ b/testdata/baselines/reference/tsc/extends/resolves-the-symlink-path.js @@ -0,0 +1,115 @@ +currentDirectory::/users/user/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/users/user/projects/myconfigs/node_modules/@something/tsconfig-base/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} +//// [/users/user/projects/myconfigs/node_modules/@something/tsconfig-node/tsconfig.json] *new* +{ + "extends": "@something/tsconfig-base/tsconfig.json", + "compilerOptions": { + "removeComments": true + } +} +//// [/users/user/projects/myproject/node_modules/@something/tsconfig-node] -> /users/user/projects/myconfigs/node_modules/@something/tsconfig-node *new* +//// [/users/user/projects/myproject/src/index.ts] *new* +// some comment +export const x = 10; +//// [/users/user/projects/myproject/src/tsconfig.json] *new* +{ + "extends": "@something/tsconfig-node/tsconfig.json" +} + +tsgo -p src --extendedDiagnostics +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/users/user/projects/myproject/node_modules/@something/tsconfig-node] *deleted* +//// [/users/user/projects/myproject/src/index.d.ts] *new* +export declare const x = 10; + +//// [/users/user/projects/myproject/src/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/users/user/projects/myproject/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.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":"03965946b1acc2afec91a302f9646317-// some comment\nexport const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1}],"options":{"composite":true,"removeComments":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/users/user/projects/myproject/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./index.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": "./index.ts", + "version": "03965946b1acc2afec91a302f9646317-// some comment\nexport const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "03965946b1acc2afec91a302f9646317-// some comment\nexport const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "removeComments": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1134 +} + +src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /users/user/projects/myproject/src/index.ts +Signatures:: +(stored at emit) /users/user/projects/myproject/src/index.ts diff --git a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js index d3f3690594..302f4a812c 100644 --- a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js +++ b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js @@ -79,10 +79,22 @@ function logMessage(person) { export {}; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"3847cb0c7d8f5a6eaa57e0b19ab33ea8-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"3847cb0c7d8f5a6eaa57e0b19ab33ea8-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./MessageablePerson.ts", + "./main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./MessageablePerson.ts", @@ -138,7 +150,7 @@ export {}; "./MessageablePerson.ts" ] }, - "size": 2019 + "size": 2034 } tsconfig.json:: @@ -202,10 +214,22 @@ Errors Files //// [/home/src/workspaces/project/main.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"message":"Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses."}]]],"emitDiagnosticsPerFile":[[2,[{"pos":116,"end":123,"code":4094,"category":1,"message":"Property 'message' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":116,"end":123,"code":9027,"category":1,"message":"Add a type annotation to the variable wrapper."}]}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"message":"Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses."}]]],"emitDiagnosticsPerFile":[[2,[{"pos":116,"end":123,"code":4094,"category":1,"message":"Property 'message' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":116,"end":123,"code":9027,"category":1,"message":"Add a type annotation to the variable wrapper."}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./MessageablePerson.ts", + "./main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./MessageablePerson.ts", @@ -298,7 +322,7 @@ Errors Files ] ] ], - "size": 2702 + "size": 2717 } tsconfig.json:: @@ -363,10 +387,22 @@ Output:: //// [/home/src/workspaces/project/main.d.ts] *rewrite with same content* //// [/home/src/workspaces/project/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"3847cb0c7d8f5a6eaa57e0b19ab33ea8-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"3847cb0c7d8f5a6eaa57e0b19ab33ea8-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"module":99},"referencedMap":[[3,1]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./MessageablePerson.ts", + "./main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./MessageablePerson.ts", @@ -422,7 +458,7 @@ Output:: "./MessageablePerson.ts" ] }, - "size": 2019 + "size": 2034 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js index 44cd75b955..5fb23344b4 100644 --- a/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js +++ b/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field.js @@ -66,10 +66,22 @@ function logMessage(person) { export {}; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}"],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}"],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./MessageablePerson.ts", + "./main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./MessageablePerson.ts", @@ -114,7 +126,7 @@ export {}; "./MessageablePerson.ts" ] }, - "size": 1636 + "size": 1651 } tsconfig.json:: @@ -161,10 +173,22 @@ Found 1 error in main.ts:3 //// [/home/src/workspaces/project/MessageablePerson.js] *rewrite with same content* //// [/home/src/workspaces/project/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"message":"Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses."}]]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fc3bcee26e986c769691717bfbe49525-const Messageable = () => {\n return class MessageableClass {\n protected message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"eb669b96f45855935c22925689eec67c-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n\n(116,7): error4094: Property 'message' of exported anonymous class type may not be private or protected.\n(116,7): error9027: Add a type annotation to the variable wrapper.","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":131,"end":138,"code":2445,"category":1,"message":"Property 'message' is protected and only accessible within class 'MessageableClass' and its subclasses."}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./MessageablePerson.ts", + "./main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./MessageablePerson.ts", @@ -233,7 +257,7 @@ Found 1 error in main.ts:3 ] ] ], - "size": 2377 + "size": 2392 } tsconfig.json:: @@ -281,10 +305,22 @@ Output:: //// [/home/src/workspaces/project/MessageablePerson.js] *rewrite with same content* //// [/home/src/workspaces/project/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"3847cb0c7d8f5a6eaa57e0b19ab33ea8-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./MessageablePerson.ts","./main.ts"],"fileInfos":[{"version":"778b786cd1eca831889c50ded7c79c1d-/// \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; };\ntype ReturnType any> = T extends (...args: any) => infer R ? R : any;\ntype InstanceType any> = T extends abstract new (...args: any) => infer R ? R : any;","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"500cfddf7f97c595e46579b9b5afc9bd-const Messageable = () => {\n return class MessageableClass {\n public message = 'hello';\n }\n};\nconst wrapper = () => Messageable();\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;","signature":"3847cb0c7d8f5a6eaa57e0b19ab33ea8-declare const wrapper: () => {\n new (): {\n message: string;\n };\n};\ntype MessageablePerson = InstanceType>;\nexport default MessageablePerson;\n","impliedNodeFormat":1},{"version":"f1d6119c9df9ff1b48604c0e5c5f624f-import MessageablePerson from './MessageablePerson.js';\nfunction logMessage( person: MessageablePerson ) {\n console.log( person.message );\n}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"module":99},"referencedMap":[[3,1]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./MessageablePerson.ts", + "./main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./MessageablePerson.ts", @@ -339,7 +375,7 @@ Output:: "./MessageablePerson.ts" ] }, - "size": 2000 + "size": 2015 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js b/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js index 0c78cd54c2..14d135d72d 100644 --- a/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js +++ b/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js @@ -70,10 +70,24 @@ const constants_1 = require("./constants"); Object.defineProperty(exports, "ConstantNumber", { enumerable: true, get: function () { return constants_1.default; } }); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c93bc8f54a24dc311538894cf3d7ac17-export default 1;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"75c0647a66f2f74c4448b4b393e889d1-export { default as ConstantNumber } from \"./constants\"","signature":"3c986fce7f0f21b6b269681962fc7feb-export { default as ConstantNumber } from \"./constants\";\n","impliedNodeFormat":1},{"version":"d84f446b9b1fc3f56545f03793b7992c-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[4]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./reexport.d.ts"} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c93bc8f54a24dc311538894cf3d7ac17-export default 1;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"75c0647a66f2f74c4448b4b393e889d1-export { default as ConstantNumber } from \"./constants\"","signature":"3c986fce7f0f21b6b269681962fc7feb-export { default as ConstantNumber } from \"./constants\";\n","impliedNodeFormat":1},{"version":"d84f446b9b1fc3f56545f03793b7992c-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[4]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./reexport.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./class1.ts", + "./constants.ts", + "./reexport.ts", + "./types.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], "fileNames": [ "lib.d.ts", "./class1.ts", @@ -162,7 +176,7 @@ Object.defineProperty(exports, "ConstantNumber", { enumerable: true, get: functi ] }, "latestChangedDtsFile": "./reexport.d.ts", - "size": 1816 + "size": 1831 } tsconfig.json:: @@ -191,10 +205,24 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = 2; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b8fa0b3912c91197fa3ec685cbc93c70-export default 2;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"75c0647a66f2f74c4448b4b393e889d1-export { default as ConstantNumber } from \"./constants\"","signature":"3c986fce7f0f21b6b269681962fc7feb-export { default as ConstantNumber } from \"./constants\";\n","impliedNodeFormat":1},{"version":"d84f446b9b1fc3f56545f03793b7992c-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[4]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./reexport.d.ts"} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b8fa0b3912c91197fa3ec685cbc93c70-export default 2;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"75c0647a66f2f74c4448b4b393e889d1-export { default as ConstantNumber } from \"./constants\"","signature":"3c986fce7f0f21b6b269681962fc7feb-export { default as ConstantNumber } from \"./constants\";\n","impliedNodeFormat":1},{"version":"d84f446b9b1fc3f56545f03793b7992c-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[4]],"options":{"composite":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./reexport.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./class1.ts", + "./constants.ts", + "./reexport.ts", + "./types.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], "fileNames": [ "lib.d.ts", "./class1.ts", @@ -283,7 +311,7 @@ exports.default = 2; ] }, "latestChangedDtsFile": "./reexport.d.ts", - "size": 1816 + "size": 1831 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js b/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js index 4350dc09ed..87b69c8daf 100644 --- a/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js +++ b/testdata/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js @@ -58,10 +58,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = 1; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./class1.ts","./constants.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c93bc8f54a24dc311538894cf3d7ac17-export default 1;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"45ee7661a81bc095b54ab4944b849fee-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./constants.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./class1.ts","./constants.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"c93bc8f54a24dc311538894cf3d7ac17-export default 1;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"45ee7661a81bc095b54ab4944b849fee-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./constants.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./class1.ts", + "./constants.ts", + "./types.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], "fileNames": [ "lib.d.ts", "./class1.ts", @@ -132,7 +145,7 @@ exports.default = 1; ] }, "latestChangedDtsFile": "./constants.d.ts", - "size": 1550 + "size": 1565 } tsconfig.json:: @@ -159,10 +172,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = 2; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./class1.ts","./constants.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b8fa0b3912c91197fa3ec685cbc93c70-export default 2;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"45ee7661a81bc095b54ab4944b849fee-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./constants.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./class1.ts","./constants.ts","./types.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":"881068d51dfd24d338a5f3706ee1097f-const a: MagicNumber = 1;\nconsole.log(a);","signature":"f59d1a67db5f979e23689dc09b68c628-declare const a = 1;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b8fa0b3912c91197fa3ec685cbc93c70-export default 2;","signature":"18ae69a2c0b372747b9973ad9c14a1e0-declare const _default: number;\nexport default _default;\n","impliedNodeFormat":1},{"version":"45ee7661a81bc095b54ab4944b849fee-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true},"referencedMap":[[4,1]],"latestChangedDtsFile":"./constants.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./class1.ts", + "./constants.ts", + "./types.d.ts" + ], + "original": [ + 2, + 4 + ] + } + ], "fileNames": [ "lib.d.ts", "./class1.ts", @@ -233,7 +259,7 @@ exports.default = 2; ] }, "latestChangedDtsFile": "./constants.d.ts", - "size": 1550 + "size": 1565 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/const-enums-aliased-in-different-file.js b/testdata/baselines/reference/tsc/incremental/const-enums-aliased-in-different-file.js index b1364e3fac..abba6fc1fe 100644 --- a/testdata/baselines/reference/tsc/incremental/const-enums-aliased-in-different-file.js +++ b/testdata/baselines/reference/tsc/incremental/const-enums-aliased-in-different-file.js @@ -47,10 +47,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 1 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"8a851657dbab1650611535d934e0e8a0-export const enum AWorker {\n ONE = 1\n}","e1ab01aa60a97dafcae2e9a0fe6467c6-export { AWorker as A } from \"./worker\";","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"8a851657dbab1650611535d934e0e8a0-export const enum AWorker {\n ONE = 1\n}","e1ab01aa60a97dafcae2e9a0fe6467c6-export { AWorker as A } from \"./worker\";","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 5 + } + ], "fileNames": [ "lib.d.ts", "./worker.d.ts", @@ -121,7 +129,7 @@ let a = 1 /* A.ONE */; "./b.d.ts" ] }, - "size": 1310 + "size": 1321 } //// [/home/src/workspaces/project/c.js] *new* "use strict"; @@ -153,10 +161,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 2 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"85732ecf91c49f8d8fff8ae96e3c1c8b-export const enum AWorker {\n ONE = 2\n}","e1ab01aa60a97dafcae2e9a0fe6467c6-export { AWorker as A } from \"./worker\";","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"85732ecf91c49f8d8fff8ae96e3c1c8b-export const enum AWorker {\n ONE = 2\n}","e1ab01aa60a97dafcae2e9a0fe6467c6-export { AWorker as A } from \"./worker\";","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 5 + } + ], "fileNames": [ "lib.d.ts", "./worker.d.ts", @@ -227,7 +243,7 @@ let a = 2 /* A.ONE */; "./b.d.ts" ] }, - "size": 1310 + "size": 1321 } //// [/home/src/workspaces/project/c.js] *modified* "use strict"; @@ -262,10 +278,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 3 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"c1b69d4c011b97277dab4f0539048ca5-export const enum AWorker {\n ONE = 3\n}","e1ab01aa60a97dafcae2e9a0fe6467c6-export { AWorker as A } from \"./worker\";","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"c1b69d4c011b97277dab4f0539048ca5-export const enum AWorker {\n ONE = 3\n}","e1ab01aa60a97dafcae2e9a0fe6467c6-export { AWorker as A } from \"./worker\";","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 5 + } + ], "fileNames": [ "lib.d.ts", "./worker.d.ts", @@ -336,7 +360,7 @@ let a = 3 /* A.ONE */; "./b.d.ts" ] }, - "size": 1310 + "size": 1321 } //// [/home/src/workspaces/project/c.js] *modified* "use strict"; @@ -365,10 +389,18 @@ ExitStatus:: Success Output:: //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"c1b69d4c011b97277dab4f0539048ca5-export const enum AWorker {\n ONE = 3\n}","7e628d40719306e63d220f210cef8697-export { AWorker as A } from \"./worker\";export const randomThing = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},{"version":"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"c1b69d4c011b97277dab4f0539048ca5-export const enum AWorker {\n ONE = 3\n}","7e628d40719306e63d220f210cef8697-export { AWorker as A } from \"./worker\";export const randomThing = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},{"version":"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 5 + } + ], "fileNames": [ "lib.d.ts", "./worker.d.ts", @@ -449,7 +481,7 @@ Output:: "./b.d.ts" ] }, - "size": 1559 + "size": 1570 } //// [/home/src/workspaces/project/c.js] *rewrite with same content* @@ -471,10 +503,18 @@ tsgo -i a.ts --tsbuildinfofile a.tsbuildinfo ExitStatus:: Success Output:: //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"c1b69d4c011b97277dab4f0539048ca5-export const enum AWorker {\n ONE = 3\n}","85de628566e341d0050fe40f7319973e-export { AWorker as A } from \"./worker\";export const randomThing = 10;export const randomThing2 = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.d.ts","./worker.d.ts","./b.d.ts","./c.ts","./a.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},"c1b69d4c011b97277dab4f0539048ca5-export const enum AWorker {\n ONE = 3\n}","85de628566e341d0050fe40f7319973e-export { AWorker as A } from \"./worker\";export const randomThing = 10;export const randomThing2 = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[4],[2],[3]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[5,1],[3,2],[4,3]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 5 + } + ], "fileNames": [ "lib.d.ts", "./worker.d.ts", @@ -550,7 +590,7 @@ Output:: "./b.d.ts" ] }, - "size": 1496 + "size": 1507 } //// [/home/src/workspaces/project/c.js] *rewrite with same content* diff --git a/testdata/baselines/reference/tsc/incremental/const-enums-aliased.js b/testdata/baselines/reference/tsc/incremental/const-enums-aliased.js index cbdc0364bf..03688a899d 100644 --- a/testdata/baselines/reference/tsc/incremental/const-enums-aliased.js +++ b/testdata/baselines/reference/tsc/incremental/const-enums-aliased.js @@ -50,10 +50,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 1 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"ea072a4c56b3b914bbdded014050bb9b-export const enum AWorker {\n ONE = 1\n}\nexport { AWorker as A };","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"ea072a4c56b3b914bbdded014050bb9b-export const enum AWorker {\n ONE = 1\n}\nexport { AWorker as A };","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -111,7 +119,7 @@ let a = 1 /* A.ONE */; "./b.d.ts" ] }, - "size": 1232 + "size": 1243 } //// [/home/src/workspaces/project/c.js] *new* "use strict"; @@ -143,10 +151,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 2 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"ec710e331e7d6432e994b69e21aae83c-export const enum AWorker {\n ONE = 2\n}\nexport { AWorker as A };",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},{"version":"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"ec710e331e7d6432e994b69e21aae83c-export const enum AWorker {\n ONE = 2\n}\nexport { AWorker as A };",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},{"version":"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -214,7 +230,7 @@ let a = 2 /* A.ONE */; "./b.d.ts" ] }, - "size": 1451 + "size": 1462 } //// [/home/src/workspaces/project/c.js] *modified* "use strict"; @@ -248,10 +264,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 3 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"a65f34f1792fbedf7b83c3bf4a12fc1d-export const enum AWorker {\n ONE = 3\n}\nexport { AWorker as A };",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"a65f34f1792fbedf7b83c3bf4a12fc1d-export const enum AWorker {\n ONE = 3\n}\nexport { AWorker as A };",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -314,7 +338,7 @@ let a = 3 /* A.ONE */; "./b.d.ts" ] }, - "size": 1357 + "size": 1368 } //// [/home/src/workspaces/project/c.js] *modified* "use strict"; @@ -344,10 +368,18 @@ ExitStatus:: Success Output:: //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"842b68cd3ee2dcec7d1df8517668c731-export const enum AWorker {\n ONE = 3\n}\nexport { AWorker as A };export const randomThing = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"842b68cd3ee2dcec7d1df8517668c731-export const enum AWorker {\n ONE = 3\n}\nexport { AWorker as A };export const randomThing = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -410,7 +442,7 @@ Output:: "./b.d.ts" ] }, - "size": 1387 + "size": 1398 } //// [/home/src/workspaces/project/c.js] *rewrite with same content* @@ -436,10 +468,18 @@ ExitStatus:: Success Output:: //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"2e80eb5c14425cedaabae48745225bc6-export const enum AWorker {\n ONE = 3\n}\nexport { AWorker as A };export const randomThing = 10;export const randomThing2 = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"2e80eb5c14425cedaabae48745225bc6-export const enum AWorker {\n ONE = 3\n}\nexport { AWorker as A };export const randomThing = 10;export const randomThing2 = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -502,7 +542,7 @@ Output:: "./b.d.ts" ] }, - "size": 1418 + "size": 1429 } //// [/home/src/workspaces/project/c.js] *rewrite with same content* diff --git a/testdata/baselines/reference/tsc/incremental/const-enums.js b/testdata/baselines/reference/tsc/incremental/const-enums.js index a9eafd6683..eb13001905 100644 --- a/testdata/baselines/reference/tsc/incremental/const-enums.js +++ b/testdata/baselines/reference/tsc/incremental/const-enums.js @@ -49,10 +49,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 1 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"53c5c35ee54571b647e3f723569d09cf-export const enum A {\n ONE = 1\n}","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"53c5c35ee54571b647e3f723569d09cf-export const enum A {\n ONE = 1\n}","27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -110,7 +118,7 @@ let a = 1 /* A.ONE */; "./b.d.ts" ] }, - "size": 1200 + "size": 1211 } //// [/home/src/workspaces/project/c.js] *new* "use strict"; @@ -141,10 +149,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 2 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"d04ca273da9def3b63557363c6eae3ca-export const enum A {\n ONE = 2\n}",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},{"version":"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"d04ca273da9def3b63557363c6eae3ca-export const enum A {\n ONE = 2\n}",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},{"version":"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -212,7 +228,7 @@ let a = 2 /* A.ONE */; "./b.d.ts" ] }, - "size": 1419 + "size": 1430 } //// [/home/src/workspaces/project/c.js] *modified* "use strict"; @@ -245,10 +261,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); let a = 3 /* A.ONE */; //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"097e7efa854e788c6281c17b46d9460a-export const enum A {\n ONE = 3\n}",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"097e7efa854e788c6281c17b46d9460a-export const enum A {\n ONE = 3\n}",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -311,7 +335,7 @@ let a = 3 /* A.ONE */; "./b.d.ts" ] }, - "size": 1325 + "size": 1336 } //// [/home/src/workspaces/project/c.js] *modified* "use strict"; @@ -340,10 +364,18 @@ ExitStatus:: Success Output:: //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"40d09f9f7c0089340619c57a80ff0ab1-export const enum A {\n ONE = 3\n}export const randomThing = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"40d09f9f7c0089340619c57a80ff0ab1-export const enum A {\n ONE = 3\n}export const randomThing = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -406,7 +438,7 @@ Output:: "./b.d.ts" ] }, - "size": 1355 + "size": 1366 } //// [/home/src/workspaces/project/c.js] *rewrite with same content* @@ -431,10 +463,18 @@ ExitStatus:: Success Output:: //// [/home/src/workspaces/project/a.js] *rewrite with same content* //// [/home/src/workspaces/project/a.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"ee6472d5ac80e48bb4cea44493dd5fe8-export const enum A {\n ONE = 3\n}export const randomThing = 10;export const randomThing2 = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.d.ts","./b.d.ts","./c.ts","./a.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},"ee6472d5ac80e48bb4cea44493dd5fe8-export const enum A {\n ONE = 3\n}export const randomThing = 10;export const randomThing2 = 10;",{"version":"27be335cb83f09e0543d1a6458f51e79-import {A} from \"./b\"\nlet b = A.ONE\nexport {A}","signature":"f6d90ac6a94594899853de488fc81940-import { A } from \"./b\";\nexport { A };\n","impliedNodeFormat":1},"f69fa3d8747995fb7603cfd9c694aa6b-import {A} from \"./c\"\nlet a = A.ONE"],"fileIdsList":[[3],[2]],"options":{"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]]} //// [/home/src/workspaces/project/a.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 4 + } + ], "fileNames": [ "lib.d.ts", "./b.d.ts", @@ -497,7 +537,7 @@ Output:: "./b.d.ts" ] }, - "size": 1386 + "size": 1397 } //// [/home/src/workspaces/project/c.js] *rewrite with same content* diff --git a/testdata/baselines/reference/tsc/incremental/generates-typerefs-correctly.js b/testdata/baselines/reference/tsc/incremental/generates-typerefs-correctly.js index e0407c36f9..a8471af0bb 100644 --- a/testdata/baselines/reference/tsc/incremental/generates-typerefs-correctly.js +++ b/testdata/baselines/reference/tsc/incremental/generates-typerefs-correctly.js @@ -112,10 +112,23 @@ export type Wrap = { Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","../src/box.ts","../src/wrap.ts","../src/bug.js"],"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":"1cd060b4cfa55ea2a47d197d9f36eb29-export interface Box {\n unbox(): T\n}","signature":"ccd603d89ad1b8ff239d77bc32963c82-export interface Box {\n unbox(): T;\n}\n","impliedNodeFormat":1},{"version":"1bc7a2cd8efebbc7d3a335f2e15093fd-export type Wrap = {\n [K in keyof C]: { wrapped: C[K] }\n}","signature":"78de3c807d49489120ea1f77c5bb07aa-export type Wrap = {\n [K in keyof C]: {\n wrapped: C[K];\n };\n};\n","impliedNodeFormat":1},{"version":"b4e9b31d9609a8709f2fc33522d84448-import * as B from \"./box.js\"\nimport * as W from \"./wrap.js\"\n\n/**\n * @template {object} C\n * @param {C} source\n * @returns {W.Wrap}\n */\nconst wrap = source => {\nthrow source\n}\n\n/**\n * @returns {B.Box}\n */\nconst box = (n = 0) => ({ unbox: () => n })\n\nexport const bug = wrap({ n: box(1) });","signature":"7c385e40e65a179131e0621fad086d2a-import * as B from \"./box.js\";\nimport * as W from \"./wrap.js\";\nexport declare const bug: W.Wrap<{\n n: B.Box;\n}>;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"checkJs":true,"composite":true,"outDir":"./"},"referencedMap":[[4,1]],"latestChangedDtsFile":"./src/wrap.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../src/box.ts","../src/wrap.ts","../src/bug.js"],"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":"1cd060b4cfa55ea2a47d197d9f36eb29-export interface Box {\n unbox(): T\n}","signature":"ccd603d89ad1b8ff239d77bc32963c82-export interface Box {\n unbox(): T;\n}\n","impliedNodeFormat":1},{"version":"1bc7a2cd8efebbc7d3a335f2e15093fd-export type Wrap = {\n [K in keyof C]: { wrapped: C[K] }\n}","signature":"78de3c807d49489120ea1f77c5bb07aa-export type Wrap = {\n [K in keyof C]: {\n wrapped: C[K];\n };\n};\n","impliedNodeFormat":1},{"version":"b4e9b31d9609a8709f2fc33522d84448-import * as B from \"./box.js\"\nimport * as W from \"./wrap.js\"\n\n/**\n * @template {object} C\n * @param {C} source\n * @returns {W.Wrap}\n */\nconst wrap = source => {\nthrow source\n}\n\n/**\n * @returns {B.Box}\n */\nconst box = (n = 0) => ({ unbox: () => n })\n\nexport const bug = wrap({ n: box(1) });","signature":"7c385e40e65a179131e0621fad086d2a-import * as B from \"./box.js\";\nimport * as W from \"./wrap.js\";\nexport declare const bug: W.Wrap<{\n n: B.Box;\n}>;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"checkJs":true,"composite":true,"outDir":"./"},"referencedMap":[[4,1]],"latestChangedDtsFile":"./src/bug.d.ts"} //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/box.ts", + "../src/wrap.ts", + "../src/bug.js" + ], + "original": [ + 2, + 4 + ] + } + ], "fileNames": [ "lib.d.ts", "../src/box.ts", @@ -186,8 +199,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); "../src/wrap.ts" ] }, - "latestChangedDtsFile": "./src/wrap.d.ts", - "size": 2078 + "latestChangedDtsFile": "./src/bug.d.ts", + "size": 2092 } tsconfig.json:: @@ -256,10 +269,23 @@ exports.bug = wrap({ n: box(1) }); exports.something = 1; //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","../src/box.ts","../src/wrap.ts","../src/bug.js"],"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":"1cd060b4cfa55ea2a47d197d9f36eb29-export interface Box {\n unbox(): T\n}","signature":"ccd603d89ad1b8ff239d77bc32963c82-export interface Box {\n unbox(): T;\n}\n","impliedNodeFormat":1},{"version":"1bc7a2cd8efebbc7d3a335f2e15093fd-export type Wrap = {\n [K in keyof C]: { wrapped: C[K] }\n}","signature":"78de3c807d49489120ea1f77c5bb07aa-export type Wrap = {\n [K in keyof C]: {\n wrapped: C[K];\n };\n};\n","impliedNodeFormat":1},{"version":"6eacf2e4d90c851011e8978446ec65d2-import * as B from \"./box.js\"\nimport * as W from \"./wrap.js\"\n\n/**\n * @template {object} C\n * @param {C} source\n * @returns {W.Wrap}\n */\nconst wrap = source => {\nthrow source\n}\n\n/**\n * @returns {B.Box}\n */\nconst box = (n = 0) => ({ unbox: () => n })\n\nexport const bug = wrap({ n: box(1) });export const something = 1;","signature":"d57e9c5bf62a61457d245408176c990e-import * as B from \"./box.js\";\nimport * as W from \"./wrap.js\";\nexport declare const bug: W.Wrap<{\n n: B.Box;\n}>;\nexport declare const something = 1;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"checkJs":true,"composite":true,"outDir":"./"},"referencedMap":[[4,1]],"latestChangedDtsFile":"./src/bug.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../src/box.ts","../src/wrap.ts","../src/bug.js"],"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":"1cd060b4cfa55ea2a47d197d9f36eb29-export interface Box {\n unbox(): T\n}","signature":"ccd603d89ad1b8ff239d77bc32963c82-export interface Box {\n unbox(): T;\n}\n","impliedNodeFormat":1},{"version":"1bc7a2cd8efebbc7d3a335f2e15093fd-export type Wrap = {\n [K in keyof C]: { wrapped: C[K] }\n}","signature":"78de3c807d49489120ea1f77c5bb07aa-export type Wrap = {\n [K in keyof C]: {\n wrapped: C[K];\n };\n};\n","impliedNodeFormat":1},{"version":"6eacf2e4d90c851011e8978446ec65d2-import * as B from \"./box.js\"\nimport * as W from \"./wrap.js\"\n\n/**\n * @template {object} C\n * @param {C} source\n * @returns {W.Wrap}\n */\nconst wrap = source => {\nthrow source\n}\n\n/**\n * @returns {B.Box}\n */\nconst box = (n = 0) => ({ unbox: () => n })\n\nexport const bug = wrap({ n: box(1) });export const something = 1;","signature":"d57e9c5bf62a61457d245408176c990e-import * as B from \"./box.js\";\nimport * as W from \"./wrap.js\";\nexport declare const bug: W.Wrap<{\n n: B.Box;\n}>;\nexport declare const something = 1;\n","impliedNodeFormat":1}],"fileIdsList":[[2,3]],"options":{"checkJs":true,"composite":true,"outDir":"./"},"referencedMap":[[4,1]],"latestChangedDtsFile":"./src/bug.d.ts"} //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/box.ts", + "../src/wrap.ts", + "../src/bug.js" + ], + "original": [ + 2, + 4 + ] + } + ], "fileNames": [ "lib.d.ts", "../src/box.ts", @@ -331,7 +357,7 @@ exports.something = 1; ] }, "latestChangedDtsFile": "./src/bug.d.ts", - "size": 2141 + "size": 2156 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/option-changes-with-composite.js b/testdata/baselines/reference/tsc/incremental/option-changes-with-composite.js index d84dcad4b8..31813b1f3a 100644 --- a/testdata/baselines/reference/tsc/incremental/option-changes-with-composite.js +++ b/testdata/baselines/reference/tsc/incremental/option-changes-with-composite.js @@ -83,10 +83,24 @@ const b_1 = require("./b"); exports.d = b_1.b; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","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"} +{"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", @@ -172,7 +186,7 @@ exports.d = b_1.b; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1747 + "size": 1762 } tsconfig.json:: @@ -231,10 +245,24 @@ exports.d = b_1.b; //// [/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","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"} +{"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", @@ -321,7 +349,7 @@ exports.d = b_1.b; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1764 + "size": 1779 } tsconfig.json:: @@ -363,10 +391,24 @@ const b_1 = require("./b"); exports.d = b_1.b; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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"} +{"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", @@ -452,7 +494,7 @@ exports.d = b_1.b; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1747 + "size": 1762 } tsconfig.json:: @@ -508,10 +550,24 @@ export declare const d = 10; //// [/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","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"} +{"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", @@ -599,7 +655,7 @@ export declare const d = 10; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1788 + "size": 1803 } tsconfig.json:: @@ -625,10 +681,24 @@ export declare const c = 10; export declare const d = 10; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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"} +{"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", @@ -714,7 +784,7 @@ export declare const d = 10; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1747 + "size": 1762 } tsconfig.json:: @@ -759,10 +829,24 @@ exports.a = 10; const aLocal = 100; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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"} +{"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", @@ -848,7 +932,7 @@ const aLocal = 100; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1748 + "size": 1763 } tsconfig.json:: @@ -903,10 +987,24 @@ 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","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"} +{"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", @@ -993,7 +1091,7 @@ exports.d = b_1.b; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1771 + "size": 1786 } tsconfig.json:: @@ -1040,10 +1138,24 @@ 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","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,"sourceMap":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +{"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,"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", @@ -1130,7 +1242,7 @@ exports.d = b_1.b; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1765 + "size": 1780 } tsconfig.json:: @@ -1194,10 +1306,24 @@ const b_1 = require("./b"); exports.d = b_1.b; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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,"declarationMap":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +{"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,"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", @@ -1284,7 +1410,7 @@ exports.d = b_1.b; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1770 + "size": 1785 } tsconfig.json:: @@ -1330,10 +1456,24 @@ 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","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,"declarationMap":true,"sourceMap":true},"referencedMap":[[4,1],[5,2]],"latestChangedDtsFile":"./d.d.ts"} +{"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,"declarationMap":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", @@ -1421,7 +1561,7 @@ exports.d = b_1.b; ] }, "latestChangedDtsFile": "./d.d.ts", - "size": 1787 + "size": 1802 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/option-changes-with-incremental.js b/testdata/baselines/reference/tsc/incremental/option-changes-with-incremental.js index e0329f64f4..428799f3d1 100644 --- a/testdata/baselines/reference/tsc/incremental/option-changes-with-incremental.js +++ b/testdata/baselines/reference/tsc/incremental/option-changes-with-incremental.js @@ -71,10 +71,24 @@ const b_1 = require("./b"); exports.d = b_1.b; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","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]]} +{"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", @@ -136,7 +150,7 @@ exports.d = b_1.b; "./b.ts" ] }, - "size": 1236 + "size": 1251 } tsconfig.json:: @@ -191,10 +205,24 @@ exports.d = b_1.b; //// [/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","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]]} +{"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", @@ -259,7 +287,7 @@ exports.d = b_1.b; "./b.ts" ] }, - "size": 1265 + "size": 1280 } tsconfig.json:: @@ -301,10 +329,24 @@ const b_1 = require("./b"); exports.d = b_1.b; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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]]} +{"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", @@ -366,7 +408,7 @@ exports.d = b_1.b; "./b.ts" ] }, - "size": 1236 + "size": 1251 } tsconfig.json:: @@ -392,10 +434,24 @@ export declare const c = 10; export declare const d = 10; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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]]} +{"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", @@ -480,7 +536,7 @@ export declare const d = 10; "./b.ts" ] }, - "size": 1715 + "size": 1730 } tsconfig.json:: @@ -518,10 +574,24 @@ export declare const d = 10; //// [/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","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]]} +{"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", @@ -607,7 +677,7 @@ export declare const d = 10; "./b.ts" ] }, - "size": 1737 + "size": 1752 } tsconfig.json:: @@ -641,10 +711,24 @@ exports.a = 10; const aLocal = 100; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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]]} +{"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", @@ -726,7 +810,7 @@ const aLocal = 100; "./b.ts" ] }, - "size": 1685 + "size": 1700 } tsconfig.json:: @@ -750,10 +834,24 @@ Output:: //// [/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","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]]} +{"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", @@ -839,7 +937,7 @@ Output:: "./b.ts" ] }, - "size": 1738 + "size": 1753 } tsconfig.json:: @@ -892,10 +990,24 @@ 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","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]]} +{"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", @@ -980,7 +1092,7 @@ exports.d = b_1.b; "./b.ts" ] }, - "size": 1720 + "size": 1735 } tsconfig.json:: @@ -1027,10 +1139,24 @@ 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","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]]} +{"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", @@ -1115,7 +1241,7 @@ exports.d = b_1.b; "./b.ts" ] }, - "size": 1714 + "size": 1729 } tsconfig.json:: @@ -1157,10 +1283,24 @@ const b_1 = require("./b"); exports.d = b_1.b; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","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]]} +{"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", @@ -1242,7 +1382,7 @@ exports.d = b_1.b; "./b.ts" ] }, - "size": 1685 + "size": 1700 } tsconfig.json:: @@ -1264,10 +1404,24 @@ Output:: //// [/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","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]]} +{"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", @@ -1353,7 +1507,7 @@ Output:: "./b.ts" ] }, - "size": 1738 + "size": 1753 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js index d50ad32e52..ee5f85490e 100644 --- a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js +++ b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js @@ -70,10 +70,18 @@ const App = () => jsx_runtime_1.jsx("div", { propA: true }); exports.App = App; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.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},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":25,"end":49,"code":7016,"category":1,"message":"Could not find a declaration file for module 'react/jsx-runtime'. '/home/src/workspaces/project/node_modules/react/jsx-runtime.js' implicitly has an 'any' type."}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.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},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":25,"end":49,"code":7016,"category":1,"message":"Could not find a declaration file for module 'react/jsx-runtime'. '/home/src/workspaces/project/node_modules/react/jsx-runtime.js' implicitly has an 'any' type."}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.tsx" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "./src/index.tsx", @@ -131,7 +139,7 @@ exports.App = App; ] ] ], - "size": 1612 + "size": 1623 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js index 04165b519c..6346e64350 100644 --- a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js +++ b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js @@ -62,10 +62,18 @@ const App = () => jsx_runtime_1.jsx("div", { propA: true }); exports.App = App; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.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},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.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},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1}} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.tsx" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "./src/index.tsx", @@ -108,7 +116,7 @@ exports.App = App; "jsxImportSource": "react", "module": 1 }, - "size": 1343 + "size": 1354 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/serializing-composite-project.js b/testdata/baselines/reference/tsc/incremental/serializing-composite-project.js index ac61ce49b9..41015ff3fc 100644 --- a/testdata/baselines/reference/tsc/incremental/serializing-composite-project.js +++ b/testdata/baselines/reference/tsc/incremental/serializing-composite-project.js @@ -53,10 +53,22 @@ export declare const b = 2; export const b = 2; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./index.tsx","./other.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":"f5c8fff6e1fca35f4a292d48868d4086-export const a = 1;","signature":"67cd7ccc14045107336f34154f76a8ca-export declare const a = 1;\n","impliedNodeFormat":1},{"version":"a8da94c0a8fada72e123de05c6818d3a-export const b = 2;","signature":"e1d275f86bf4a4a1f6fd0e8d8709f902-export declare const b = 2;\n","impliedNodeFormat":1}],"options":{"composite":true,"module":99,"strict":true},"latestChangedDtsFile":"./other.d.ts"} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./index.tsx","./other.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":"f5c8fff6e1fca35f4a292d48868d4086-export const a = 1;","signature":"67cd7ccc14045107336f34154f76a8ca-export declare const a = 1;\n","impliedNodeFormat":1},{"version":"a8da94c0a8fada72e123de05c6818d3a-export const b = 2;","signature":"e1d275f86bf4a4a1f6fd0e8d8709f902-export declare const b = 2;\n","impliedNodeFormat":1}],"options":{"composite":true,"module":99,"strict":true},"latestChangedDtsFile":"./other.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.tsx", + "./other.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./index.tsx", @@ -104,7 +116,7 @@ export const b = 2; "strict": true }, "latestChangedDtsFile": "./other.d.ts", - "size": 1288 + "size": 1303 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js b/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js index 907e86ee11..922c5c2cc3 100644 --- a/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js +++ b/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js @@ -71,10 +71,18 @@ declare const console: { log(msg: any): void; }; (React.createElement(Component, null, React.createElement("div", null), React.createElement("div", null))); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./index.tsx"],"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":"8ca521424834f2ae3377cc3ccc9dd3ef-declare namespace JSX {\n interface ElementChildrenAttribute { children: {}; }\n interface IntrinsicElements { div: {} }\n}\n\ndeclare var React: any;\n\ndeclare function Component(props: never): any;\ndeclare function Component(props: { children?: number }): any;\n(\n
\n
\n)","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":3,"module":99,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":265,"end":274,"code":2769,"category":1,"message":"No overload matches this call.","messageChain":[{"pos":265,"end":274,"code":2770,"category":1,"message":"The last overload gave the following error.","messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"message":"Type '{ children: any[]; }' is not assignable to type '{ children?: number | undefined; }'.","messageChain":[{"pos":265,"end":274,"code":2326,"category":1,"message":"Types of property 'children' are incompatible.","messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"message":"Type 'any[]' is not assignable to type 'number'."}]}]}]}],"relatedInformation":[{"pos":217,"end":226,"code":2771,"category":1,"message":"The last overload is declared here."}]}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./index.tsx"],"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":"8ca521424834f2ae3377cc3ccc9dd3ef-declare namespace JSX {\n interface ElementChildrenAttribute { children: {}; }\n interface IntrinsicElements { div: {} }\n}\n\ndeclare var React: any;\n\ndeclare function Component(props: never): any;\ndeclare function Component(props: { children?: number }): any;\n(\n
\n
\n)","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":3,"module":99,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":265,"end":274,"code":2769,"category":1,"message":"No overload matches this call.","messageChain":[{"pos":265,"end":274,"code":2770,"category":1,"message":"The last overload gave the following error.","messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"message":"Type '{ children: any[]; }' is not assignable to type '{ children?: number | undefined; }'.","messageChain":[{"pos":265,"end":274,"code":2326,"category":1,"message":"Types of property 'children' are incompatible.","messageChain":[{"pos":265,"end":274,"code":2322,"category":1,"message":"Type 'any[]' is not assignable to type 'number'."}]}]}]}],"relatedInformation":[{"pos":217,"end":226,"code":2771,"category":1,"message":"The last overload is declared here."}]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.tsx" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "./index.tsx" @@ -169,7 +177,7 @@ declare const console: { log(msg: any): void; }; ] ] ], - "size": 2098 + "size": 2109 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/tsbuildinfo-has-error.js b/testdata/baselines/reference/tsc/incremental/tsbuildinfo-has-error.js index 08d10bcd2c..84b80ae36d 100644 --- a/testdata/baselines/reference/tsc/incremental/tsbuildinfo-has-error.js +++ b/testdata/baselines/reference/tsc/incremental/tsbuildinfo-has-error.js @@ -41,10 +41,18 @@ exports.x = void 0; exports.x = 10; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "./main.ts" @@ -69,7 +77,7 @@ exports.x = 10; "impliedNodeFormat": "CommonJS" } ], - "size": 904 + "size": 915 } tsconfig.json:: @@ -81,14 +89,14 @@ Signatures:: Edit [0]:: tsbuildinfo written has error //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -Some random string{"version":"FakeTSVersion","fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} +Some random string{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} tsgo -i ExitStatus:: Success Output:: //// [/home/src/workspaces/project/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/when-file-is-deleted.js b/testdata/baselines/reference/tsc/incremental/when-file-is-deleted.js index 2a9453f868..6325023725 100644 --- a/testdata/baselines/reference/tsc/incremental/when-file-is-deleted.js +++ b/testdata/baselines/reference/tsc/incremental/when-file-is-deleted.js @@ -64,10 +64,22 @@ class D { exports.D = D; //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","../file1.ts","../file2.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":"7f6c75bbefe8ea83642a1cbd9b5f4880-export class C { }","signature":"ee4318f4b13094e43c50242580268f60-export declare class C {\n}\n","impliedNodeFormat":1},{"version":"f7d221ab360f516a6280e3b725f4cd31-export class D { }","signature":"d80eb8b520c91b72da4146d2d8059990-export declare class D {\n}\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./file2.d.ts"} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../file1.ts","../file2.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":"7f6c75bbefe8ea83642a1cbd9b5f4880-export class C { }","signature":"ee4318f4b13094e43c50242580268f60-export declare class C {\n}\n","impliedNodeFormat":1},{"version":"f7d221ab360f516a6280e3b725f4cd31-export class D { }","signature":"d80eb8b520c91b72da4146d2d8059990-export declare class D {\n}\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./file2.d.ts"} //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../file1.ts", + "../file2.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "../file1.ts", @@ -114,7 +126,7 @@ exports.D = D; "outDir": "./" }, "latestChangedDtsFile": "./file2.d.ts", - "size": 1276 + "size": 1291 } tsconfig.json:: @@ -134,10 +146,18 @@ tsgo ExitStatus:: Success Output:: //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","../file1.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":"7f6c75bbefe8ea83642a1cbd9b5f4880-export class C { }","signature":"ee4318f4b13094e43c50242580268f60-export declare class C {\n}\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./file2.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../file1.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":"7f6c75bbefe8ea83642a1cbd9b5f4880-export class C { }","signature":"ee4318f4b13094e43c50242580268f60-export declare class C {\n}\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./file2.d.ts"} //// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../file1.ts" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "../file1.ts" @@ -172,7 +192,7 @@ Output:: "outDir": "./" }, "latestChangedDtsFile": "./file2.d.ts", - "size": 1097 + "size": 1108 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js b/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js index c23d894001..ffe2a4f5a4 100644 --- a/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js +++ b/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js @@ -66,10 +66,23 @@ declare function main(): void; function main() { } //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e3124823e3ef0a7f1ce70b317b1e4c8-/// \n/// \nfunction main() { }","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e3124823e3ef0a7f1ce70b317b1e4c8-/// \n/// \nfunction main() { }","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/main.ts" + ], + "original": [ + 2, + 4 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/filePresent.ts", @@ -150,7 +163,7 @@ function main() { } ] }, "latestChangedDtsFile": "./src/main.d.ts", - "size": 1895 + "size": 1910 } tsconfig.json:: @@ -192,10 +205,23 @@ function main() { } something(); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9ece2abeadfdd790ae17f754892e8402-/// \n/// \nfunction main() { }something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9ece2abeadfdd790ae17f754892e8402-/// \n/// \nfunction main() { }something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/main.ts" + ], + "original": [ + 2, + 4 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/filePresent.ts", @@ -276,7 +302,7 @@ something(); ] }, "latestChangedDtsFile": "./src/main.d.ts", - "size": 1907 + "size": 1922 } tsconfig.json:: @@ -303,10 +329,23 @@ something(); something(); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1077a6c3f5daec777c602b0aac3793b9-/// \n/// \nfunction main() { }something();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1077a6c3f5daec777c602b0aac3793b9-/// \n/// \nfunction main() { }something();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/main.ts" + ], + "original": [ + 2, + 4 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/filePresent.ts", @@ -387,7 +426,7 @@ something(); ] }, "latestChangedDtsFile": "./src/main.d.ts", - "size": 1919 + "size": 1934 } tsconfig.json:: @@ -425,10 +464,24 @@ declare function foo(): number; function foo() { return 20; } //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,6],[2,4,6]],"options":{"composite":true},"referencedMap":[[3,1],[5,2]],"latestChangedDtsFile":"./src/newFile.d.ts"} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.ts","./src/fileNotFound.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,6],[2,4,6]],"options":{"composite":true},"referencedMap":[[3,1],[5,2]],"latestChangedDtsFile":"./src/newFile.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/newFile.ts", + "./src/main.ts" + ], + "original": [ + 2, + 5 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/filePresent.ts", @@ -529,7 +582,7 @@ function foo() { return 20; } ] }, "latestChangedDtsFile": "./src/newFile.d.ts", - "size": 2201 + "size": 2216 } tsconfig.json:: @@ -558,10 +611,25 @@ function something2() { return 20; } //// [/home/src/workspaces/project/src/main.js] *rewrite with same content* //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/filePresent.ts","./src/fileNotFound.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d97745dab1d2c6dc05ce702bd0c7145d-function something2() { return 20; }","signature":"6bc942031a42ec462dd78d556924caf0-declare function something2(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,3],[2,3,5]],"options":{"composite":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./src/fileNotFound.d.ts"} +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/fileNotFound.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d97745dab1d2c6dc05ce702bd0c7145d-function something2() { return 20; }","signature":"6bc942031a42ec462dd78d556924caf0-declare function something2(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,3],[2,3,5]],"options":{"composite":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./src/fileNotFound.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/filePresent.ts", + "./src/fileNotFound.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/newFile.ts", + "./src/main.ts" + ], + "original": [ + 2, + 6 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/filePresent.ts", @@ -675,7 +743,7 @@ function something2() { return 20; } ] }, "latestChangedDtsFile": "./src/fileNotFound.d.ts", - "size": 2426 + "size": 2441 } tsconfig.json:: @@ -711,10 +779,25 @@ foo(); something(); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/filePresent.ts","./src/fileNotFound.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d97745dab1d2c6dc05ce702bd0c7145d-function something2() { return 20; }","signature":"6bc942031a42ec462dd78d556924caf0-declare function something2(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"789a4176bd8e2c5d9b0deb6839d8f298-/// \n/// \n/// \nfunction main() { }something();something();foo();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,3],[2,3,5]],"options":{"composite":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./src/fileNotFound.d.ts"} +{"version":"FakeTSVersion","root":[[2,6]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/fileNotFound.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.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":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d97745dab1d2c6dc05ce702bd0c7145d-function something2() { return 20; }","signature":"6bc942031a42ec462dd78d556924caf0-declare function something2(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"789a4176bd8e2c5d9b0deb6839d8f298-/// \n/// \n/// \nfunction main() { }something();something();foo();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,3],[2,3,5]],"options":{"composite":true},"referencedMap":[[4,1],[6,2]],"latestChangedDtsFile":"./src/fileNotFound.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/filePresent.ts", + "./src/fileNotFound.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/newFile.ts", + "./src/main.ts" + ], + "original": [ + 2, + 6 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/filePresent.ts", @@ -828,7 +911,7 @@ something(); ] }, "latestChangedDtsFile": "./src/fileNotFound.d.ts", - "size": 2438 + "size": 2453 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/when-passing-filename-for-buildinfo-on-commandline.js b/testdata/baselines/reference/tsc/incremental/when-passing-filename-for-buildinfo-on-commandline.js index ffcb32f40a..d4a4273007 100644 --- a/testdata/baselines/reference/tsc/incremental/when-passing-filename-for-buildinfo-on-commandline.js +++ b/testdata/baselines/reference/tsc/incremental/when-passing-filename-for-buildinfo-on-commandline.js @@ -45,10 +45,18 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/home/src/workspaces/project/.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"],"options":{"module":1,"target":1,"tsBuildInfoFile":"./.tsbuildinfo"}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"],"options":{"module":1,"target":1,"tsBuildInfoFile":"./.tsbuildinfo"}} //// [/home/src/workspaces/project/.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/main.ts" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "./src/main.ts" @@ -78,7 +86,7 @@ declare const console: { log(msg: any): void; }; "target": 1, "tsBuildInfoFile": "./.tsbuildinfo" }, - "size": 977 + "size": 988 } //// [/home/src/workspaces/project/src/main.js] *new* "use strict"; diff --git a/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-from-commandline.js b/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-from-commandline.js index 06eef5bdc8..acf230fde3 100644 --- a/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-from-commandline.js +++ b/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-from-commandline.js @@ -44,10 +44,18 @@ exports.x = void 0; exports.x = 10; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"],"options":{"outDir":"./dist","rootDir":"./src"}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"],"options":{"outDir":"./dist","rootDir":"./src"}} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/main.ts" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "./src/main.ts" @@ -76,7 +84,7 @@ exports.x = 10; "outDir": "./dist", "rootDir": "./src" }, - "size": 956 + "size": 967 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-is-in-the-tsconfig.js b/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-is-in-the-tsconfig.js index 4737fef775..adbad2fb31 100644 --- a/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-is-in-the-tsconfig.js +++ b/testdata/baselines/reference/tsc/incremental/when-passing-rootDir-is-in-the-tsconfig.js @@ -45,10 +45,18 @@ exports.x = void 0; exports.x = 10; //// [/home/src/workspaces/project/dist/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","../src/main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"],"options":{"outDir":"./","rootDir":".."}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/main.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},"28e8748a7acd58f4f59388926e914f86-export const x = 10;"],"options":{"outDir":"./","rootDir":".."}} //// [/home/src/workspaces/project/dist/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/main.ts" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "../src/main.ts" @@ -77,7 +85,7 @@ exports.x = 10; "outDir": "./", "rootDir": ".." }, - "size": 950 + "size": 961 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/incremental/with-only-dts-files.js b/testdata/baselines/reference/tsc/incremental/with-only-dts-files.js index 9c9887d283..93472e2a40 100644 --- a/testdata/baselines/reference/tsc/incremental/with-only-dts-files.js +++ b/testdata/baselines/reference/tsc/incremental/with-only-dts-files.js @@ -35,10 +35,22 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/another.d.ts","./src/main.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},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./src/another.d.ts","./src/main.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},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","28e8748a7acd58f4f59388926e914f86-export const x = 10;"]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/another.d.ts", + "./src/main.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/another.d.ts", @@ -70,7 +82,7 @@ declare const console: { log(msg: any): void; }; "impliedNodeFormat": "CommonJS" } ], - "size": 987 + "size": 1002 } tsconfig.json:: @@ -100,10 +112,22 @@ tsgo --incremental ExitStatus:: Success Output:: //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./src/another.d.ts","./src/main.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},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","111e3074fef4387af38d77ffef382bad-export const x = 10;export const xy = 100;"]} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./src/another.d.ts","./src/main.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},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","111e3074fef4387af38d77ffef382bad-export const x = 10;export const xy = 100;"]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/another.d.ts", + "./src/main.d.ts" + ], + "original": [ + 2, + 3 + ] + } + ], "fileNames": [ "lib.d.ts", "./src/another.d.ts", @@ -135,7 +159,7 @@ Output:: "impliedNodeFormat": "CommonJS" } ], - "size": 1009 + "size": 1024 } tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/libraryResolution/unknown-lib.js b/testdata/baselines/reference/tsc/libraryResolution/unknown-lib.js new file mode 100644 index 0000000000..ea576a0dd1 --- /dev/null +++ b/testdata/baselines/reference/tsc/libraryResolution/unknown-lib.js @@ -0,0 +1,273 @@ +currentDirectory::/home/src/workspace/projects +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.scripthost.d.ts] *new* +interface ScriptHostInterface { } +//// [/home/src/tslibs/TS/Lib/lib.webworker.d.ts] *new* +interface WebWorkerInterface { } +//// [/home/src/workspace/projects/project1/core.d.ts] *new* +export const core = 10; +//// [/home/src/workspace/projects/project1/file.ts] *new* +export const file = 10; +//// [/home/src/workspace/projects/project1/file2.ts] *new* +/// +/// +/// +//// [/home/src/workspace/projects/project1/index.ts] *new* +export const x = "type1"; +//// [/home/src/workspace/projects/project1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project1/utils.d.ts] *new* +export const y = 10; + +tsgo -p project1 --explainFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module '@typescript/lib-scripthost' from '/home/src/workspace/projects/project1/__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 '/home/src/workspace/projects/project1/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-scripthost' +Directory '/home/src/workspace/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-scripthost' +Directory '/home/src/workspace/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-scripthost' +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-scripthost' +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/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. +Directory '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/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-scripthost' was not resolved. ======== +project1/file2.ts:1:21 - error TS2727: Cannot find lib definition for 'webworker2'. Did you mean 'webworker'? + +1 /// +   ~~~~~~~~~~ + +project1/file2.ts:2:21 - error TS2726: Cannot find lib definition for 'unknownlib'. + +2 /// +   ~~~~~~~~~~ + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +../../tslibs/TS/Lib/lib.scripthost.d.ts + Library referenced via 'scripthost' from file 'project1/file2.ts' +project1/core.d.ts + Matched by default include pattern '**/*' +project1/file.ts + Matched by default include pattern '**/*' +project1/file2.ts + Matched by default include pattern '**/*' +project1/index.ts + Matched by default include pattern '**/*' +project1/utils.d.ts + Matched by default include pattern '**/*' + +Found 2 errors in the same file, starting at: project1/file2.ts:1 + +//// [/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/workspace/projects/project1/file.d.ts] *new* +export declare const file = 10; + +//// [/home/src/workspace/projects/project1/file.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.file = void 0; +exports.file = 10; + +//// [/home/src/workspace/projects/project1/file2.d.ts] *new* + +//// [/home/src/workspace/projects/project1/file2.js] *new* +/// +/// +/// + +//// [/home/src/workspace/projects/project1/index.d.ts] *new* +export declare const x = "type1"; + +//// [/home/src/workspace/projects/project1/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "type1"; + +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[3,7]],"fileNames":["lib.d.ts","lib.scripthost.d.ts","./core.d.ts","./file.ts","./file2.ts","./index.ts","./utils.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":"2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},"a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;",{"version":"69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;","signature":"a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n","impliedNodeFormat":1},{"version":"aceac74b29bc0f88aeca1c3e8d6b44c0-/// \n/// \n/// ","signature":"99aa06d3014798d86001c324468d497f-","impliedNodeFormat":1},{"version":"aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";","signature":"e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;"],"options":{"composite":true},"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7],"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts" + ], + "original": [ + 3, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "lib.scripthost.d.ts", + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.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": "lib.scripthost.d.ts", + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "signature": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./core.d.ts", + "version": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "signature": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./file.ts", + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "aceac74b29bc0f88aeca1c3e8d6b44c0-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aceac74b29bc0f88aeca1c3e8d6b44c0-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "lib.scripthost.d.ts", + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts" + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1893 +} + +project1/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/tslibs/TS/Lib/lib.scripthost.d.ts +*not cached* /home/src/workspace/projects/project1/core.d.ts +*not cached* /home/src/workspace/projects/project1/file.ts +*not cached* /home/src/workspace/projects/project1/file2.ts +*not cached* /home/src/workspace/projects/project1/index.ts +*not cached* /home/src/workspace/projects/project1/utils.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project1/file.ts +(stored at emit) /home/src/workspace/projects/project1/file2.ts +(stored at emit) /home/src/workspace/projects/project1/index.ts diff --git a/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js b/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js new file mode 100644 index 0000000000..3086afcd3a --- /dev/null +++ b/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js @@ -0,0 +1,205 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.d.ts] *new* +declare const a = "hello"; +//// [/home/src/workspaces/project/b.ts] *new* +const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": true, + "lib": ["es6"], + }, +} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/tslibs/TS/Lib/lib.es2015.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/b.d.ts] *new* +declare const b = 10; + +//// [/home/src/workspaces/project/b.js] *new* +const b = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.es2015.d.ts","./a.d.ts","./b.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":"65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b6737c5344041bf3b8940a4bf34d44f-const b = 10;","signature":"459f957b863aabe09fb52325f783682c-declare const b = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.d.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.es2015.d.ts", + "./a.d.ts", + "./b.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2015.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.d.ts", + "version": "65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";", + "signature": "65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "0b6737c5344041bf3b8940a4bf34d44f-const b = 10;", + "signature": "459f957b863aabe09fb52325f783682c-declare const b = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0b6737c5344041bf3b8940a4bf34d44f-const b = 10;", + "signature": "459f957b863aabe09fb52325f783682c-declare const b = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1213 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2015.d.ts +*refresh* /home/src/workspaces/project/a.d.ts +*refresh* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: with --noLib + +tsgo --noLib +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +tsconfig.json:5:9 - error TS5053: Option 'lib' cannot be specified with option 'noLib'. + +5 "lib": ["es6"], +   ~~~~~ + + +Found 1 error in tsconfig.json:5 + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[1,2]],"fileNames":["./a.d.ts","./b.ts"],"fileInfos":[{"version":"65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b6737c5344041bf3b8940a4bf34d44f-const b = 10;","signature":"459f957b863aabe09fb52325f783682c-declare const b = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.d.ts", + "./b.ts" + ], + "original": [ + 1, + 2 + ] + } + ], + "fileNames": [ + "./a.d.ts", + "./b.ts" + ], + "fileInfos": [ + { + "fileName": "./a.d.ts", + "version": "65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";", + "signature": "65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "65e51aad504cdd4dce12c03a2dcc9410-declare const a = \"hello\";", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "0b6737c5344041bf3b8940a4bf34d44f-const b = 10;", + "signature": "459f957b863aabe09fb52325f783682c-declare const b = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "0b6737c5344041bf3b8940a4bf34d44f-const b = 10;", + "signature": "459f957b863aabe09fb52325f783682c-declare const b = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.d.ts", + "./b.ts" + ], + "size": 474 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.d.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(used version) /home/src/workspaces/project/a.d.ts +(computed .d.ts) /home/src/workspaces/project/b.ts diff --git a/testdata/baselines/reference/tsc/libraryResolution/with-config-with-libReplacement.js b/testdata/baselines/reference/tsc/libraryResolution/with-config-with-libReplacement.js new file mode 100644 index 0000000000..ebc990d5f8 --- /dev/null +++ b/testdata/baselines/reference/tsc/libraryResolution/with-config-with-libReplacement.js @@ -0,0 +1,433 @@ +currentDirectory::/home/src/workspace/projects +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.dom.d.ts] *new* +interface DOMInterface { } +//// [/home/src/tslibs/TS/Lib/lib.scripthost.d.ts] *new* +interface ScriptHostInterface { } +//// [/home/src/tslibs/TS/Lib/lib.webworker.d.ts] *new* +interface WebWorkerInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts] *new* +interface DOMInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts] *new* +/// +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/workspace/projects/node_modules/@typescript/lib-esnext/index.d.ts] *new* +/// +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/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts] *new* +interface ScriptHostInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts] *new* +interface WebWorkerInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/unlreated/index.d.ts] *new* +export const unrelated = 10; +//// [/home/src/workspace/projects/project1/core.d.ts] *new* +export const core = 10; +//// [/home/src/workspace/projects/project1/file.ts] *new* +export const file = 10; +//// [/home/src/workspace/projects/project1/file2.ts] *new* +/// +/// +/// +//// [/home/src/workspace/projects/project1/index.ts] *new* +export const x = "type1"; +//// [/home/src/workspace/projects/project1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "typeRoots": ["./typeroot1"], + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts] *new* +export type TheNum = "type1"; +//// [/home/src/workspace/projects/project1/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project2/index.ts] *new* +export const y = 10 +//// [/home/src/workspace/projects/project2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project2/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project3/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project3/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project3/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project4/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project4/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["esnext", "dom", "webworker"], + "traceResolution": true, + "libReplacement": true + } +} +//// [/home/src/workspace/projects/project4/utils.d.ts] *new* +export const y = 10; + +tsgo -p project1 --explainFiles +ExitStatus:: Success +Output:: +======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== +Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. +File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. +======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== +======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project1/__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 '/home/src/workspace/projects/project1/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +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 '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-dom' +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. +======== Module name '@typescript/lib-dom' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== +======== Resolving module '@typescript/lib-es5' from '/home/src/workspace/projects/project1/__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 '/home/src/workspace/projects/project1/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/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 '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-es5' +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. +======== Module name '@typescript/lib-es5' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts'. ======== +======== Resolving module '@typescript/lib-scripthost' from '/home/src/workspace/projects/project1/__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 '/home/src/workspace/projects/project1/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/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 '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-scripthost' +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts'. +======== Module name '@typescript/lib-scripthost' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts'. ======== +======== Resolving module '@typescript/lib-webworker' from '/home/src/workspace/projects/project1/__lib_node_modules_lookup_lib.webworker.d.ts__.ts'. ======== +Module resolution kind is not specified, using 'Bundler'. +Resolving in CJS mode with conditions 'require', 'types'. +File '/home/src/workspace/projects/project1/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/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' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/workspace/projects/project1/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/workspace/projects/project1/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'typescript__lib-webworker' +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker.d.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.ts' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.tsx' does not exist. +File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. +======== Module name '@typescript/lib-webworker' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. ======== +node_modules/@typescript/lib-webworker/index.d.ts + Library referenced via 'webworker' from file 'project1/file2.ts' +node_modules/@typescript/lib-scripthost/index.d.ts + Library referenced via 'scripthost' from file 'project1/file2.ts' +node_modules/@typescript/lib-es5/index.d.ts + Library referenced via 'es5' from file 'project1/file2.ts' + Library 'lib.es5.d.ts' specified in compilerOptions +node_modules/@typescript/lib-dom/index.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +project1/core.d.ts + Matched by default include pattern '**/*' +project1/file.ts + Matched by default include pattern '**/*' +project1/file2.ts + Matched by default include pattern '**/*' +project1/index.ts + Matched by default include pattern '**/*' +project1/utils.d.ts + Matched by default include pattern '**/*' +project1/typeroot1/sometype/index.d.ts + Matched by default include pattern '**/*' + Entry point for implicit type library 'sometype' +//// [/home/src/workspace/projects/project1/file.d.ts] *new* +export declare const file = 10; + +//// [/home/src/workspace/projects/project1/file.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.file = void 0; +exports.file = 10; + +//// [/home/src/workspace/projects/project1/file2.d.ts] *new* + +//// [/home/src/workspace/projects/project1/file2.js] *new* +/// +/// +/// + +//// [/home/src/workspace/projects/project1/index.d.ts] *new* +export declare const x = "type1"; + +//// [/home/src/workspace/projects/project1/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "type1"; + +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[5,10]],"fileNames":["../node_modules/@typescript/lib-webworker/index.d.ts","../node_modules/@typescript/lib-scripthost/index.d.ts","../node_modules/@typescript/lib-es5/index.d.ts","../node_modules/@typescript/lib-dom/index.d.ts","./core.d.ts","./file.ts","./file2.ts","./index.ts","./utils.d.ts","./typeroot1/sometype/index.d.ts"],"fileInfos":[{"version":"95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},"a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;",{"version":"69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;","signature":"a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n","impliedNodeFormat":1},{"version":"76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ","signature":"99aa06d3014798d86001c324468d497f-","impliedNodeFormat":1},{"version":"aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";","signature":"e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "original": [ + 5, + 10 + ] + } + ], + "fileNames": [ + "../node_modules/@typescript/lib-webworker/index.d.ts", + "../node_modules/@typescript/lib-scripthost/index.d.ts", + "../node_modules/@typescript/lib-es5/index.d.ts", + "../node_modules/@typescript/lib-dom/index.d.ts", + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "fileInfos": [ + { + "fileName": "../node_modules/@typescript/lib-webworker/index.d.ts", + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "signature": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@typescript/lib-scripthost/index.d.ts", + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "signature": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@typescript/lib-es5/index.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": "../node_modules/@typescript/lib-dom/index.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./core.d.ts", + "version": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "signature": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./file.ts", + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./typeroot1/sometype/index.d.ts", + "version": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "signature": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2354 +} + +project1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-scripthost/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-es5/index.d.ts +*refresh* /home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts +*refresh* /home/src/workspace/projects/project1/core.d.ts +*refresh* /home/src/workspace/projects/project1/file.ts +*refresh* /home/src/workspace/projects/project1/file2.ts +*refresh* /home/src/workspace/projects/project1/index.ts +*refresh* /home/src/workspace/projects/project1/utils.d.ts +*refresh* /home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project1/file.ts +(stored at emit) /home/src/workspace/projects/project1/file2.ts +(stored at emit) /home/src/workspace/projects/project1/index.ts diff --git a/testdata/baselines/reference/tsc/libraryResolution/with-config.js b/testdata/baselines/reference/tsc/libraryResolution/with-config.js new file mode 100644 index 0000000000..a6fc4bc0bf --- /dev/null +++ b/testdata/baselines/reference/tsc/libraryResolution/with-config.js @@ -0,0 +1,312 @@ +currentDirectory::/home/src/workspace/projects +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/tslibs/TS/Lib/lib.dom.d.ts] *new* +interface DOMInterface { } +//// [/home/src/tslibs/TS/Lib/lib.scripthost.d.ts] *new* +interface ScriptHostInterface { } +//// [/home/src/tslibs/TS/Lib/lib.webworker.d.ts] *new* +interface WebWorkerInterface { } +//// [/home/src/workspace/projects/node_modules/@typescript/unlreated/index.d.ts] *new* +export const unrelated = 10; +//// [/home/src/workspace/projects/project1/core.d.ts] *new* +export const core = 10; +//// [/home/src/workspace/projects/project1/file.ts] *new* +export const file = 10; +//// [/home/src/workspace/projects/project1/file2.ts] *new* +/// +/// +/// +//// [/home/src/workspace/projects/project1/index.ts] *new* +export const x = "type1"; +//// [/home/src/workspace/projects/project1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "typeRoots": ["./typeroot1"], + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts] *new* +export type TheNum = "type1"; +//// [/home/src/workspace/projects/project1/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project2/index.ts] *new* +export const y = 10 +//// [/home/src/workspace/projects/project2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project2/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project3/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project3/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["es5", "dom"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project3/utils.d.ts] *new* +export const y = 10; +//// [/home/src/workspace/projects/project4/index.ts] *new* +export const z = 10 +//// [/home/src/workspace/projects/project4/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "lib": ["esnext", "dom", "webworker"], + "traceResolution": true, + "libReplacement": false + } +} +//// [/home/src/workspace/projects/project4/utils.d.ts] *new* +export const y = 10; + +tsgo -p project1 --explainFiles +ExitStatus:: Success +Output:: +======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== +Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. +File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. +File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. +Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. +======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== +../../tslibs/TS/Lib/lib.es5.d.ts + Library referenced via 'es5' from file 'project1/file2.ts' + Library 'lib.es5.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.dom.d.ts + Library 'lib.dom.d.ts' specified in compilerOptions +../../tslibs/TS/Lib/lib.webworker.d.ts + Library referenced via 'webworker' from file 'project1/file2.ts' +../../tslibs/TS/Lib/lib.scripthost.d.ts + Library referenced via 'scripthost' from file 'project1/file2.ts' +project1/core.d.ts + Matched by default include pattern '**/*' +project1/file.ts + Matched by default include pattern '**/*' +project1/file2.ts + Matched by default include pattern '**/*' +project1/index.ts + Matched by default include pattern '**/*' +project1/utils.d.ts + Matched by default include pattern '**/*' +project1/typeroot1/sometype/index.d.ts + Matched by default include pattern '**/*' + Entry point for implicit type library 'sometype' +//// [/home/src/tslibs/TS/Lib/lib.es5.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/workspace/projects/project1/file.d.ts] *new* +export declare const file = 10; + +//// [/home/src/workspace/projects/project1/file.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.file = void 0; +exports.file = 10; + +//// [/home/src/workspace/projects/project1/file2.d.ts] *new* + +//// [/home/src/workspace/projects/project1/file2.js] *new* +/// +/// +/// + +//// [/home/src/workspace/projects/project1/index.d.ts] *new* +export declare const x = "type1"; + +//// [/home/src/workspace/projects/project1/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = "type1"; + +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[5,10]],"fileNames":["lib.es5.d.ts","lib.dom.d.ts","lib.webworker.d.ts","lib.scripthost.d.ts","./core.d.ts","./file.ts","./file2.ts","./index.ts","./utils.d.ts","./typeroot1/sometype/index.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":"d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }","affectsGlobalScope":true,"impliedNodeFormat":1},"a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;",{"version":"69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;","signature":"a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n","impliedNodeFormat":1},{"version":"76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ","signature":"99aa06d3014798d86001c324468d497f-","impliedNodeFormat":1},{"version":"aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";","signature":"e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n","impliedNodeFormat":1},"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";"],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +//// [/home/src/workspace/projects/project1/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "original": [ + 5, + 10 + ] + } + ], + "fileNames": [ + "lib.es5.d.ts", + "lib.dom.d.ts", + "lib.webworker.d.ts", + "lib.scripthost.d.ts", + "./core.d.ts", + "./file.ts", + "./file2.ts", + "./index.ts", + "./utils.d.ts", + "./typeroot1/sometype/index.d.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es5.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": "lib.dom.d.ts", + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "signature": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d9b7428535134fcb21dad91303dc6311-interface DOMInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "lib.webworker.d.ts", + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "signature": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "95c5e18b7871b756fb3bb843e03aa05d-interface WebWorkerInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "lib.scripthost.d.ts", + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "signature": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2fa71959819338965a3c6b2122d95c96-interface ScriptHostInterface { }", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./core.d.ts", + "version": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "signature": "a1f9b824326bab2c3c8f13eccf69f182-export const core = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./file.ts", + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "69c4ea0c9ff13ab7fc078607d9363624-export const file = 10;", + "signature": "a224c1b0cbd2f5fe611e588db48243cb-export declare const file = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./file2.ts", + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "76f8c505d1aaf1122ce1da0807c21477-/// \n/// \n/// ", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./index.ts", + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "aeb695aed936d7539a32fc3cd25af558-export const x = \"type1\";", + "signature": "e2f8d12de2edba256e37cf4a656ac52d-export declare const x = \"type1\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./utils.d.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./typeroot1/sometype/index.d.ts", + "version": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "signature": "6bf5e0a71dae6fccf68b93fbbb73f178-export type TheNum = \"type1\";", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 2218 +} + +project1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es5.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.dom.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.webworker.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.scripthost.d.ts +*refresh* /home/src/workspace/projects/project1/core.d.ts +*refresh* /home/src/workspace/projects/project1/file.ts +*refresh* /home/src/workspace/projects/project1/file2.ts +*refresh* /home/src/workspace/projects/project1/index.ts +*refresh* /home/src/workspace/projects/project1/utils.d.ts +*refresh* /home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts +Signatures:: +(stored at emit) /home/src/workspace/projects/project1/file.ts +(stored at emit) /home/src/workspace/projects/project1/file2.ts +(stored at emit) /home/src/workspace/projects/project1/index.ts diff --git a/testdata/baselines/reference/tsc/listFilesOnly/combined-with-incremental.js b/testdata/baselines/reference/tsc/listFilesOnly/combined-with-incremental.js new file mode 100644 index 0000000000..523b9d0031 --- /dev/null +++ b/testdata/baselines/reference/tsc/listFilesOnly/combined-with-incremental.js @@ -0,0 +1,124 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/test.ts] *new* +export const x = 1; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{} + +tsgo --incremental --listFilesOnly +ExitStatus:: Success +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/workspaces/project/test.ts +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/test.ts +Signatures:: + + +Edit [0]:: incremental actual build + +tsgo --incremental +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/test.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 1; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./test.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},"6126f134de98f678e320a9793c4fea1c-export const x = 1;"]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./test.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./test.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": "./test.ts", + "version": "6126f134de98f678e320a9793c4fea1c-export const x = 1;", + "signature": "6126f134de98f678e320a9793c4fea1c-export const x = 1;", + "impliedNodeFormat": "CommonJS" + } + ], + "size": 914 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/test.ts +Signatures:: + + +Edit [1]:: no change + +tsgo --incremental --listFilesOnly +ExitStatus:: Success +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/workspaces/project/test.ts + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: incremental should not build + +tsgo --incremental +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/listFilesOnly/loose-file.js b/testdata/baselines/reference/tsc/listFilesOnly/loose-file.js new file mode 100644 index 0000000000..5f21423cf8 --- /dev/null +++ b/testdata/baselines/reference/tsc/listFilesOnly/loose-file.js @@ -0,0 +1,35 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/test.ts] *new* +export const x = 1; + +tsgo test.ts --listFilesOnly +ExitStatus:: Success +Output:: +/home/src/tslibs/TS/Lib/lib.d.ts +/home/src/workspaces/project/test.ts +//// [/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; }; + diff --git a/testdata/baselines/reference/tsc/moduleResolution/alternateResult.js b/testdata/baselines/reference/tsc/moduleResolution/alternateResult.js new file mode 100644 index 0000000000..7ac02e2f44 --- /dev/null +++ b/testdata/baselines/reference/tsc/moduleResolution/alternateResult.js @@ -0,0 +1,3477 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/index.mts] *new* +import { foo } from "foo"; +import { bar } from "bar"; +import { foo2 } from "foo2"; +import { bar2 } from "bar2"; +//// [/home/src/projects/project/node_modules/@types/bar/index.d.ts] *new* +export declare const bar: number; +//// [/home/src/projects/project/node_modules/@types/bar/package.json] *new* + { + "name": "@types/bar", + "version": "1.0.0", + "types": "index.d.ts", + "exports": { + ".": { + + "require": "./index.d.ts" + } + } + } +//// [/home/src/projects/project/node_modules/@types/bar2/index.d.ts] *new* +export declare const bar2: number; +//// [/home/src/projects/project/node_modules/@types/bar2/package.json] *new* +{ + "name": "@types/bar2", + "version": "1.0.0", + "types": "index.d.ts", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.d.ts" + } + } +} +//// [/home/src/projects/project/node_modules/bar/index.js] *new* +module.exports = { bar: 1 }; +//// [/home/src/projects/project/node_modules/bar/index.mjs] *new* +export const bar = 1; +//// [/home/src/projects/project/node_modules/bar/package.json] *new* + { + "name": "bar", + "version": "1.0.0", + "main": "index.js", + + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } + } +//// [/home/src/projects/project/node_modules/bar2/index.js] *new* +module.exports = { bar2: 1 }; +//// [/home/src/projects/project/node_modules/bar2/index.mjs] *new* +export const bar2 = 1; +//// [/home/src/projects/project/node_modules/bar2/package.json] *new* + { + "name": "bar2", + "version": "1.0.0", + "main": "index.js", + + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } + } +//// [/home/src/projects/project/node_modules/foo/index.d.ts] *new* +export declare const foo: number; +//// [/home/src/projects/project/node_modules/foo/index.js] *new* +module.exports = { foo: 1 }; +//// [/home/src/projects/project/node_modules/foo/index.mjs] *new* +export const foo = 1; +//// [/home/src/projects/project/node_modules/foo/package.json] *new* + { + "name": "foo", + "version": "1.0.0", + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } + } +//// [/home/src/projects/project/node_modules/foo2/index.d.ts] *new* +export declare const foo2: number; +//// [/home/src/projects/project/node_modules/foo2/index.js] *new* +module.exports = { foo2: 1 }; +//// [/home/src/projects/project/node_modules/foo2/index.mjs] *new* +export const foo2 = 1; +//// [/home/src/projects/project/node_modules/foo2/package.json] *new* +{ + "name": "foo2", + "version": "1.0.0", + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.mjs", + "require": "./index.js" + } + } +} +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "module": "node16", + "moduleResolution": "node16", + "traceResolution": true, + "incremental": true, + "strict": true, + "types": [], + }, + "files": ["index.mts"], +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.mjs', result '/home/src/projects/project/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo/index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.mjs' with Package ID 'foo/index.mjs@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar/index.mjs', result '/home/src/projects/project/node_modules/bar/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/bar/index.mjs' with Package ID 'bar/index.mjs@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' with Package ID '@types/bar2/index.d.ts@1.0.0'. ======== +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:1 + +//// [/home/src/projects/project/index.mjs] *new* +export {}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},"165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;","da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","impliedNodeFormat":99}],"fileIdsList":[[2,3]],"options":{"module":100,"strict":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":20,"end":25,"code":7016,"category":1,"message":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":20,"end":25,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings."}]},{"pos":47,"end":52,"code":7016,"category":1,"message":"Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":47,"end":52,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar' library may need to update its package.json or typings."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.mts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts", + "./index.mts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./node_modules/foo2/index.d.ts", + "version": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "signature": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/@types/bar2/index.d.ts", + "version": "da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;", + "signature": "da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.mts", + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "impliedNodeFormat": "ESNext", + "original": { + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts" + ] + ], + "options": { + "module": 100, + "strict": true + }, + "referencedMap": { + "./index.mts": [ + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "pos": 20, + "end": 25, + "code": 7016, + "category": 1, + "message": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "messageChain": [ + { + "pos": 20, + "end": 25, + "code": 6278, + "category": 3, + "message": "There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings." + } + ] + }, + { + "pos": 47, + "end": 52, + "code": 7016, + "category": 1, + "message": "Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type.", + "messageChain": [ + { + "pos": 47, + "end": 52, + "code": 6278, + "category": 3, + "message": "There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar' library may need to update its package.json or typings." + } + ] + } + ] + ] + ], + "size": 2399 +} +//// [/home/src/tslibs/TS/Lib/lib.es2022.full.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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /home/src/projects/project/node_modules/foo2/index.d.ts +*refresh* /home/src/projects/project/node_modules/@types/bar2/index.d.ts +*refresh* /home/src/projects/project/index.mts +Signatures:: + + +Edit [0]:: delete the alternateResult in @types +//// [/home/src/projects/project/node_modules/@types/bar/index.d.ts] *deleted* + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.mjs', result '/home/src/projects/project/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo/index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.mjs' with Package ID 'foo/index.mjs@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar/index.mjs', result '/home/src/projects/project/node_modules/bar/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/@types/bar/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/@types/bar/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/@types/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/@types/bar/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/bar/index.mjs' with Package ID 'bar/index.mjs@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' with Package ID '@types/bar2/index.d.ts@1.0.0'. ======== +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Diff:: Currently we arent repopulating error chain so errors will be different +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -5,7 +5,7 @@ +    ~~~~~ + + index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar';` ++ There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + + 2 import { bar } from "bar"; +    ~~~~~ + +Edit [1]:: delete the node10Result in package/types +//// [/home/src/projects/project/node_modules/foo/index.d.ts] *deleted* + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.mjs', result '/home/src/projects/project/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo/index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/foo/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/foo/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.ts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/foo/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/foo/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.mjs' with Package ID 'foo/index.mjs@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar/index.mjs', result '/home/src/projects/project/node_modules/bar/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/@types/bar/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/@types/bar/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/@types/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/@types/bar/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/bar/index.mjs' with Package ID 'bar/index.mjs@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' with Package ID '@types/bar2/index.d.ts@1.0.0'. ======== +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Diff:: Currently we arent repopulating error chain so errors will be different +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,11 +1,11 @@ + index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/foo` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo';` ++ There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + + 1 import { foo } from "foo"; +    ~~~~~ + + index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar';` ++ There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + + 2 import { bar } from "bar"; +    ~~~~~ + +Edit [2]:: add the alternateResult in @types +//// [/home/src/projects/project/node_modules/@types/bar/index.d.ts] *new* +export declare const bar: number; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.mjs', result '/home/src/projects/project/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo/index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/foo/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/foo/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.ts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/foo/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/foo/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.mjs' with Package ID 'foo/index.mjs@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar/index.mjs', result '/home/src/projects/project/node_modules/bar/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/bar/index.mjs' with Package ID 'bar/index.mjs@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' with Package ID '@types/bar2/index.d.ts@1.0.0'. ======== +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Diff:: Currently we arent repopulating error chain so errors will be different +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,5 +1,5 @@ + index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/foo` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo';` ++ There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + + 1 import { foo } from "foo"; +    ~~~~~ + +Edit [3]:: add the alternateResult in package/types +//// [/home/src/projects/project/node_modules/foo/index.d.ts] *new* +export declare const foo: number; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.mjs', result '/home/src/projects/project/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo/index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.mjs' with Package ID 'foo/index.mjs@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar/index.mjs', result '/home/src/projects/project/node_modules/bar/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/bar/index.mjs' with Package ID 'bar/index.mjs@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' with Package ID '@types/bar2/index.d.ts@1.0.0'. ======== +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + +index.mts:2:21 - error TS7016: Could not find a declaration file for module 'bar'. '/home/src/projects/project/node_modules/bar/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. + +2 import { bar } from "bar"; +   ~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: update package.json from @types so error is fixed +//// [/home/src/projects/project/node_modules/@types/bar/package.json] *modified* +{ + "name": "@types/bar", + "version": "1.0.0", + "types": "index.d.ts", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.d.ts" + } + } +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.mjs', result '/home/src/projects/project/node_modules/foo/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo/index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.mjs' with Package ID 'foo/index.mjs@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' with Package ID '@types/bar2/index.d.ts@1.0.0'. ======== +index.mts:1:21 - error TS7016: Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. + +1 import { foo } from "foo"; +   ~~~~~ + + +Found 1 error in index.mts:1 + +//// [/home/src/projects/project/index.mjs] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.es2022.full.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},"78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;","165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;","da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3,4]],"options":{"module":100,"strict":true},"referencedMap":[[5,1]],"semanticDiagnosticsPerFile":[[5,[{"pos":20,"end":25,"code":7016,"category":1,"message":"Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":20,"end":25,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.mts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts", + "./index.mts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./node_modules/@types/bar/index.d.ts", + "version": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "signature": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/foo2/index.d.ts", + "version": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "signature": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/@types/bar2/index.d.ts", + "version": "da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;", + "signature": "da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.mts", + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts" + ] + ], + "options": { + "module": 100, + "strict": true + }, + "referencedMap": { + "./index.mts": [ + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "pos": 20, + "end": 25, + "code": 7016, + "category": 1, + "message": "Could not find a declaration file for module 'foo'. '/home/src/projects/project/node_modules/foo/index.mjs' implicitly has an 'any' type.", + "messageChain": [ + { + "pos": 20, + "end": 25, + "code": 6278, + "category": 3, + "message": "There are types at '/home/src/projects/project/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo' library may need to update its package.json or typings." + } + ] + } + ] + ] + ], + "size": 2063 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/node_modules/@types/bar/index.d.ts +*refresh* /home/src/projects/project/index.mts +Signatures:: +(used version) /home/src/projects/project/node_modules/@types/bar/index.d.ts +(computed .d.ts) /home/src/projects/project/index.mts + + +Edit [5]:: update package.json so error is fixed +//// [/home/src/projects/project/node_modules/foo/package.json] *modified* +{ + "name": "foo", + "version": "1.0.0", + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.mjs", + "require": "./index.js" + } + } +} + +tsgo +ExitStatus:: Success +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' with Package ID '@types/bar2/index.d.ts@1.0.0'. ======== +//// [/home/src/projects/project/index.mjs] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[6],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./node_modules/@types/bar2/index.d.ts","./index.mts"],"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},"2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;","78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;","165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;","da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3,4,5]],"options":{"module":100,"strict":true},"referencedMap":[[6,1]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.mts" + ], + "original": 6 + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts", + "./index.mts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./node_modules/foo/index.d.ts", + "version": "2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;", + "signature": "2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/@types/bar/index.d.ts", + "version": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "signature": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/foo2/index.d.ts", + "version": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "signature": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/@types/bar2/index.d.ts", + "version": "da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;", + "signature": "da9728b78f5d24b38c00844e001b4953-export declare const bar2: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.mts", + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts" + ] + ], + "options": { + "module": 100, + "strict": true + }, + "referencedMap": { + "./index.mts": [ + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts", + "./node_modules/@types/bar2/index.d.ts" + ] + }, + "size": 1637 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/node_modules/foo/index.d.ts +*refresh* /home/src/projects/project/index.mts +Signatures:: +(used version) /home/src/projects/project/node_modules/foo/index.d.ts +(computed .d.ts) /home/src/projects/project/index.mts + + +Edit [6]:: update package.json from @types so error is introduced +//// [/home/src/projects/project/node_modules/@types/bar2/package.json] *modified* + { + "name": "@types/bar2", + "version": "1.0.0", + "types": "index.d.ts", + "exports": { + ".": { + + "require": "./index.d.ts" + } + } + } + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.d.ts' with Package ID 'foo2/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar2/index.mjs', result '/home/src/projects/project/node_modules/bar2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar2/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/bar2/index.mjs' with Package ID 'bar2/index.mjs@1.0.0'. ======== +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + + +Found 1 error in index.mts:4 + +//// [/home/src/projects/project/index.mjs] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[5],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./node_modules/foo2/index.d.ts","./index.mts"],"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},"2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;","78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;","165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3,4]],"options":{"module":100,"strict":true},"referencedMap":[[5,1]],"semanticDiagnosticsPerFile":[[5,[{"pos":104,"end":110,"code":7016,"category":1,"message":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":104,"end":110,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.mts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts", + "./index.mts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./node_modules/foo/index.d.ts", + "version": "2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;", + "signature": "2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/@types/bar/index.d.ts", + "version": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "signature": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/foo2/index.d.ts", + "version": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "signature": "165b91a7791663df5931f0b63ebf9ce2-export declare const foo2: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.mts", + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts" + ] + ], + "options": { + "module": 100, + "strict": true + }, + "referencedMap": { + "./index.mts": [ + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./node_modules/foo2/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "pos": 104, + "end": 110, + "code": 7016, + "category": 1, + "message": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "messageChain": [ + { + "pos": 104, + "end": 110, + "code": 6278, + "category": 3, + "message": "There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings." + } + ] + } + ] + ] + ], + "size": 2076 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/index.mts +Signatures:: +(computed .d.ts) /home/src/projects/project/index.mts + + +Edit [7]:: update package.json so error is introduced +//// [/home/src/projects/project/node_modules/foo2/package.json] *modified* + { + "name": "foo2", + "version": "1.0.0", + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": { + + "import": "./index.mjs", + "require": "./index.js" + } + } + } + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.mjs', result '/home/src/projects/project/node_modules/foo2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo2/index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.mjs' with Package ID 'foo2/index.mjs@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar2/index.mjs', result '/home/src/projects/project/node_modules/bar2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar2/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/bar2/index.mjs' with Package ID 'bar2/index.mjs@1.0.0'. ======== +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:3 + +//// [/home/src/projects/project/index.mjs] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"fileNames":["lib.es2022.full.d.ts","./node_modules/foo/index.d.ts","./node_modules/@types/bar/index.d.ts","./index.mts"],"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},"2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;","78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;",{"version":"eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":99}],"fileIdsList":[[2,3]],"options":{"module":100,"strict":true},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":75,"end":81,"code":7016,"category":1,"message":"Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":75,"end":81,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo2' library may need to update its package.json or typings."}]},{"pos":104,"end":110,"code":7016,"category":1,"message":"Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.","messageChain":[{"pos":104,"end":110,"code":6278,"category":3,"message":"There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.mts" + ], + "original": 4 + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts", + "./index.mts" + ], + "fileInfos": [ + { + "fileName": "lib.es2022.full.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": "./node_modules/foo/index.d.ts", + "version": "2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;", + "signature": "2a914bfad3bba77712486af8a4cdc415-export declare const foo: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./node_modules/@types/bar/index.d.ts", + "version": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "signature": "78bc7ca8c840e090086811119f6d6ba9-export declare const bar: number;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.mts", + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "eee0814e4a127747fb836acc50eaeb5a-import { foo } from \"foo\";\nimport { bar } from \"bar\";\nimport { foo2 } from \"foo2\";\nimport { bar2 } from \"bar2\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts" + ] + ], + "options": { + "module": 100, + "strict": true + }, + "referencedMap": { + "./index.mts": [ + "./node_modules/foo/index.d.ts", + "./node_modules/@types/bar/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.mts", + [ + { + "pos": 75, + "end": 81, + "code": 7016, + "category": 1, + "message": "Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type.", + "messageChain": [ + { + "pos": 75, + "end": 81, + "code": 6278, + "category": 3, + "message": "There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The 'foo2' library may need to update its package.json or typings." + } + ] + }, + { + "pos": 104, + "end": 110, + "code": 7016, + "category": 1, + "message": "Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type.", + "messageChain": [ + { + "pos": 104, + "end": 110, + "code": 6278, + "category": 3, + "message": "There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json \"exports\". The '@types/bar2' library may need to update its package.json or typings." + } + ] + } + ] + ] + ], + "size": 2467 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/index.mts +Signatures:: +(computed .d.ts) /home/src/projects/project/index.mts + + +Edit [8]:: delete the alternateResult in @types +//// [/home/src/projects/project/node_modules/@types/bar2/index.d.ts] *deleted* + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.mjs', result '/home/src/projects/project/node_modules/foo2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo2/index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.mjs' with Package ID 'foo2/index.mjs@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar2/index.mjs', result '/home/src/projects/project/node_modules/bar2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar2/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/@types/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/bar2/index.mjs' with Package ID 'bar2/index.mjs@1.0.0'. ======== +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:3 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Diff:: Currently we arent repopulating error chain so errors will be different +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -5,7 +5,7 @@ +    ~~~~~~ + + index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/bar2` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar2';` ++ There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + + 4 import { bar2 } from "bar2"; +    ~~~~~~ + +Edit [9]:: delete the node10Result in package/types +//// [/home/src/projects/project/node_modules/foo2/index.d.ts] *deleted* + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.mjs', result '/home/src/projects/project/node_modules/foo2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo2/index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/foo2/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/foo2/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/foo2/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/foo2/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.mjs' with Package ID 'foo2/index.mjs@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar2/index.mjs', result '/home/src/projects/project/node_modules/bar2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar2/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/@types/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/bar2/index.mjs' with Package ID 'bar2/index.mjs@1.0.0'. ======== +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:3 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Diff:: Currently we arent repopulating error chain so errors will be different +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,11 +1,11 @@ + index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/foo2` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo2';` ++ There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + + 3 import { foo2 } from "foo2"; +    ~~~~~~ + + index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/bar2` if it exists or add a new declaration (.d.ts) file containing `declare module 'bar2';` ++ There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + + 4 import { bar2 } from "bar2"; +    ~~~~~~ + +Edit [10]:: add the alternateResult in @types +//// [/home/src/projects/project/node_modules/@types/bar2/index.d.ts] *new* +export declare const bar2: number; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.mjs', result '/home/src/projects/project/node_modules/foo2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo2/index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/foo2/index.d.ts', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/foo2/index.d.ts' has a '.d.ts' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/foo2/index.d.ts.ts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.ts.tsx' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.ts.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/foo2/index.d.ts' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.mjs' with Package ID 'foo2/index.mjs@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar2/index.mjs', result '/home/src/projects/project/node_modules/bar2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar2/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/bar2/index.mjs' with Package ID 'bar2/index.mjs@1.0.0'. ======== +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:3 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Diff:: Currently we arent repopulating error chain so errors will be different +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,5 +1,5 @@ + index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. +- Try `npm i --save-dev @types/foo2` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo2';` ++ There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + + 3 import { foo2 } from "foo2"; +    ~~~~~~ + +Edit [11]:: add the ndoe10Result in package/types +//// [/home/src/projects/project/node_modules/foo2/index.d.ts] *new* +export declare const foo2: number; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module 'foo' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist. +File '/home/src/projects/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. +Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/foo/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo/index.d.ts', result '/home/src/projects/project/node_modules/foo/index.d.ts'. +======== Module name 'foo' was successfully resolved to '/home/src/projects/project/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ======== +======== Resolving module 'bar' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar/package.json'. +Entering conditional exports. +Matched 'exports' condition 'types'. +Using 'exports' subpath '.' with target './index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'types'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar/index.d.ts'. +======== Module name 'bar' was successfully resolved to '/home/src/projects/project/node_modules/@types/bar/index.d.ts' with Package ID '@types/bar/index.d.ts@1.0.0'. ======== +======== Resolving module 'foo2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/foo2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/foo2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/foo2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/foo2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.mjs', result '/home/src/projects/project/node_modules/foo2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'foo2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/foo2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/foo2/index.d.ts'. +File '/home/src/projects/project/node_modules/foo2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/foo2/index.d.ts', result '/home/src/projects/project/node_modules/foo2/index.d.ts'. +======== Module name 'foo2' was successfully resolved to '/home/src/projects/project/node_modules/foo2/index.mjs' with Package ID 'foo2/index.mjs@1.0.0'. ======== +======== Resolving module 'bar2' from '/home/src/projects/project/index.mts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/home/src/projects/project/node_modules/bar2/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.mts' does not exist. +Failed to resolve under condition 'import'. +Saw non-matching condition 'require'. +Exiting conditional exports. +Found 'package.json' at '/home/src/projects/project/node_modules/@types/bar2/package.json'. +Entering conditional exports. +Saw non-matching condition 'require'. +Exiting conditional exports. +Directory '/home/src/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/home/node_modules' does not exist, skipping all lookups in it. +Directory '/home/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules/@types' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './index.mjs'. +File name '/home/src/projects/project/node_modules/bar2/index.mjs' has a '.mjs' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.mjs' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/home/src/projects/project/node_modules/bar2/index.mjs', result '/home/src/projects/project/node_modules/bar2/index.mjs'. +Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update. +File '/home/src/projects/project/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/package.json' does not exist according to earlier cached lookups. +File '/home/src/package.json' does not exist according to earlier cached lookups. +File '/home/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'bar2' from 'node_modules' folder, target file types: TypeScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/home/src/projects/project/node_modules/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. +Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist according to earlier cached lookups. +File '/home/src/projects/project/node_modules/bar2/index.js.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.js.d.ts' does not exist. +Directory '/home/src/projects/project/node_modules/bar2/index.js' does not exist, skipping all lookups in it. +File '/home/src/projects/project/node_modules/@types/bar2/package.json' exists according to earlier cached lookups. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' has 'types' field 'index.d.ts' that references '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +File '/home/src/projects/project/node_modules/@types/bar2/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', result '/home/src/projects/project/node_modules/@types/bar2/index.d.ts'. +======== Module name 'bar2' was successfully resolved to '/home/src/projects/project/node_modules/bar2/index.mjs' with Package ID 'bar2/index.mjs@1.0.0'. ======== +index.mts:3:22 - error TS7016: Could not find a declaration file for module 'foo2'. '/home/src/projects/project/node_modules/foo2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/foo2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo2' library may need to update its package.json or typings. + +3 import { foo2 } from "foo2"; +   ~~~~~~ + +index.mts:4:22 - error TS7016: Could not find a declaration file for module 'bar2'. '/home/src/projects/project/node_modules/bar2/index.mjs' implicitly has an 'any' type. + There are types at '/home/src/projects/project/node_modules/@types/bar2/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar2' library may need to update its package.json or typings. + +4 import { bar2 } from "bar2"; +   ~~~~~~ + + +Found 2 errors in the same file, starting at: index.mts:3 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/moduleResolution/package-json-scope.js b/testdata/baselines/reference/tsc/moduleResolution/package-json-scope.js new file mode 100644 index 0000000000..d50d7c12a5 --- /dev/null +++ b/testdata/baselines/reference/tsc/moduleResolution/package-json-scope.js @@ -0,0 +1,281 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/package.json] *new* +{ + "name": "app", + "version": "1.0.0" +} +//// [/home/src/workspaces/project/src/fileA.ts] *new* +import { foo } from "./fileB.mjs"; +foo(); +//// [/home/src/workspaces/project/src/fileB.mts] *new* +export function foo() {} +//// [/home/src/workspaces/project/src/main.ts] *new* +export const x = 10; +//// [/home/src/workspaces/project/src/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "ES2016", + "composite": true, + "module": "Node16", + "traceResolution": true, + }, + "files": [ + "main.ts", + "fileA.ts", + "fileB.mts", + ], +} + +tsgo -p src --explainFiles --extendedDiagnostics +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module './fileB.mjs' from '/home/src/workspaces/project/src/fileA.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/home/src/workspaces/project/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +File name '/home/src/workspaces/project/src/fileB.mjs' has a '.mjs' extension - stripping it. +File '/home/src/workspaces/project/src/fileB.mts' exists - use it as a name resolution result. +======== Module name './fileB.mjs' was successfully resolved to '/home/src/workspaces/project/src/fileB.mts'. ======== +src/fileA.ts:1:21 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./fileB.mjs")' call instead. + To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/home/src/workspaces/project/package.json'. + +1 import { foo } from "./fileB.mjs"; +   ~~~~~~~~~~~~~ + +../../tslibs/TS/Lib/lib.es2016.full.d.ts + Default library for target 'ES2016' +src/main.ts + Part of 'files' list in tsconfig.json + File is CommonJS module because 'package.json' does not have field "type" +src/fileB.mts + Imported via "./fileB.mjs" from file 'src/fileA.ts' + Part of 'files' list in tsconfig.json +src/fileA.ts + Part of 'files' list in tsconfig.json + File is CommonJS module because 'package.json' does not have field "type" + +Found 1 error in src/fileA.ts:1 + +//// [/home/src/tslibs/TS/Lib/lib.es2016.full.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/src/fileA.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/fileA.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fileB_mjs_1 = require("./fileB.mjs"); +(0, fileB_mjs_1.foo)(); + +//// [/home/src/workspaces/project/src/fileB.d.mts] *new* +export declare function foo(): void; + +//// [/home/src/workspaces/project/src/fileB.mjs] *new* +export function foo() { } + +//// [/home/src/workspaces/project/src/main.d.ts] *new* +export declare const x = 10; + +//// [/home/src/workspaces/project/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/home/src/workspaces/project/src/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.es2016.full.d.ts","./main.ts","./fileB.mts","./fileA.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":"28e8748a7acd58f4f59388926e914f86-export const x = 10;","signature":"f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n","impliedNodeFormat":1},{"version":"d03690d860e74c03bcacf63f0dd68b93-export function foo() {}","signature":"7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n","impliedNodeFormat":99},{"version":"cc520ca096f0b81d18073ba8a9776fe3-import { foo } from \"./fileB.mjs\";\nfoo();","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[3]],"options":{"composite":true,"module":100,"target":3},"referencedMap":[[4,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":20,"end":33,"code":1479,"category":1,"message":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.","messageChain":[{"pos":20,"end":33,"code":1481,"category":3,"message":"To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `\"type\": \"module\"` to '/home/src/workspaces/project/package.json'."}]}]]],"latestChangedDtsFile":"./fileA.d.ts"} +//// [/home/src/workspaces/project/src/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./main.ts", + "./fileB.mts", + "./fileA.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.es2016.full.d.ts", + "./main.ts", + "./fileB.mts", + "./fileA.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2016.full.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": "./main.ts", + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "28e8748a7acd58f4f59388926e914f86-export const x = 10;", + "signature": "f9b4154a9a5944099ecf197d4519d083-export declare const x = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileB.mts", + "version": "d03690d860e74c03bcacf63f0dd68b93-export function foo() {}", + "signature": "7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "d03690d860e74c03bcacf63f0dd68b93-export function foo() {}", + "signature": "7ffb4ea6089b1a385965a214ba412941-export declare function foo(): void;\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./fileA.ts", + "version": "cc520ca096f0b81d18073ba8a9776fe3-import { foo } from \"./fileB.mjs\";\nfoo();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "cc520ca096f0b81d18073ba8a9776fe3-import { foo } from \"./fileB.mjs\";\nfoo();", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./fileB.mts" + ] + ], + "options": { + "composite": true, + "module": 100, + "target": 3 + }, + "referencedMap": { + "./fileA.ts": [ + "./fileB.mts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./fileA.ts", + [ + { + "pos": 20, + "end": 33, + "code": 1479, + "category": 1, + "message": "The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.", + "messageChain": [ + { + "pos": 20, + "end": 33, + "code": 1481, + "category": 3, + "message": "To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `\"type\": \"module\"` to '/home/src/workspaces/project/package.json'." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./fileA.d.ts", + "size": 2140 +} + +src/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2016.full.d.ts +*refresh* /home/src/workspaces/project/src/main.ts +*refresh* /home/src/workspaces/project/src/fileB.mts +*refresh* /home/src/workspaces/project/src/fileA.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/main.ts +(stored at emit) /home/src/workspaces/project/src/fileB.mts +(stored at emit) /home/src/workspaces/project/src/fileA.ts + + +Edit [0]:: Delete package.json +//// [/home/src/workspaces/project/package.json] *deleted* + +tsgo -p src --explainFiles --extendedDiagnostics +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +======== Resolving module './fileB.mjs' from '/home/src/workspaces/project/src/fileA.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/home/src/workspaces/project/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +File name '/home/src/workspaces/project/src/fileB.mjs' has a '.mjs' extension - stripping it. +File '/home/src/workspaces/project/src/fileB.mts' exists - use it as a name resolution result. +======== Module name './fileB.mjs' was successfully resolved to '/home/src/workspaces/project/src/fileB.mts'. ======== +src/fileA.ts:1:21 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./fileB.mjs")' call instead. + To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/home/src/workspaces/project/package.json'. + +1 import { foo } from "./fileB.mjs"; +   ~~~~~~~~~~~~~ + +../../tslibs/TS/Lib/lib.es2016.full.d.ts + Default library for target 'ES2016' +src/main.ts + Part of 'files' list in tsconfig.json + File is CommonJS module because 'package.json' was not found +src/fileB.mts + Imported via "./fileB.mjs" from file 'src/fileA.ts' + Part of 'files' list in tsconfig.json +src/fileA.ts + Part of 'files' list in tsconfig.json + File is CommonJS module because 'package.json' was not found + +Found 1 error in src/fileA.ts:1 + + +src/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Diff:: Currently we arent repopulating error chain so errors will be different +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,5 +1,5 @@ + src/fileA.ts:1:21 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./fileB.mjs")' call instead. +- To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. ++ To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/home/src/workspaces/project/package.json'. + + 1 import { foo } from "./fileB.mjs"; +    ~~~~~~~~~~~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/tsc/moduleResolution/pnpm-style-layout.js b/testdata/baselines/reference/tsc/moduleResolution/pnpm-style-layout.js new file mode 100644 index 0000000000..a218d66471 --- /dev/null +++ b/testdata/baselines/reference/tsc/moduleResolution/pnpm-style-layout.js @@ -0,0 +1,315 @@ +currentDirectory::/home/src/projects/component-type-checker/packages/app +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button/package.json] *new* +{ + "name": "@component-type-checker/button", + "version": "0.0.1", + "main": "./src/index.ts" +} +//// [/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] *new* +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.2/node_modules/@component-type-checker/button/package.json] *new* +{ + "name": "@component-type-checker/button", + "version": "0.0.2", + "main": "./src/index.ts" +} +//// [/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] *new* +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+components@0.0.1_@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+button@0.0.1/node_modules/@component-type-checker/button *new* +//// [/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] *new* +{ + "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" + } +} +//// [/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] *new* +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/button] -> /home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button *new* +//// [/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] *new* +{ + "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" + } +} +//// [/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] *new* +export { createButton, Button } from "@component-type-checker/button"; +//// [/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button] -> /home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button *new* +//// [/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components] -> /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 *new* +//// [/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk] -> /home/src/projects/component-type-checker/packages/sdk *new* +//// [/home/src/projects/component-type-checker/packages/app/package.json] *new* +{ + "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/src/app.tsx] *new* +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/tsconfig.json] *new* +{ + "compilerOptions": { + "target": "es5", + "module": "esnext", + "lib": ["ES5"], + "moduleResolution": "node", + "outDir": "dist", + }, + "include": ["src"], +} +//// [/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/button] -> /home/src/projects/component-type-checker/node_modules/.pnpm/@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button *new* +//// [/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components] -> /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 *new* +//// [/home/src/projects/component-type-checker/packages/sdk/package.json] *new* +{ + "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/src/index.ts] *new* +export { Button, createButton } from "@component-type-checker/components"; +export const VERSION = "0.0.2"; + +tsgo --traceResolution --explainFiles +ExitStatus:: Success +Output:: +======== Resolving module '@component-type-checker/sdk' from '/home/src/projects/component-type-checker/packages/app/src/app.tsx'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/home/src/projects/component-type-checker/packages/app/src/package.json' does not exist. +Found 'package.json' at '/home/src/projects/component-type-checker/packages/app/package.json'. +Loading module '@component-type-checker/sdk' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/component-type-checker/packages/app/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/component-type-checker/packages/app/src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__sdk' +Found 'package.json' at '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk/package.json'. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk.ts' does not exist. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk.tsx' does not exist. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './src/index.ts' that references '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk/src/index.ts'. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk/src/index.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk/src/index.ts', result '/home/src/projects/component-type-checker/packages/sdk/src/index.ts'. +======== Module name '@component-type-checker/sdk' was successfully resolved to '/home/src/projects/component-type-checker/packages/sdk/src/index.ts' with Package ID '@component-type-checker/sdk1@0.0.2'. ======== +======== Resolving module '@component-type-checker/components' from '/home/src/projects/component-type-checker/packages/app/src/app.tsx'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/home/src/projects/component-type-checker/packages/app/src/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/component-type-checker/packages/app/package.json' exists according to earlier cached lookups. +Loading module '@component-type-checker/components' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/component-type-checker/packages/app/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/component-type-checker/packages/app/src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__components' +Found 'package.json' at '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components/package.json'. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components.ts' does not exist. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components.tsx' does not exist. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './src/index.ts' that references '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components/src/index.ts'. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components/src/index.ts' exists - use it as a name resolution result. +'package.json' has a 'peerDependencies' field. +Resolving real path for '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components', result '/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'. +Found 'package.json' at '/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/package.json'. +Found peerDependency '@component-type-checker/button' with '0.0.2' version. +Resolving real path for '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components/src/index.ts', result '/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'. +======== Module name '@component-type-checker/components' was successfully resolved to '/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' with Package ID '@component-type-checker/components@0.0.1+@component-type-checker/button@0.0.2'. ======== +======== Resolving module '@component-type-checker/button' from '/home/src/projects/component-type-checker/packages/app/src/app.tsx'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/home/src/projects/component-type-checker/packages/app/src/package.json' does not exist according to earlier cached lookups. +File '/home/src/projects/component-type-checker/packages/app/package.json' exists according to earlier cached lookups. +Loading module '@component-type-checker/button' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/component-type-checker/packages/app/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/component-type-checker/packages/app/src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__button' +Found 'package.json' at '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button/package.json'. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button.ts' does not exist. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button.tsx' does not exist. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './src/index.ts' that references '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button/src/index.ts'. +File '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button/src/index.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button/src/index.ts', result '/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'. +======== Module name '@component-type-checker/button' was successfully resolved to '/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' with Package ID '@component-type-checker/button@0.0.2'. ======== +======== Resolving module '@component-type-checker/components' from '/home/src/projects/component-type-checker/packages/sdk/src/index.ts'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/home/src/projects/component-type-checker/packages/sdk/src/package.json' does not exist. +Found 'package.json' at '/home/src/projects/component-type-checker/packages/sdk/package.json'. +Loading module '@component-type-checker/components' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/home/src/projects/component-type-checker/packages/sdk/src/node_modules' does not exist, skipping all lookups in it. +Directory '/home/src/projects/component-type-checker/packages/sdk/src/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__components' +Found 'package.json' at '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components/package.json'. +File '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components.ts' does not exist. +File '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components.tsx' does not exist. +File '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './src/index.ts' that references '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components/src/index.ts'. +File '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components/src/index.ts' exists - use it as a name resolution result. +'package.json' has a 'peerDependencies' field. +Resolving real path for '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components', result '/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'. +Found 'package.json' at '/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/package.json'. +Found peerDependency '@component-type-checker/button' with '0.0.1' version. +Resolving real path for '/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components/src/index.ts', result '/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'. +======== Module name '@component-type-checker/components' was successfully resolved to '/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' with Package ID '@component-type-checker/components@0.0.1+@component-type-checker/button@0.0.1'. ======== +======== Resolving module '@component-type-checker/button' from '/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'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/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/package.json' does not exist. +Found 'package.json' at '/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'. +Loading module '@component-type-checker/button' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/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/node_modules' does not exist, skipping all lookups in it. +Directory '/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/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__button' +Directory '/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/node_modules' does not exist, skipping all lookups in it. +Directory '/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/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__button' +Directory '/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/node_modules' does not exist, skipping all lookups in it. +Directory '/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/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__button' +File '/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/package.json' exists according to earlier cached lookups. +File '/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.ts' does not exist. +File '/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.tsx' does not exist. +File '/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.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './src/index.ts' that references '/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/src/index.ts'. +File '/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/src/index.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/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/src/index.ts', result '/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'. +======== Module name '@component-type-checker/button' was successfully resolved to '/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' with Package ID '@component-type-checker/button@0.0.1'. ======== +======== Resolving module '@component-type-checker/button' from '/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'. ======== +Explicitly specified module resolution kind: 'Bundler'. +Resolving in CJS mode with conditions 'import', 'types'. +File '/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/package.json' does not exist. +Found 'package.json' at '/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'. +Loading module '@component-type-checker/button' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Directory '/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/node_modules' does not exist, skipping all lookups in it. +Directory '/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/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__button' +Directory '/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/node_modules' does not exist, skipping all lookups in it. +Directory '/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/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__button' +Directory '/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/node_modules' does not exist, skipping all lookups in it. +Directory '/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/node_modules/@types' does not exist, skipping all lookups in it. +Scoped package detected, looking in 'component-type-checker__button' +File '/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/package.json' exists according to earlier cached lookups. +File '/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.ts' does not exist. +File '/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.tsx' does not exist. +File '/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.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field './src/index.ts' that references '/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/src/index.ts'. +File '/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/src/index.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. +Resolving real path for '/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/src/index.ts', result '/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'. +======== Module name '@component-type-checker/button' was successfully resolved to '/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' with Package ID '@component-type-checker/button@0.0.2'. ======== +../../../../tslibs/TS/Lib/lib.es5.d.ts + Library 'lib.es5.d.ts' specified in compilerOptions +../../node_modules/.pnpm/@component-type-checker+button@0.0.1/node_modules/@component-type-checker/button/src/index.ts + Imported via "@component-type-checker/button" from file '../../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' with packageId '@component-type-checker/button@0.0.1' +../../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 + Imported via "@component-type-checker/components" from file '../sdk/src/index.ts' with packageId '@component-type-checker/components@0.0.1+@component-type-checker/button@0.0.1' +../sdk/src/index.ts + Imported via "@component-type-checker/sdk" from file 'src/app.tsx' with packageId '@component-type-checker/sdk1@0.0.2' +../../node_modules/.pnpm/@component-type-checker+button@0.0.2/node_modules/@component-type-checker/button/src/index.ts + Imported via "@component-type-checker/button" from file '../../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' with packageId '@component-type-checker/button@0.0.2' + Imported via "@component-type-checker/button" from file 'src/app.tsx' with packageId '@component-type-checker/button@0.0.2' +../../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 + Imported via "@component-type-checker/components" from file 'src/app.tsx' with packageId '@component-type-checker/components@0.0.1+@component-type-checker/button@0.0.2' +src/app.tsx + Matched by include pattern 'src' in 'tsconfig.json' +//// [/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] *deleted* +//// [/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] *deleted* +//// [/home/src/projects/component-type-checker/packages/app/dist/app.js] *new* +import { createButton } from "@component-type-checker/button"; +const button = createButton(); + +//// [/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/button] *deleted* +//// [/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/components] *deleted* +//// [/home/src/projects/component-type-checker/packages/app/node_modules/@component-type-checker/sdk] *deleted* +//// [/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/button] *deleted* +//// [/home/src/projects/component-type-checker/packages/sdk/node_modules/@component-type-checker/components] *deleted* +//// [/home/src/tslibs/TS/Lib/lib.es5.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; }; + diff --git a/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js b/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js new file mode 100644 index 0000000000..459fb46b4b --- /dev/null +++ b/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js @@ -0,0 +1,1386 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": true + } +} + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/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: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1810 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [2]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [3]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +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 +Signatures:: + + +Edit [4]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1806 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [7]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [8]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1753 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1303 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [10]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/c.ts + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 2114 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1611 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [14]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [15]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [16]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noCheck/dts-errors.js b/testdata/baselines/reference/tsc/noCheck/dts-errors.js index f6a6bd8271..e7df523f48 100644 --- a/testdata/baselines/reference/tsc/noCheck/dts-errors.js +++ b/testdata/baselines/reference/tsc/noCheck/dts-errors.js @@ -9,6 +9,7 @@ export const b = 10; { "compilerOptions": { "declaration": true, + "incremental": false } } @@ -76,3 +77,371 @@ exports.b = void 0; exports.b = 10; + + +Edit [0]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [2]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [3]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [4]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [5]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [7]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [8]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [10]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + + + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = class { private p = 10; }; + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [14]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [15]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [16]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noCheck/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsc/noCheck/semantic-errors-with-incremental.js new file mode 100644 index 0000000000..79f7062075 --- /dev/null +++ b/testdata/baselines/reference/tsc/noCheck/semantic-errors-with-incremental.js @@ -0,0 +1,1194 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a: number = "hello"; +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": true + } +} + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/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: number; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1311 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [2]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [3]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +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 +Signatures:: + + +Edit [4]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [7]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [8]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello"; +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1398 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1303 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [10]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/c.ts + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";","signature":"03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2c3aef4914dc04eedbda88b614f5cc47-export const a: number = \"hello\";", + "signature": "03ee330dc35a9c186b6cc67781eafb11-export declare const a: number;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1615 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1611 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [14]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [15]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [16]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noCheck/semantic-errors.js b/testdata/baselines/reference/tsc/noCheck/semantic-errors.js index ee94288e9c..a845267123 100644 --- a/testdata/baselines/reference/tsc/noCheck/semantic-errors.js +++ b/testdata/baselines/reference/tsc/noCheck/semantic-errors.js @@ -9,6 +9,7 @@ export const b = 10; { "compilerOptions": { "declaration": true, + "incremental": false } } @@ -57,3 +58,280 @@ exports.b = void 0; exports.b = 10; + + +Edit [0]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [2]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [3]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [4]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [5]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [7]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [8]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello"; +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [10]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + + + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a: number = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a: number; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +export declare const a = "hello"; + +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [14]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [15]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [16]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noCheck/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsc/noCheck/syntax-errors-with-incremental.js new file mode 100644 index 0000000000..3dea3854e6 --- /dev/null +++ b/testdata/baselines/reference/tsc/noCheck/syntax-errors-with-incremental.js @@ -0,0 +1,1242 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +export const a = "hello +//// [/home/src/workspaces/project/b.ts] *new* +export const b = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "declaration": true, + "incremental": true + } +} + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/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 = "hello"; + +//// [/home/src/workspaces/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/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; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1318 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[1,2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "size": 1307 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [2]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/a.ts +*not cached* /home/src/workspaces/project/b.ts +Signatures:: + + +Edit [3]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +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 +Signatures:: + + +Edit [4]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1314 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [7]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [8]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1294 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1303 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [10]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/c.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/c.ts + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1622 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","checkPending":true,"root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[2,[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "checkPending": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + "./a.ts", + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1611 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [14]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./a.ts","./b.ts","./c.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";","signature":"330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n","impliedNodeFormat":1}],"options":{"declaration":true},"semanticDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts", + "./c.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.ts", + "./c.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "32c618963fbf4ae5f1475f9be91d77bb-export const c: number = \"hello\";", + "signature": "330cf13f2bbf810d913e97d0cc189ea6-export declare const c: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1589 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/a.ts +Signatures:: + + +Edit [15]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [16]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noCheck/syntax-errors.js b/testdata/baselines/reference/tsc/noCheck/syntax-errors.js index 0fa9c55830..196a61e059 100644 --- a/testdata/baselines/reference/tsc/noCheck/syntax-errors.js +++ b/testdata/baselines/reference/tsc/noCheck/syntax-errors.js @@ -9,6 +9,7 @@ export const b = 10; { "compilerOptions": { "declaration": true, + "incremental": false } } @@ -65,3 +66,327 @@ exports.b = void 0; exports.b = 10; + + +Edit [0]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [1]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [2]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [3]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [4]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [5]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [6]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [7]:: no change + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [8]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [9]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [10]:: No Change run with checking + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* + + + +Edit [11]:: Add file with error +//// [/home/src/workspaces/project/c.ts] *new* +export const c: number = "hello"; + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *new* +export declare const c: number; + +//// [/home/src/workspaces/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = "hello"; + + + + +Edit [12]:: Introduce error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello + +tsgo --noCheck +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [13]:: Fix `a` error with noCheck +//// [/home/src/workspaces/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [14]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [15]:: no change + +tsgo --noCheck +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + + + +Edit [16]:: No Change run with checking + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +c.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const c: number = "hello"; +   ~ + + +Found 1 error in c.ts:1 + +//// [/home/src/workspaces/project/a.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/b.js] *rewrite with same content* +//// [/home/src/workspaces/project/c.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/c.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noEmit/changes-composite.js b/testdata/baselines/reference/tsc/noEmit/changes-composite.js new file mode 100644 index 0000000000..684ab7b066 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/changes-composite.js @@ -0,0 +1,1573 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} + +tsgo +ExitStatus:: Success +Output:: +//// [/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/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "size": 2590 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [0]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: Introduce error but still noEmit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","emitSignatures":[[2,"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|Dts", + 2 + ], + [ + "./src/directUse.ts", + "Dts", + [ + 4 + ] + ], + [ + "./src/indirectClass.ts", + "Js|Dts", + 3 + ], + [ + "./src/indirectUse.ts", + "Dts", + [ + 5 + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "emitSignatures": [ + { + "file": "./src/class.ts", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "original": [ + 2, + "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n" + ] + }, + { + "file": "./src/directUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 4, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + }, + { + "file": "./src/indirectUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 5, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + } + ], + "size": 3190 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: Fix error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "size": 2590 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [4]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [6]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [8]:: Introduce error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "size": 3093 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [9]:: No Change run with emit + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [10]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [11]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [12]:: No Change run with emit + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [13]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"latestChangedDtsFile":"./src/class.d.ts","emitSignatures":[[2,"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "emitSignatures": [ + { + "file": "./src/class.ts", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "original": [ + 2, + "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n" + ] + }, + { + "file": "./src/directUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 4, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + }, + { + "file": "./src/indirectUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 5, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + } + ], + "size": 2648 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [14]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/class.d.ts", + "size": 2562 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [15]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [16]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [17]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js b/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js new file mode 100644 index 0000000000..5b783b64e3 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js @@ -0,0 +1,1525 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true } +} + +tsgo +ExitStatus:: Success +Output:: +//// [/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/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [0]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: Introduce error but still noEmit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,[4],3,[5]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|Dts", + 2 + ], + [ + "./src/directUse.ts", + "Dts", + [ + 4 + ] + ], + [ + "./src/indirectClass.ts", + "Js|Dts", + 3 + ], + [ + "./src/indirectUse.ts", + "Dts", + [ + 5 + ] + ] + ], + "size": 2906 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: Fix error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/class.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [4]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [6]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [8]:: Introduce error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 3053 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [9]:: No Change run with emit + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [10]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [11]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [12]:: No Change run with emit + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [13]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "size": 2391 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [14]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [15]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [16]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [17]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-incremental.js b/testdata/baselines/reference/tsc/noEmit/changes-incremental.js new file mode 100644 index 0000000000..e7d2f13ae7 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/changes-incremental.js @@ -0,0 +1,1356 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true } +} + +tsgo +ExitStatus:: Success +Output:: +//// [/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/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 1737 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: Introduce error but still noEmit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"affectedFilesPendingEmit":[2,4,3,5]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/directUse.ts", + "Js", + 4 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ], + [ + "./src/indirectUse.ts", + "Js", + 5 + ] + ], + "size": 2807 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(computed .d.ts) /home/src/workspaces/project/src/directUse.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: Fix error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/directUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2051 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [4]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [6]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [8]:: Introduce error and emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 2582 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [9]:: No Change run with emit + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [10]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [11]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [12]:: No Change run with emit + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [13]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ] + ], + "size": 2084 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [14]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2051 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [15]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [16]:: No Change run with noEmit + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [17]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js new file mode 100644 index 0000000000..36c0d08c5f --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js @@ -0,0 +1,1092 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "composite": true } +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/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/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"emitSignatures":[2,3,4,5,6,7]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "Js|DtsEmit", + [ + 5, + 17 + ] + ], + [ + "./src/noChangeFile.ts", + "Js|DtsEmit", + [ + 6, + 17 + ] + ], + [ + "./src/noChangeFileWithEmitSpecificError.ts", + "Js|DtsEmit", + [ + 7, + 17 + ] + ] + ], + "emitSignatures": [ + { + "file": "./src/class.ts", + "original": 2 + }, + { + "file": "./src/indirectClass.ts", + "original": 3 + }, + { + "file": "./src/directUse.ts", + "original": 4 + }, + { + "file": "./src/indirectUse.ts", + "original": 5 + }, + { + "file": "./src/noChangeFile.ts", + "original": 6 + }, + { + "file": "./src/noChangeFileWithEmitSpecificError.ts", + "original": 7 + } + ], + "size": 1868 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "size": 2590 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [1]:: Introduce error with emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "size": 3093 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [2]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"latestChangedDtsFile":"./src/class.d.ts","emitSignatures":[[2,"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n"],[4,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"],[5,"abe7d9981d6018efb6b2b794f40a1607-export {};\n"]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "emitSignatures": [ + { + "file": "./src/class.ts", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "original": [ + 2, + "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n" + ] + }, + { + "file": "./src/directUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 4, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + }, + { + "file": "./src/indirectUse.ts", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "original": [ + 5, + "abe7d9981d6018efb6b2b794f40a1607-export {};\n" + ] + } + ], + "size": 2648 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"latestChangedDtsFile":"./src/class.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "latestChangedDtsFile": "./src/class.d.ts", + "size": 2562 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts diff --git a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js new file mode 100644 index 0000000000..06cf8ee6c6 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -0,0 +1,1042 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true, "declaration": true } +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/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/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "Js|DtsEmit", + [ + 5, + 17 + ] + ], + [ + "./src/noChangeFile.ts", + "Js|DtsEmit", + [ + 6, + 17 + ] + ], + [ + "./src/noChangeFileWithEmitSpecificError.ts", + "Js|DtsEmit", + [ + 7, + 17 + ] + ] + ], + "size": 1839 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.d.ts] *new* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *new* +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.d.ts] *new* +export declare function writeLog(s: string): void; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.d.ts] *new* +declare function someFunc(arguments: boolean, ...rest: any[]): void; + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/class.ts +(stored at emit) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFile.ts +(stored at emit) /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts + + +Edit [1]:: Introduce error with emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop1: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 3053 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [2]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./src/directUse.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./src/indirectClass.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./src/indirectUse.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "size": 2391 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.d.ts] *modified* +export declare class classC { + prop: number; +} + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}","signature":"b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n","impliedNodeFormat":1},{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "b46de008dd76697ce12a1dca20c0bf9e-export declare function writeLog(s: string): void;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "86b693f65e0d5bed7e4ac554c2edb8ba-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2522 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/project/src/directUse.ts +(stored at emit) /home/src/workspaces/project/src/indirectUse.ts diff --git a/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js new file mode 100644 index 0000000000..30ecfe7660 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js @@ -0,0 +1,888 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/src/class.ts] *new* +export class classC { + prop = 1; +} +//// [/home/src/workspaces/project/src/directUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/indirectClass.ts] *new* +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} +//// [/home/src/workspaces/project/src/indirectUse.ts] *new* +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; +//// [/home/src/workspaces/project/src/noChangeFile.ts] *new* +export function writeLog(s: string) { +} +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts] *new* +function someFunc(arguments: boolean, ...rest: any[]) { +} +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { "incremental": true } +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/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/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[2,4,3,5,6,7]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/directUse.ts", + "Js", + 4 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ], + [ + "./src/indirectUse.ts", + "Js", + 5 + ], + [ + "./src/noChangeFile.ts", + "Js", + 6 + ], + [ + "./src/noChangeFileWithEmitSpecificError.ts", + "Js", + 7 + ] + ], + "size": 1778 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +*refresh* /home/src/workspaces/project/src/noChangeFile.ts +*refresh* /home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.ts +Signatures:: + + +Edit [0]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/indirectClass.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +const class_1 = require("./class"); +class indirectClass { + classC = new class_1.classC(); +} +exports.indirectClass = indirectClass; + +//// [/home/src/workspaces/project/src/indirectUse.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + +//// [/home/src/workspaces/project/src/noChangeFile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + +//// [/home/src/workspaces/project/src/noChangeFileWithEmitSpecificError.js] *new* +function someFunc(arguments, ...rest) { +} + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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},"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 1737 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Introduce error with emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop1 = 1; +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + +src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/class.ts:2:5 - 'prop1' is declared here. + 2 prop1 = 1; +    ~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 src/directUse.ts:2 + 1 src/indirectUse.ts:2 + +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop1 = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/directUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/src/indirectUse.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}","signature":"e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]],[5,[{"pos":76,"end":80,"code":2551,"category":1,"message":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":2,"pos":26,"end":31,"code":2728,"category":3,"message":"'prop1' is declared here."}]}]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f5da9f4ab128bbaf87adf83ca7ae8e2d-export class classC {\n prop1 = 1;\n}", + "signature": "e36cbd492db9c71062d723d518b6277f-export declare class classC {\n prop1: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ], + [ + "./src/indirectUse.ts", + [ + { + "pos": 76, + "end": 80, + "code": 2551, + "category": 1, + "message": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "pos": 26, + "end": 31, + "code": 2728, + "category": 3, + "message": "'prop1' is declared here." + } + ] + } + ] + ] + ], + "size": 2770 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(computed .d.ts) /home/src/workspaces/project/src/directUse.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [2]:: Fix error and no emit +//// [/home/src/workspaces/project/src/class.ts] *modified* +export class classC { + prop = 1; +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js", + 2 + ], + [ + "./src/indirectClass.ts", + "Js", + 3 + ] + ], + "size": 2084 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/workspaces/project/src/class.ts +*refresh* /home/src/workspaces/project/src/indirectClass.ts +*refresh* /home/src/workspaces/project/src/directUse.ts +*refresh* /home/src/workspaces/project/src/indirectUse.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/src/class.ts +(computed .d.ts) /home/src/workspaces/project/src/indirectClass.ts +(used version) /home/src/workspaces/project/src/directUse.ts +(used version) /home/src/workspaces/project/src/indirectUse.ts + + +Edit [3]:: No Change run with emit + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/src/class.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +class classC { + prop = 1; +} +exports.classC = classC; + +//// [/home/src/workspaces/project/src/indirectClass.js] *rewrite with same content* +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,7]],"fileNames":["lib.d.ts","./src/class.ts","./src/indirectClass.ts","./src/directUse.ts","./src/indirectUse.ts","./src/noChangeFile.ts","./src/noChangeFileWithEmitSpecificError.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":"5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}","signature":"8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n","impliedNodeFormat":1},{"version":"2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n","impliedNodeFormat":1},"1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}",{"version":"f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.ts" + ], + "original": [ + 2, + 7 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./src/class.ts", + "./src/indirectClass.ts", + "./src/directUse.ts", + "./src/indirectUse.ts", + "./src/noChangeFile.ts", + "./src/noChangeFileWithEmitSpecificError.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": "./src/class.ts", + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "5106d5119e9d454b0e9d7956b0f66ab8-export class classC {\n prop = 1;\n}", + "signature": "8743eb01f3ddad300611aa9bbf6b6c0a-export declare class classC {\n prop: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/indirectClass.ts", + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2d32895543847620d7c9848ddd3a7306-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "4c7e50f9604f4038b2f1bafae04987bb-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./src/directUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/indirectUse.ts", + "version": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "1e7a664a983b65ba5fbd926c9dad4a26-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFile.ts", + "version": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "signature": "12f2d04905c254bde932222194cd2d1b-export function writeLog(s: string) {\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./src/noChangeFileWithEmitSpecificError.ts", + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f54e687ca7ac9fc3c2161967d09e9950-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "./src/indirectClass.ts" + ], + [ + "./src/class.ts" + ] + ], + "referencedMap": { + "./src/directUse.ts": [ + "./src/indirectClass.ts" + ], + "./src/indirectClass.ts": [ + "./src/class.ts" + ], + "./src/indirectUse.ts": [ + "./src/indirectClass.ts" + ] + }, + "size": 2051 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000..fbd4468cd3 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,1586 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/c.ts] *new* +export const c = class { private p = 10; }; +//// [/home/src/projects/project/d.ts] *new* +export const d = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + } +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"affectedFilesPendingEmit":[2,3,4,5]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + } + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ], + [ + "./c.ts", + "Js", + 4 + ], + [ + "./d.ts", + "Js", + 5 + ] + ], + "size": 1217 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +*refresh* /home/src/projects/project/c.ts +*refresh* /home/src/projects/project/d.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: With declaration enabled noEmit - Should report errors + +tsgo --noEmit --declaration +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 a.ts:1 + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ], + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "./c.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ], + [ + "./d.ts", + "Js|DtsEmit", + [ + 5, + 17 + ] + ] + ], + "size": 2084 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: With declaration and declarationMap noEmit - Should report errors + +tsgo --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 a.ts:1 + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };"],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ], + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ], + [ + "./b.ts", + "Js|DtsEmit|DtsMap", + [ + 3, + 49 + ] + ], + [ + "./c.ts", + "Js|DtsEmit|DtsMap", + [ + 4, + 49 + ] + ], + [ + "./d.ts", + "Js|DtsEmit|DtsMap", + [ + 5, + 49 + ] + ] + ], + "size": 2106 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: Dts Emit with error + +tsgo --declaration +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 a.ts:1 + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/project/a.d.ts] *new* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/home/src/projects/project/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/c.d.ts] *new* +export declare const c: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/c.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +const c = class { + p = 10; +}; +exports.c = c; + +//// [/home/src/projects/project/d.d.ts] *new* +export declare const d: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/d.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +const d = class { + p = 10; +}; +exports.d = d; + +//// [/home/src/projects/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":"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","signature":"ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]],[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]]} +//// [/home/src/projects/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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "ee8f9d3f76983159b6f8f0407d3b0dff-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ], + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "size": 3087 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/projects/project/a.ts +(stored at emit) /home/src/projects/project/b.ts +(stored at emit) /home/src/projects/project/c.ts +(stored at emit) /home/src/projects/project/d.ts + + +Edit [5]:: Fix the error +//// [/home/src/projects/project/a.ts] *modified* +export const a = class { public p = 10; }; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 2663 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: With declaration enabled noEmit + +tsgo --noEmit --declaration +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "DtsEmit", + [ + 3, + 16 + ] + ], + [ + "./c.ts", + "DtsEmit", + [ + 4, + 16 + ] + ], + [ + "./d.ts", + "DtsEmit", + [ + 5, + 16 + ] + ] + ], + "size": 2720 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: With declaration and declarationMap noEmit + +tsgo --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + + c.ts:1:14 - Add a type annotation to the variable c. + 1 export const c = class { private p = 10; }; +    ~ + +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 c.ts:1 + 1 d.ts:1 + +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };","signature":"e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[4,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable c."}]}]],[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6f729672e1964d12037938bd07604115-export const c = class { private p = 10; };", + "signature": "e2ca0ad93099a06094277675c8c60e6f-export declare const c: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable c.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable c." + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ], + [ + "./b.ts", + "DtsEmit|DtsMap", + [ + 3, + 48 + ] + ], + [ + "./c.ts", + "DtsEmit|DtsMap", + [ + 4, + 48 + ] + ], + [ + "./d.ts", + "DtsEmit|DtsMap", + [ + 5, + 48 + ] + ] + ], + "size": 2742 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [8]:: Fix the another +//// [/home/src/projects/project/c.ts] *modified* +export const c = class { public p = 10; }; + +tsgo --noEmit --declaration --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + d.ts:1:14 - Add a type annotation to the variable d. + 1 export const d = class { private p = 10; }; +    ~ + + +Found 1 error in d.ts:1 + +//// [/home/src/projects/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":"257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1},{"version":"dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };","signature":"17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };","signature":"da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.","impliedNodeFormat":1}],"options":{"declaration":true,"declarationMap":true},"emitDiagnosticsPerFile":[[5,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable d."}]}]]],"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]]} +//// [/home/src/projects/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": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "257f0ffae056266a216e22aca9e25055-export const a = class { public p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./c.ts", + "version": "dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };", + "signature": "17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dc7165893e9c62cfeea6f0fad1d8b57c-export const c = class { public p = 10; };", + "signature": "17c24c6640bff8629aa96eed43575ace-export declare const c: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./d.ts", + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "eee493071f513e65e5368e45a4d35584-export const d = class { private p = 10; };", + "signature": "da46c64a7214d458d5aad6924e4d69d3-export declare const d: {\n new (): {\n p: number;\n };\n};\n\n(13,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(13,1): error9027: Add a type annotation to the variable d.", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "emitDiagnosticsPerFile": [ + [ + "./d.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable d." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit|DtsMap", + [ + 2, + 49 + ] + ], + [ + "./b.ts", + "DtsEmit|DtsMap", + [ + 3, + 48 + ] + ], + [ + "./c.ts", + "Js|DtsEmit|DtsMap", + [ + 4, + 49 + ] + ], + [ + "./d.ts", + "DtsEmit|DtsMap", + [ + 5, + 48 + ] + ] + ], + "size": 2318 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/c.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/c.ts diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..854835b970 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,659 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":13,"end":14,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 13, + "end": 14, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ] + ], + "size": 1368 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + a.ts:1:14 - Add a type annotation to the variable a. + 1 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "./b.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ] + ], + "size": 1181 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.d.ts] *new* +export declare const a = "hello"; + +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.d.ts] *new* +export declare const b = 10; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1250 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/projects/project/b.ts + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1795 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *modified* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;","signature":"eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n","impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "eaed5dafb4668e1b7c86b65b584b776a-export declare const b = 10;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1759 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js new file mode 100644 index 0000000000..0a87ea4533 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js @@ -0,0 +1,568 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1341 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1117 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.d.ts] *new* +declare const a = "hello"; + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "size": 1081 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ] + ], + "size": 1614 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *modified* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":6,"end":7,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 6, + "end": 7, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "size": 1578 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000..ad330475c2 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,482 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = class { private p = 10; }; +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "signature": "9c1fc7106f3a21aadb5219db8b3209bc-export const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1069 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1172 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1139 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1393 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1362 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000..e75cb2871d --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,416 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1051 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1082 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1324 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };","signature":"26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "54435c7adb578d59d7e39dd2f567250e-const a = class { private p = 10; };", + "signature": "26341e8dc85f0d296deed3b6fe76a0dd-declare const a: {\n new (): {\n p: number;\n };\n};\n\n(6,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(6,1): error9027: Add a type annotation to the variable a.", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1293 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000..3fad90e79f --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-without-dts-enabled.js @@ -0,0 +1,116 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/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; }; + + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + + + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + + + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors.js b/testdata/baselines/reference/tsc/noEmit/dts-errors.js new file mode 100644 index 0000000000..c7f5c76797 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors.js @@ -0,0 +1,186 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = class { private p = 10; }; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": true + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + + + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.d.ts] *new* +declare const a = "hello"; + +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + + + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + + + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.d.ts] *modified* +declare const a: { + new (): { + p: number; + }; +}; + +//// [/home/src/projects/project/a.js] *modified* +const a = class { + p = 10; +}; + + + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + a.ts:1:7 - Add a type annotation to the variable a. + 1 const a = class { private p = 10; }; +    ~ + + +Found 1 error in a.ts:1 + + diff --git a/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..549ea01b34 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,562 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a: number = "hello" +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"", + "signature": "a49e791c9509caf97ef39f9e765d5015-export const a: number = \"hello\"", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1204 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1172 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1139 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1327 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1296 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental.js new file mode 100644 index 0000000000..d8d37eb0bb --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/semantic-errors-with-incremental.js @@ -0,0 +1,494 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a: number = "hello" +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1184 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1082 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1258 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *rewrite with same content* +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"903d9216256112700b1325b61dcb7717-const a: number = \"hello\"","signature":"a87bf21f13058d40be607df702228523-declare const a: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type 'string' is not assignable to type 'number'."}]]]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "903d9216256112700b1325b61dcb7717-const a: number = \"hello\"", + "signature": "a87bf21f13058d40be607df702228523-declare const a: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "size": 1227 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/semantic-errors.js b/testdata/baselines/reference/tsc/noEmit/semantic-errors.js new file mode 100644 index 0000000000..36fae3f3bb --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/semantic-errors.js @@ -0,0 +1,152 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a: number = "hello" +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + + + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *rewrite with same content* + + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in a.ts:1 + + diff --git a/testdata/baselines/reference/tsc/noEmit/syntax-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsc/noEmit/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..7061ddd72e --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,536 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +export const a = "hello +//// [/home/src/projects/project/b.ts] *new* +export const b = 10; +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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},"1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello","907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "signature": "1fca32c5d452470ed9d0aa38bbe62e60-export const a = \"hello", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts", + "./b.ts" + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1101 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +*not cached* /home/src/projects/project/b.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +*not cached* /home/src/projects/project/b.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"affectedFilesPendingEmit":[2,3]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1172 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +*refresh* /home/src/projects/project/b.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + +//// [/home/src/projects/project/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "270675b5bc3d695752ac89c2c3af7b2e-export const a = \"hello\";", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "size": 1139 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"changeFileSet":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "8db48ef76072c70d24f212a9f210f622-export declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "changeFileSet": [ + "./a.ts" + ], + "size": 1189 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1},"907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;"],"options":{"declaration":false},"semanticDiagnosticsPerFile":[1,2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "signature": "907abc8137ceb88f0ddd6eccfa92d573-export const b = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts" + ], + "size": 1197 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/syntax-errors-with-incremental.js new file mode 100644 index 0000000000..d972602abd --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/syntax-errors-with-incremental.js @@ -0,0 +1,463 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = "hello +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","./a.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[1,2],"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./a.ts" + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1081 +} +//// [/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; }; + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"affectedFilesPendingEmit":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js", + 2 + ] + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./a.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":"312c97b5294d8f3919933705625e91a3-const a = \"hello\";","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false}} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "312c97b5294d8f3919933705625e91a3-const a = \"hello\";", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "size": 1082 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","./a.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"changeFileSet":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "changeFileSet": [ + "./a.ts" + ], + "size": 1113 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello; + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","./a.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":"d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello","signature":"64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"declaration":false},"semanticDiagnosticsPerFile":[2]} +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./a.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": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d8a5f356bd133a6882ecbde29426bdcb-const a = \"hello", + "signature": "64868e4042512db835b5b3c3226ab323-declare const a = \"hello\";\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "declaration": false + }, + "semanticDiagnosticsPerFile": [ + "./a.ts" + ], + "size": 1126 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/projects/project/a.ts +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmit/syntax-errors.js b/testdata/baselines/reference/tsc/noEmit/syntax-errors.js new file mode 100644 index 0000000000..af0bb3bd8b --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmit/syntax-errors.js @@ -0,0 +1,154 @@ +currentDirectory::/home/src/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/projects/project/a.ts] *new* +const a = "hello +//// [/home/src/projects/project/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + } +} + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + + + +Edit [1]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [2]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [3]:: Emit after fixing error + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/projects/project/a.js] *new* +const a = "hello"; + + + + +Edit [4]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + + + +Edit [5]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + + + +Edit [6]:: Emit when error + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/projects/project/a.js] *modified* +const a = "hello; + + + + +Edit [7]:: no change + +tsgo --noEmit +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +   ~ + + +Found 1 error in a.ts:1 + + diff --git a/testdata/baselines/reference/tsc/noEmit/when-project-has-strict-true.js b/testdata/baselines/reference/tsc/noEmit/when-project-has-strict-true.js index e9e50e8693..30347c3a4c 100644 --- a/testdata/baselines/reference/tsc/noEmit/when-project-has-strict-true.js +++ b/testdata/baselines/reference/tsc/noEmit/when-project-has-strict-true.js @@ -38,10 +38,18 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.d.ts","./class1.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},"ee12676c27db5c4cb0594b79ca02cbb0-export class class1 {}"],"options":{"strict":true},"affectedFilesPendingEmit":[2]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./class1.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},"ee12676c27db5c4cb0594b79ca02cbb0-export class class1 {}"],"options":{"strict":true},"affectedFilesPendingEmit":[2]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./class1.ts" + ], + "original": 2 + } + ], "fileNames": [ "lib.d.ts", "./class1.ts" @@ -76,7 +84,7 @@ declare const console: { log(msg: any): void; }; 2 ] ], - "size": 965 + "size": 976 } tsconfig.json:: @@ -84,3 +92,14 @@ SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts *refresh* /home/src/workspaces/project/class1.ts Signatures:: + + +Edit [0]:: no change + +tsgo --noEmit +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000..d2ce772b4f --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,366 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"pos":53,"end":54,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":53,"end":54,"code":9027,"category":1,"message":"Add a type annotation to the variable a."}]}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 53, + "end": 54, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 53, + "end": 54, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable a." + } + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js|DtsEmit", + [ + 2, + 17 + ] + ], + [ + "../src/main.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ], + [ + "../src/other.ts", + "Js|DtsEmit", + [ + 4, + 17 + ] + ] + ], + "size": 1628 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1656 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js new file mode 100644 index 0000000000..be55cad377 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js @@ -0,0 +1,140 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + src/main.ts:2:14 - Add a type annotation to the variable a. + 2 export const a = class { private p = 10; }; +    ~ + + +Found 1 error in src/main.ts:2 + + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-incremental.js new file mode 100644 index 0000000000..2a7fd5a479 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-incremental.js @@ -0,0 +1,265 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1289 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };","signature":"1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7cd05f722edaaaf0c0efca32b04362e8-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };", + "signature": "1aa32af20adf1f5d970642bd31541eeb-export declare const a: {\n new (): {\n p: number;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1437 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/dts-errors.js b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors.js new file mode 100644 index 0000000000..4c1b51f4f2 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/dts-errors.js @@ -0,0 +1,104 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: Success +Output:: +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +const a = class { + p = 10; +}; +exports.a = a; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Edit [0]:: no change + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noEmitOnError/file-deleted-before-fixing-error-with-noEmitOnError.js b/testdata/baselines/reference/tsc/noEmitOnError/file-deleted-before-fixing-error-with-noEmitOnError.js new file mode 100644 index 0000000000..68b5044997 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/file-deleted-before-fixing-error-with-noEmitOnError.js @@ -0,0 +1,220 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/file1.ts] *new* +export const x: 30 = "hello"; +//// [/home/src/workspaces/project/file2.ts] *new* +export class D { } +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "outDir", + "noEmitOnError": true, + }, +} + +tsgo -i +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +file1.ts:1:14 - error TS2322: Type '"hello"' is not assignable to type '30'. + +1 export const x: 30 = "hello"; +   ~ + + +Found 1 error in file1.ts:1 + +//// [/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/outDir/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../file1.ts","../file2.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},"15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";","f7d221ab360f516a6280e3b725f4cd31-export class D { }"],"options":{"noEmitOnError":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type '\"hello\"' is not assignable to type '30'."}]]],"affectedFilesPendingEmit":[2,3]} +//// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../file1.ts", + "../file2.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../file1.ts", + "../file2.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": "../file1.ts", + "version": "15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";", + "signature": "15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../file2.ts", + "version": "f7d221ab360f516a6280e3b725f4cd31-export class D { }", + "signature": "f7d221ab360f516a6280e3b725f4cd31-export class D { }", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "semanticDiagnosticsPerFile": [ + [ + "../file1.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type '\"hello\"' is not assignable to type '30'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../file1.ts", + "Js", + 2 + ], + [ + "../file2.ts", + "Js", + 3 + ] + ], + "size": 1223 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/file1.ts +*refresh* /home/src/workspaces/project/file2.ts +Signatures:: + + +Edit [0]:: delete file without error +//// [/home/src/workspaces/project/file2.ts] *deleted* + +tsgo -i +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +file1.ts:1:14 - error TS2322: Type '"hello"' is not assignable to type '30'. + +1 export const x: 30 = "hello"; +   ~ + + +Found 1 error in file1.ts:1 + +//// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../file1.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},"15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";"],"options":{"noEmitOnError":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":13,"end":14,"code":2322,"category":1,"message":"Type '\"hello\"' is not assignable to type '30'."}]]],"affectedFilesPendingEmit":[2]} +//// [/home/src/workspaces/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../file1.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../file1.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": "../file1.ts", + "version": "15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";", + "signature": "15ec141484c003c242081ba307fd0794-export const x: 30 = \"hello\";", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "semanticDiagnosticsPerFile": [ + [ + "../file1.ts", + [ + { + "pos": 13, + "end": 14, + "code": 2322, + "category": 1, + "message": "Type '\"hello\"' is not assignable to type '30'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../file1.ts", + "Js", + 2 + ] + ], + "size": 1149 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000..19e0e565e2 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration-with-incremental.js @@ -0,0 +1,330 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 46, + "end": 47, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js|Dts", + 2 + ], + [ + "../src/main.ts", + "Js|Dts", + 3 + ], + [ + "../src/other.ts", + "Js|Dts", + 4 + ] + ], + "size": 1445 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1587 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration.js b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration.js new file mode 100644 index 0000000000..0c81e93b84 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-declaration.js @@ -0,0 +1,124 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-incremental.js new file mode 100644 index 0000000000..6720293a58 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors-with-incremental.js @@ -0,0 +1,307 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 46, + "end": 47, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js", + 2 + ], + [ + "../src/main.ts", + "Js", + 3 + ], + [ + "../src/other.ts", + "Js", + 4 + ] + ], + "size": 1446 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "53d07f7c18bc0a70f0fe62e902ac491d-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1368 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors.js b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors.js new file mode 100644 index 0000000000..7e8a424be9 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/semantic-errors.js @@ -0,0 +1,110 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a: string = 10; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error in src/main.ts:2 + + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-declaration-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000..deb1013ad3 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-declaration-with-incremental.js @@ -0,0 +1,336 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "signature": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js|Dts", + 2 + ], + [ + "../src/main.ts", + "Js|Dts", + 3 + ], + [ + "../src/other.ts", + "Js|Dts", + 4 + ] + ], + "size": 1369 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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":"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","signature":"54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n","impliedNodeFormat":1},{"version":"7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "54943827690173f946e7a76cd9b9eb27-export interface A {\n name: string;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/main.ts", + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1596 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: +(stored at emit) /user/username/projects/noEmitOnError/shared/types/db.ts +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-declaration.js b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-declaration.js new file mode 100644 index 0000000000..9a6fa3efa3 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-declaration.js @@ -0,0 +1,130 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *new* +export {}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-incremental.js new file mode 100644 index 0000000000..99ef2044b1 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors-with-incremental.js @@ -0,0 +1,313 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": true, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}","6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;","ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"affectedFilesPendingEmit":[2,3,4]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "signature": "6ac30e235b3496214b9c209edec4d109-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "affectedFilesPendingEmit": [ + [ + "../shared/types/db.ts", + "Js", + 2 + ], + [ + "../src/main.ts", + "Js", + 3 + ], + [ + "../src/other.ts", + "Js", + 4 + ] + ], + "size": 1370 +} + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + + +tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/noEmitOnError/shared/types/db.ts +*not cached* /user/username/projects/noEmitOnError/src/main.ts +*not cached* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.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},"4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}",{"version":"7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }"],"fileIdsList":[[2]],"options":{"declaration":false,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]]} +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.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": "../shared/types/db.ts", + "version": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "signature": "4dba75627964632af83642176cf4b611-export interface A {\n name: string;\n}", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../src/main.ts", + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7b22ad4790ccb4d687e7d84c4e640776-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/other.ts", + "version": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "signature": "ac4084c9455da7165ada8cb39f592843-console.log(\"hi\");\nexport { }", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "options": { + "declaration": false, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "size": 1377 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/noEmitOnError/shared/types/db.ts +*refresh* /user/username/projects/noEmitOnError/src/main.ts +*refresh* /user/username/projects/noEmitOnError/src/other.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors.js b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors.js new file mode 100644 index 0000000000..179d830561 --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/syntax-errors.js @@ -0,0 +1,116 @@ +currentDirectory::/user/username/projects/noEmitOnError +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] *new* +export interface A { + name: string; +} +//// [/user/username/projects/noEmitOnError/src/main.ts] *new* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; +//// [/user/username/projects/noEmitOnError/src/other.ts] *new* +console.log("hi"); +export { } +//// [/user/username/projects/noEmitOnError/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": false, + "incremental": false, + "noEmitOnError": true, + }, +} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + +//// [/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; }; + + + +Edit [0]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + +Found 1 error in src/main.ts:4 + + + + +Edit [1]:: Fix error +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Edit [2]:: no change + +tsgo +ExitStatus:: Success +Output:: +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *rewrite with same content* + diff --git a/testdata/baselines/reference/tsc/noEmitOnError/when-declarationMap-changes.js b/testdata/baselines/reference/tsc/noEmitOnError/when-declarationMap-changes.js new file mode 100644 index 0000000000..28ab717dad --- /dev/null +++ b/testdata/baselines/reference/tsc/noEmitOnError/when-declarationMap-changes.js @@ -0,0 +1,376 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a.ts] *new* +const x = 10; +//// [/home/src/workspaces/project/b.ts] *new* +const y = 10; +//// [/home/src/workspaces/project/tsconfig.json] *new* +{ + "compilerOptions": { + "noEmitOnError": true, + "declaration": true, + "composite": true, + }, +} + +tsgo +ExitStatus:: Success +Output:: +//// [/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* +declare const x = 10; + +//// [/home/src/workspaces/project/a.js] *new* +const x = 10; + +//// [/home/src/workspaces/project/b.d.ts] *new* +declare const y = 10; + +//// [/home/src/workspaces/project/b.js] *new* +const y = 10; + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"4447ab8c90027f28bdaff9f2056779ce-const x = 10;","signature":"4be7af7f970696121f4f582a5d074177-declare const x = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4448aee3ffd6eaf52054c6f2413c128a-const y = 10;","signature":"b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"noEmitOnError":true},"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "4448aee3ffd6eaf52054c6f2413c128a-const y = 10;", + "signature": "b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4448aee3ffd6eaf52054c6f2413c128a-const y = 10;", + "signature": "b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "noEmitOnError": true + }, + "latestChangedDtsFile": "./b.d.ts", + "size": 1332 +} + +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 +Signatures:: +(stored at emit) /home/src/workspaces/project/a.ts +(stored at emit) /home/src/workspaces/project/b.ts + + +Edit [0]:: error and enable declarationMap +//// [/home/src/workspaces/project/a.ts] *modified* +const x: 20 = 10; + +tsgo --declarationMap +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +a.ts:1:7 - error TS2322: Type '10' is not assignable to type '20'. + +1 const x: 20 = 10; +   ~ + + +Found 1 error in a.ts:1 + +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"6792320cbdee0286d2b3e83ff1d9fcc1-const x: 20 = 10;","signature":"c4dd771ef0ee0838482d28bc7dea6269-declare const x: 20;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4448aee3ffd6eaf52054c6f2413c128a-const y = 10;","signature":"b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"noEmitOnError":true},"semanticDiagnosticsPerFile":[[2,[{"pos":6,"end":7,"code":2322,"category":1,"message":"Type '10' is not assignable to type '20'."}]]],"affectedFilesPendingEmit":[2,[3,48]],"latestChangedDtsFile":"./b.d.ts","emitSignatures":[[2,["4be7af7f970696121f4f582a5d074177-declare const x = 10;\n"]],[3,[]]]} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "6792320cbdee0286d2b3e83ff1d9fcc1-const x: 20 = 10;", + "signature": "c4dd771ef0ee0838482d28bc7dea6269-declare const x: 20;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6792320cbdee0286d2b3e83ff1d9fcc1-const x: 20 = 10;", + "signature": "c4dd771ef0ee0838482d28bc7dea6269-declare const x: 20;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "4448aee3ffd6eaf52054c6f2413c128a-const y = 10;", + "signature": "b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4448aee3ffd6eaf52054c6f2413c128a-const y = 10;", + "signature": "b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "noEmitOnError": true + }, + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "pos": 6, + "end": 7, + "code": 2322, + "category": 1, + "message": "Type '10' is not assignable to type '20'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js|Dts|DtsMap", + 2 + ], + [ + "./b.ts", + "DtsEmit|DtsMap", + [ + 3, + 48 + ] + ] + ], + "latestChangedDtsFile": "./b.d.ts", + "emitSignatures": [ + { + "file": "./a.ts", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "differsInOptions": true, + "original": [ + 2, + [ + "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n" + ] + ] + }, + { + "file": "./b.ts", + "differsOnlyInDtsMap": true, + "original": [ + 3, + [] + ] + } + ], + "size": 1620 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts + + +Edit [1]:: fix error declarationMap +//// [/home/src/workspaces/project/a.ts] *modified* +const x = 10; + +tsgo --declarationMap +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a.d.ts] *modified* +declare const x = 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,QAAA,MAAM,CAAC,KAAK,CAAC"} +//// [/home/src/workspaces/project/a.js] *rewrite with same content* +//// [/home/src/workspaces/project/b.d.ts] *modified* +declare const y = 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,QAAA,MAAM,CAAC,KAAK,CAAC"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.ts","./b.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":"4447ab8c90027f28bdaff9f2056779ce-const x = 10;","signature":"4be7af7f970696121f4f582a5d074177-declare const x = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4448aee3ffd6eaf52054c6f2413c128a-const y = 10;","signature":"b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"noEmitOnError":true},"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.ts", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.ts", + "./b.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": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4447ab8c90027f28bdaff9f2056779ce-const x = 10;", + "signature": "4be7af7f970696121f4f582a5d074177-declare const x = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./b.ts", + "version": "4448aee3ffd6eaf52054c6f2413c128a-const y = 10;", + "signature": "b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4448aee3ffd6eaf52054c6f2413c128a-const y = 10;", + "signature": "b0061f8cf6b7f4ef02673fae62fc90dd-declare const y = 10;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "noEmitOnError": true + }, + "latestChangedDtsFile": "./b.d.ts", + "size": 1354 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/a.ts +Signatures:: +(computed .d.ts) /home/src/workspaces/project/a.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/default-setup-was-created-correctly.js b/testdata/baselines/reference/tsc/projectReferences/default-setup-was-created-correctly.js new file mode 100644 index 0000000000..bd3ffd157f --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/default-setup-was-created-correctly.js @@ -0,0 +1,114 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/primary/a.ts] *new* +export { }; +//// [/home/src/workspaces/project/primary/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + } +} +//// [/home/src/workspaces/project/secondary/b.ts] *new* +import * as mod_1 from "../primary/a"; +//// [/home/src/workspaces/project/secondary/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [{ + "path": "../primary" + }] +} + +tsgo --p primary/tsconfig.json +ExitStatus:: Success +Output:: +//// [/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/primary/bin/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/primary/bin/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../a.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":"3145b36c4687eb0550eabb198d0c0d22-export { };","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../a.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": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./a.d.ts", + "size": 1075 +} + +primary/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/primary/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/primary/a.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/does-not-error-when-the-referenced-project-doesnt-have-composite-if-its-a-container-project.js b/testdata/baselines/reference/tsc/projectReferences/does-not-error-when-the-referenced-project-doesnt-have-composite-if-its-a-container-project.js new file mode 100644 index 0000000000..39592769fa --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/does-not-error-when-the-referenced-project-doesnt-have-composite-if-its-a-container-project.js @@ -0,0 +1,45 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/primary/a.ts] *new* +export { }; +//// [/home/src/workspaces/project/primary/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": false, + "outDir": "bin", + } +} +//// [/home/src/workspaces/project/reference/b.ts] *new* +import * as mod_1 from "../primary/a"; +//// [/home/src/workspaces/project/reference/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "files": [ ], + "references": [{ + "path": "../primary" + }] +} + +tsgo --p reference/tsconfig.json +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/reference/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","fileInfos":[],"options":{"composite":true,"outDir":"./"}} +//// [/home/src/workspaces/project/reference/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "fileInfos": [], + "options": { + "composite": true, + "outDir": "./" + }, + "size": 85 +} + +reference/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsc/projectReferences/doesnt-infer-the-rootDir-from-source-paths.js b/testdata/baselines/reference/tsc/projectReferences/doesnt-infer-the-rootDir-from-source-paths.js new file mode 100644 index 0000000000..2f3df08970 --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/doesnt-infer-the-rootDir-from-source-paths.js @@ -0,0 +1,105 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/alpha/src/a.ts] *new* +export const m: number = 3; +//// [/home/src/workspaces/project/alpha/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [] +} + +tsgo --p alpha/tsconfig.json +ExitStatus:: Success +Output:: +//// [/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/alpha/bin/src/a.d.ts] *new* +export declare const m: number; + +//// [/home/src/workspaces/project/alpha/bin/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.m = 3; + +//// [/home/src/workspaces/project/alpha/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../src/a.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":"2b6cc65e84778a8f25c0bc94021b2656-export const m: number = 3;","signature":"b9eb93bd7f963b3a9524dc6c507eb73b-export declare const m: number;\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"latestChangedDtsFile":"./src/a.d.ts"} +//// [/home/src/workspaces/project/alpha/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../src/a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../src/a.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": "../src/a.ts", + "version": "2b6cc65e84778a8f25c0bc94021b2656-export const m: number = 3;", + "signature": "b9eb93bd7f963b3a9524dc6c507eb73b-export declare const m: number;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "2b6cc65e84778a8f25c0bc94021b2656-export const m: number = 3;", + "signature": "b9eb93bd7f963b3a9524dc6c507eb73b-export declare const m: number;\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "latestChangedDtsFile": "./src/a.d.ts", + "size": 1120 +} + +alpha/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/alpha/src/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/alpha/src/a.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/errors-when-a-file-is-outside-the-rootdir.js b/testdata/baselines/reference/tsc/projectReferences/errors-when-a-file-is-outside-the-rootdir.js new file mode 100644 index 0000000000..743a49b105 --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/errors-when-a-file-is-outside-the-rootdir.js @@ -0,0 +1,150 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/alpha/src/a.ts] *new* +import * as b from '../../beta/b' +//// [/home/src/workspaces/project/alpha/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [] +} +//// [/home/src/workspaces/project/beta/b.ts] *new* +export { } + +tsgo --p alpha/tsconfig.json +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +alpha/src/a.ts:1:20 - error TS6307: File '/home/src/workspaces/project/beta/b.ts' is not listed within the file list of project '/home/src/workspaces/project/alpha/tsconfig.json'. Projects must list all files or use an 'include' pattern. + +1 import * as b from '../../beta/b' +   ~~~~~~~~~~~~~~ + + +Found 1 error in alpha/src/a.ts:1 + +//// [/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/alpha/bin/src/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/alpha/bin/src/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/alpha/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[3],"fileNames":["lib.d.ts","../../beta/b.ts","../src/a.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":"c7aa180f19a42166d3166e266d7e59ec-export { }","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"48cb0b944bf6ab58a2c0fa2f1d92b81b-import * as b from '../../beta/b'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./src/a.d.ts"} +//// [/home/src/workspaces/project/alpha/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../src/a.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../../beta/b.ts", + "../src/a.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": "../../beta/b.ts", + "version": "c7aa180f19a42166d3166e266d7e59ec-export { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c7aa180f19a42166d3166e266d7e59ec-export { }", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../src/a.ts", + "version": "48cb0b944bf6ab58a2c0fa2f1d92b81b-import * as b from '../../beta/b'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "48cb0b944bf6ab58a2c0fa2f1d92b81b-import * as b from '../../beta/b'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../beta/b.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../src/a.ts": [ + "../../beta/b.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../../beta/b.ts", + "../src/a.ts" + ], + "latestChangedDtsFile": "./src/a.d.ts", + "size": 1358 +} +//// [/home/src/workspaces/project/beta/b.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/beta/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +alpha/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/beta/b.ts +*not cached* /home/src/workspaces/project/alpha/src/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/beta/b.ts +(stored at emit) /home/src/workspaces/project/alpha/src/a.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/errors-when-declaration-=-false.js b/testdata/baselines/reference/tsc/projectReferences/errors-when-declaration-=-false.js new file mode 100644 index 0000000000..e69a8f2e94 --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/errors-when-declaration-=-false.js @@ -0,0 +1,117 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/primary/a.ts] *new* +export { }; +//// [/home/src/workspaces/project/primary/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + "declaration": false + } +} + +tsgo --p primary/tsconfig.json +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +primary/tsconfig.json:5:9 - error TS6304: Composite projects may not disable declaration emit. + +5 "declaration": false +   ~~~~~~~~~~~~~ + + +Found 1 error in primary/tsconfig.json:5 + +//// [/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/primary/bin/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/primary/bin/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","../a.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":"3145b36c4687eb0550eabb198d0c0d22-export { };","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"declaration":false,"outDir":"./"},"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../a.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": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "declaration": false, + "outDir": "./" + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../a.ts" + ], + "latestChangedDtsFile": "./a.d.ts", + "size": 1144 +} + +primary/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/primary/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/primary/a.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/errors-when-the-file-list-is-not-exhaustive.js b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-file-list-is-not-exhaustive.js new file mode 100644 index 0000000000..afc11f193e --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-file-list-is-not-exhaustive.js @@ -0,0 +1,150 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/primary/a.ts] *new* +import * as b from './b' +//// [/home/src/workspaces/project/primary/b.ts] *new* +export {} +//// [/home/src/workspaces/project/primary/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "files": [ "a.ts" ] +} + +tsgo --p primary/tsconfig.json +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +primary/a.ts:1:20 - error TS6307: File '/home/src/workspaces/project/primary/b.ts' is not listed within the file list of project '/home/src/workspaces/project/primary/tsconfig.json'. Projects must list all files or use an 'include' pattern. + +1 import * as b from './b' +   ~~~~~ + + +Found 1 error in primary/a.ts:1 + +//// [/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/primary/bin/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/primary/bin/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/primary/bin/b.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/primary/bin/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[3],"fileNames":["lib.d.ts","../b.ts","../a.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":"90c7c4de561fe02d475f60b509bcbb33-export {}","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},{"version":"a18553e6686c657dd18ba74b9d5c69ef-import * as b from './b'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../a.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../b.ts", + "../a.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": "../b.ts", + "version": "90c7c4de561fe02d475f60b509bcbb33-export {}", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "90c7c4de561fe02d475f60b509bcbb33-export {}", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../a.ts", + "version": "a18553e6686c657dd18ba74b9d5c69ef-import * as b from './b'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "a18553e6686c657dd18ba74b9d5c69ef-import * as b from './b'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../b.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../a.ts": [ + "../b.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../b.ts", + "../a.ts" + ], + "latestChangedDtsFile": "./a.d.ts", + "size": 1332 +} + +primary/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/primary/b.ts +*not cached* /home/src/workspaces/project/primary/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/primary/b.ts +(stored at emit) /home/src/workspaces/project/primary/a.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-exist.js b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-exist.js new file mode 100644 index 0000000000..5cb1be4b61 --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-exist.js @@ -0,0 +1,122 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/primary/a.ts] *new* +export { }; +//// [/home/src/workspaces/project/primary/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [{ + "path": "../foo" + }] +} + +tsgo --p primary/tsconfig.json +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +primary/tsconfig.json:6:20 - error TS6053: File '/home/src/workspaces/project/foo' not found. + +6 "references": [{ +   ~ +7 "path": "../foo" +  ~~~~~~~~~~~~~~~~~~~~~~~~ +8 }] +  ~~~~~ + + +Found 1 error in primary/tsconfig.json:6 + +//// [/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/primary/bin/a.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/primary/bin/a.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","../a.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":"3145b36c4687eb0550eabb198d0c0d22-export { };","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./a.d.ts"} +//// [/home/src/workspaces/project/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../a.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../a.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": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../a.ts" + ], + "latestChangedDtsFile": "./a.d.ts", + "size": 1124 +} + +primary/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/primary/a.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/primary/a.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js new file mode 100644 index 0000000000..afa623062e --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js @@ -0,0 +1,126 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/primary/a.ts] *new* +export { }; +//// [/home/src/workspaces/project/primary/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": false, + "outDir": "bin", + } +} +//// [/home/src/workspaces/project/reference/b.ts] *new* +import * as mod_1 from "../primary/a"; +//// [/home/src/workspaces/project/reference/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "files": [ "b.ts" ], + "references": [ { "path": "../primary" } ] +} + +tsgo --p reference/tsconfig.json +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +reference/tsconfig.json:7:21 - error TS6306: Referenced project '/home/src/workspaces/project/primary' must have setting "composite": true. + +7 "references": [ { "path": "../primary" } ] +   ~~~~~~~~~~~~~~~~~~~~~~~~ + + +Found 1 error in reference/tsconfig.json:7 + +//// [/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/reference/bin/b.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/reference/bin/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/reference/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","../b.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":"d666db15c62586dc1d15295600f7d94a-import * as mod_1 from \"../primary/a\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/project/reference/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "../b.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../b.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": "../b.ts", + "version": "d666db15c62586dc1d15295600f7d94a-import * as mod_1 from \"../primary/a\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d666db15c62586dc1d15295600f7d94a-import * as mod_1 from \"../primary/a\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../b.ts" + ], + "latestChangedDtsFile": "./b.d.ts", + "size": 1153 +} + +reference/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/reference/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/reference/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js new file mode 100644 index 0000000000..8175413de0 --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js @@ -0,0 +1,137 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/alpha/a.ts] *new* +export const m: number = 3; +//// [/home/src/workspaces/project/alpha/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + } +} +//// [/home/src/workspaces/project/beta/b.ts] *new* +import { m } from '@alpha/a' +//// [/home/src/workspaces/project/beta/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + "paths": { + "@alpha/*": ["../alpha/*"], + }, + }, + "references": [ { "path": "../alpha" } ] +} + +tsgo --p beta/tsconfig.json +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +beta/b.ts:1:19 - error TS6305: Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'. + +1 import { m } from '@alpha/a' +   ~~~~~~~~~~ + + +Found 1 error in beta/b.ts:1 + +//// [/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/beta/bin/b.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/beta/bin/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.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":"311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":28,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../b.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": "../b.ts", + "version": "311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "semanticDiagnosticsPerFile": [ + [ + "../b.ts", + [ + { + "pos": 18, + "end": 28, + "code": 6305, + "category": 1, + "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." + } + ] + ] + ], + "latestChangedDtsFile": "./b.d.ts", + "size": 1325 +} + +beta/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/beta/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/beta/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js new file mode 100644 index 0000000000..be88f86fa1 --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js @@ -0,0 +1,135 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/alpha/a.ts] *new* +export const m: number = 3; +//// [/home/src/workspaces/project/alpha/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [] +} +//// [/home/src/workspaces/project/beta/b.ts] *new* +import { m } from '../alpha/a' +//// [/home/src/workspaces/project/beta/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [ { "path": "../alpha" } ] +} + +tsgo --p beta/tsconfig.json +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +beta/b.ts:1:19 - error TS6305: Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'. + +1 import { m } from '../alpha/a' +   ~~~~~~~~~~~~ + + +Found 1 error in beta/b.ts:1 + +//// [/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/beta/bin/b.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/beta/bin/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.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":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":30,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "../b.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": "../b.ts", + "version": "fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "outDir": "./" + }, + "semanticDiagnosticsPerFile": [ + [ + "../b.ts", + [ + { + "pos": 18, + "end": 30, + "code": 6305, + "category": 1, + "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." + } + ] + ] + ], + "latestChangedDtsFile": "./b.d.ts", + "size": 1327 +} + +beta/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/beta/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/beta/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js b/testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js new file mode 100644 index 0000000000..fad1de3193 --- /dev/null +++ b/testdata/baselines/reference/tsc/projectReferences/redirects-to-the-output-dts-file.js @@ -0,0 +1,161 @@ +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/alpha/a.ts] *new* +export const m: number = 3; +//// [/home/src/workspaces/project/alpha/bin/a.d.ts] *new* +export { }; +//// [/home/src/workspaces/project/alpha/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + } +} +//// [/home/src/workspaces/project/beta/b.ts] *new* +import { m } from '../alpha/a' +//// [/home/src/workspaces/project/beta/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + }, + "references": [ { "path": "../alpha" } ] +} + +tsgo --p beta/tsconfig.json --explainFiles +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +beta/b.ts:1:10 - error TS2305: Module '"../alpha/bin/a"' has no exported member 'm'. + +1 import { m } from '../alpha/a' +   ~ + +../../tslibs/TS/Lib/lib.d.ts + Default library for target 'ES5' +alpha/bin/a.d.ts + Imported via '../alpha/a' from file 'beta/b.ts' + File is output of project reference source 'alpha/a.ts' +beta/b.ts + Matched by default include pattern '**/*' + +Found 1 error in beta/b.ts:1 + +//// [/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/beta/bin/b.d.ts] *new* +export {}; + +//// [/home/src/workspaces/project/beta/bin/b.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","../../alpha/bin/a.d.ts","../b.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},"3145b36c4687eb0550eabb198d0c0d22-export { };",{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"semanticDiagnosticsPerFile":[[3,[{"pos":9,"end":10,"code":2305,"category":1,"message":"Module '\"../alpha/bin/a\"' has no exported member 'm'."}]]],"latestChangedDtsFile":"./b.d.ts"} +//// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "../../alpha/bin/a.d.ts", + "../b.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": "../../alpha/bin/a.d.ts", + "version": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "signature": "3145b36c4687eb0550eabb198d0c0d22-export { };", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../b.ts", + "version": "fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../alpha/bin/a.d.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../b.ts": [ + "../../alpha/bin/a.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../b.ts", + [ + { + "pos": 9, + "end": 10, + "code": 2305, + "category": 1, + "message": "Module '\"../alpha/bin/a\"' has no exported member 'm'." + } + ] + ] + ], + "latestChangedDtsFile": "./b.d.ts", + "size": 1359 +} + +beta/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/alpha/bin/a.d.ts +*refresh* /home/src/workspaces/project/beta/b.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/beta/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences2.js b/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences2.js index fec014724b..8b6cb9c9d9 100644 --- a/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences2.js +++ b/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences2.js @@ -65,10 +65,18 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/solution/dist/services/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.esnext.full.d.ts","../compiler/parser.d.ts","../../src/services/services.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},"e7d000b03d217d92080c065ffa5ccd5e-export {};",{"version":"a59ae1ffa1209f5747a43f6a4028f563-import {} from \"../compiler/parser.ts\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"module":199,"outDir":"..","rewriteRelativeImportExtensions":true,"rootDir":"../../src"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./services.d.ts"} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","../compiler/parser.d.ts","../../src/services/services.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},"e7d000b03d217d92080c065ffa5ccd5e-export {};",{"version":"a59ae1ffa1209f5747a43f6a4028f563-import {} from \"../compiler/parser.ts\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"module":199,"outDir":"..","rewriteRelativeImportExtensions":true,"rootDir":"../../src"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./services.d.ts"} //// [/home/src/workspaces/solution/dist/services/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/services/services.ts" + ], + "original": 3 + } + ], "fileNames": [ "lib.esnext.full.d.ts", "../compiler/parser.d.ts", @@ -123,7 +131,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] }, "latestChangedDtsFile": "./services.d.ts", - "size": 1326 + "size": 1337 } src/services/tsconfig.json:: diff --git a/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences3.js b/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences3.js index 8297da6f3f..c102021778 100644 --- a/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences3.js +++ b/testdata/baselines/reference/tsc/projectReferences/rewriteRelativeImportExtensionsProjectReferences3.js @@ -69,10 +69,18 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/solution/dist/services/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","fileNames":["lib.esnext.full.d.ts","../compiler/parser.d.ts","../../src/services/services.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},"e7d000b03d217d92080c065ffa5ccd5e-export {};",{"version":"a59ae1ffa1209f5747a43f6a4028f563-import {} from \"../compiler/parser.ts\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"module":199,"outDir":"./","rewriteRelativeImportExtensions":true,"rootDir":"../../src/services"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./services.d.ts"} +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","../compiler/parser.d.ts","../../src/services/services.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},"e7d000b03d217d92080c065ffa5ccd5e-export {};",{"version":"a59ae1ffa1209f5747a43f6a4028f563-import {} from \"../compiler/parser.ts\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"module":199,"outDir":"./","rewriteRelativeImportExtensions":true,"rootDir":"../../src/services"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./services.d.ts"} //// [/home/src/workspaces/solution/dist/services/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/services/services.ts" + ], + "original": 3 + } + ], "fileNames": [ "lib.esnext.full.d.ts", "../compiler/parser.d.ts", @@ -127,7 +135,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ] }, "latestChangedDtsFile": "./services.d.ts", - "size": 1335 + "size": 1346 } src/services/tsconfig.json:: diff --git a/testdata/baselines/reference/tscWatch/commandLine/Parse-watch-interval-option-without-tsconfig.json.js b/testdata/baselines/reference/tscWatch/commandLine/Parse-watch-interval-option-without-tsconfig.json.js index 25c01cba5c..164937402c 100644 --- a/testdata/baselines/reference/tscWatch/commandLine/Parse-watch-interval-option-without-tsconfig.json.js +++ b/testdata/baselines/reference/tscWatch/commandLine/Parse-watch-interval-option-without-tsconfig.json.js @@ -34,6 +34,12 @@ tsc: The TypeScript Compiler - Version FakeTSVersion COMMAND LINE FLAGS +--help, -h +Print this message. + +--watch, -w +Watch input files. + --all Show all compiler options. @@ -49,17 +55,41 @@ Compile the project given the path to its configuration file, or to a folder wit --showConfig Print the final configuration instead of building. ---help, -h -Print this message. - ---watch, -w -Watch input files. - --build, -b Build one or more projects and their dependencies, if out of date COMMON COMPILER OPTIONS +--pretty +Enable color and formatting in TypeScript's output to make compiler errors easier to read. +type: boolean +default: true + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--noEmit +Disable emitting files from a compilation. +type: boolean +default: false + --target, -t Set the JavaScript language version for emitted JavaScript and include compatible library declarations. one of: es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, es2024, esnext @@ -114,36 +144,6 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This type: boolean default: false ---pretty -Enable color and formatting in TypeScript's output to make compiler errors easier to read. -type: boolean -default: true - ---declaration, -d -Generate .d.ts files from TypeScript and JavaScript files in your project. -type: boolean -default: `false`, unless `composite` is set - ---declarationMap -Create sourcemaps for d.ts files. -type: boolean -default: false - ---emitDeclarationOnly -Only output d.ts files and not JavaScript files. -type: boolean -default: false - ---sourceMap -Create source map files for emitted JavaScript files. -type: boolean -default: false - ---noEmit -Disable emitting files from a compilation. -type: boolean -default: false - You can learn about all of the compiler options at https://aka.ms/tsc diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --force together is invalid.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --force together is invalid.js new file mode 100644 index 0000000000..7d355cde48 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --force together is invalid.js @@ -0,0 +1,14 @@ +Args:: +["--clean", "--force"] + +buildOptions:: +{"force":true,"clean":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: +error TS6370: Options 'clean' and 'force' cannot be combined. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --verbose together is invalid.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --verbose together is invalid.js new file mode 100644 index 0000000000..b7ad4b6258 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --verbose together is invalid.js @@ -0,0 +1,14 @@ +Args:: +["--clean", "--verbose"] + +buildOptions:: +{"verbose":true,"clean":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: +error TS6370: Options 'clean' and 'verbose' cannot be combined. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --watch together is invalid.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --watch together is invalid.js new file mode 100644 index 0000000000..6348863d00 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--clean and --watch together is invalid.js @@ -0,0 +1,14 @@ +Args:: +["--clean", "--watch"] + +buildOptions:: +{"clean":true} + +compilerOptions:: +{"watch":true} + +Projects:: +. + +Errors:: +error TS6370: Options 'clean' and 'watch' cannot be combined. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--watch and --dry together is invalid.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--watch and --dry together is invalid.js new file mode 100644 index 0000000000..97f34ee75c --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/--watch and --dry together is invalid.js @@ -0,0 +1,14 @@ +Args:: +["--watch", "--dry"] + +buildOptions:: +{"dry":true} + +compilerOptions:: +{"watch":true} + +Projects:: +. + +Errors:: +error TS6370: Options 'watch' and 'dry' cannot be combined. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects at the end.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects at the end.js new file mode 100644 index 0000000000..558bf868bb --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects at the end.js @@ -0,0 +1,13 @@ +Args:: +["--force", "--verbose", "src", "tests"] + +buildOptions:: +{"force":true,"verbose":true} + +compilerOptions:: +{} + +Projects:: +src,tests + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects in the beginning.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects in the beginning.js new file mode 100644 index 0000000000..b602d36479 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects in the beginning.js @@ -0,0 +1,13 @@ +Args:: +["src", "tests", "--force", "--verbose"] + +buildOptions:: +{"force":true,"verbose":true} + +compilerOptions:: +{} + +Projects:: +src,tests + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects in the middle.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects in the middle.js new file mode 100644 index 0000000000..a96144e78d --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple flags with input projects in the middle.js @@ -0,0 +1,13 @@ +Args:: +["--force", "src", "tests", "--verbose"] + +buildOptions:: +{"force":true,"verbose":true} + +compilerOptions:: +{} + +Projects:: +src,tests + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple options.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple options.js new file mode 100644 index 0000000000..f8b7bbb3d1 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse multiple options.js @@ -0,0 +1,13 @@ +Args:: +["--verbose", "--force", "tests"] + +buildOptions:: +{"force":true,"verbose":true} + +compilerOptions:: +{} + +Projects:: +tests + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse option with invalid option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse option with invalid option.js new file mode 100644 index 0000000000..cdf571ece3 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/Parse option with invalid option.js @@ -0,0 +1,14 @@ +Args:: +["--verbose", "--invalidOption"] + +buildOptions:: +{"verbose":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: +error TS5072: Unknown build option '--invalidOption'. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on invalid excludeDirectories.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on invalid excludeDirectories.js new file mode 100644 index 0000000000..11566c7498 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on invalid excludeDirectories.js @@ -0,0 +1,14 @@ +Args:: +["--excludeDirectories", "**/../*"] + +buildOptions:: +{} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on invalid excludeFiles.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on invalid excludeFiles.js new file mode 100644 index 0000000000..a4e28b7512 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on invalid excludeFiles.js @@ -0,0 +1,14 @@ +Args:: +["--excludeFiles", "**/../*"] + +buildOptions:: +{} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on missing argument.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on missing argument.js new file mode 100644 index 0000000000..46e8c2c48c --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/errors on missing argument.js @@ -0,0 +1,15 @@ +Args:: +["--verbose", "--fallbackPolling"] + +buildOptions:: +{"verbose":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: +error TS5080: Watch option 'fallbackPolling' requires a value of type enum. +error TS6046: Argument for '--fallbackPolling' option must be: 'fixedinterval', 'priorityinterval', 'dynamicpriority', 'fixedchunksize'. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --excludeFiles.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --excludeFiles.js new file mode 100644 index 0000000000..2135ef62d8 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --excludeFiles.js @@ -0,0 +1,13 @@ +Args:: +["--excludeFiles", "**/temp/*.ts"] + +buildOptions:: +{} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --fallbackPolling.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --fallbackPolling.js new file mode 100644 index 0000000000..feac93a700 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --fallbackPolling.js @@ -0,0 +1,13 @@ +Args:: +["--fallbackPolling", "PriorityInterval", "--verbose"] + +buildOptions:: +{"verbose":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --synchronousWatchDirectory.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --synchronousWatchDirectory.js new file mode 100644 index 0000000000..7832ff5602 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --synchronousWatchDirectory.js @@ -0,0 +1,13 @@ +Args:: +["--synchronousWatchDirectory", "--verbose"] + +buildOptions:: +{"verbose":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --watchDirectory.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --watchDirectory.js new file mode 100644 index 0000000000..5163d827a8 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --watchDirectory.js @@ -0,0 +1,13 @@ +Args:: +["--watchDirectory", "FixedPollingInterval", "--verbose"] + +buildOptions:: +{"verbose":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --watchFile.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --watchFile.js new file mode 100644 index 0000000000..afc498f2d6 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse --watchFile.js @@ -0,0 +1,13 @@ +Args:: +["--watchFile", "UseFsEvents", "--verbose"] + +buildOptions:: +{"verbose":true} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --incremental.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --incremental.js new file mode 100644 index 0000000000..86aa4fb92f --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --incremental.js @@ -0,0 +1,13 @@ +Args:: +["--incremental", "tests"] + +buildOptions:: +{} + +compilerOptions:: +{"incremental":true} + +Projects:: +tests + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --locale en-us.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --locale en-us.js new file mode 100644 index 0000000000..893f1129ab --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --locale en-us.js @@ -0,0 +1,13 @@ +Args:: +["--locale", "en-us", "src"] + +buildOptions:: +{} + +compilerOptions:: +{"locale":"en-us"} + +Projects:: +src + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --tsBuildInfoFile.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --tsBuildInfoFile.js new file mode 100644 index 0000000000..ba8480f366 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build with --tsBuildInfoFile.js @@ -0,0 +1,14 @@ +Args:: +["--tsBuildInfoFile", "build.tsbuildinfo", "tests"] + +buildOptions:: +{} + +compilerOptions:: +{} + +Projects:: +build.tsbuildinfo,tests + +Errors:: +error TS5094: Compiler option '--tsBuildInfoFile' may not be used with '--build'. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build without any options .js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build without any options .js new file mode 100644 index 0000000000..65c5a8ce58 --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/parse build without any options .js @@ -0,0 +1,13 @@ +Args:: +[] + +buildOptions:: +{} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/reports other common may not be used with --build flags.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/reports other common may not be used with --build flags.js new file mode 100644 index 0000000000..47699fb74d --- /dev/null +++ b/testdata/baselines/reference/tsoptions/commandLineParsing/parseBuildOptions/reports other common may not be used with --build flags.js @@ -0,0 +1,14 @@ +Args:: +["--strict"] + +buildOptions:: +{} + +compilerOptions:: +{} + +Projects:: +. + +Errors:: +error TS5094: Compiler option '--strict' may not be used with '--build'. diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Handles did you mean for misspelt flags.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Handles did you mean for misspelt flags.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Handles did you mean for misspelt flags.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Handles did you mean for misspelt flags.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Handles may only be used with --build flags.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Handles may only be used with --build flags.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Handles may only be used with --build flags.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Handles may only be used with --build flags.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse --lib option with extra comma.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse --lib option with extra comma.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse --lib option with trailing white-space.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse --lib option with trailing white-space.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --jsx.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --jsx.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --jsx.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --jsx.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --lib.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --lib.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --lib.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --lib.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --module.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --module.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --module.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --module.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --moduleResolution.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --moduleResolution.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --moduleResolution.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --moduleResolution.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --newLine.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --newLine.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --newLine.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --newLine.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --target.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --target.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty options of --target.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty options of --target.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty string of --lib.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty string of --lib.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse empty string of --lib.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse empty string of --lib.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse explicit boolean flag value.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse explicit boolean flag value.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse explicit boolean flag value.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse explicit boolean flag value.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse immediately following command line argument of --lib.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse immediately following command line argument of --lib.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse immediately following command line argument of --lib.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse immediately following command line argument of --lib.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse implicit boolean flag value.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse implicit boolean flag value.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse implicit boolean flag value.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse implicit boolean flag value.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse invalid option of library flags.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse invalid option of library flags.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple compiler flags with input files at the end.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple compiler flags with input files at the end.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple compiler flags with input files at the end.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple compiler flags with input files at the end.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple compiler flags with input files in the middle.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple compiler flags with input files in the middle.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple compiler flags with input files in the middle.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple compiler flags with input files in the middle.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple library compiler flags .js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple library compiler flags .js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple library compiler flags .js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple library compiler flags .js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple options of library flags.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple options of library flags.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse multiple options of library flags.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse multiple options of library flags.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse non boolean argument after boolean flag.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse non boolean argument after boolean flag.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse non boolean argument after boolean flag.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse non boolean argument after boolean flag.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/Parse single option of library flag.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse single option of library flag.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/Parse single option of library flag.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/Parse single option of library flag.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/allows setting option type boolean to false.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/allows setting option type boolean to false.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/allows setting option type boolean to false.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/allows setting option type boolean to false.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/allows tsconfig only option to be set to null.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/allows tsconfig only option to be set to null.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/allows tsconfig only option to be set to null.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/allows tsconfig only option to be set to null.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/errors on invalid excludeDirectories.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/errors on invalid excludeDirectories.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/errors on invalid excludeDirectories.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/errors on invalid excludeDirectories.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/errors on invalid excludeFiles.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/errors on invalid excludeFiles.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/errors on invalid excludeFiles.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/errors on invalid excludeFiles.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/errors on missing argument to --fallbackPolling.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/errors on missing argument to --fallbackPolling.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/errors on missing argument to --fallbackPolling.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/errors on missing argument to --fallbackPolling.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean allows setting it to null.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean allows setting it to null.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean allows setting it to null.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean allows setting it to null.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean errors if its followed by another option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean errors if its followed by another option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean errors if its followed by another option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean errors if its followed by another option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean errors if its last option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean errors if its last option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean errors if its last option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean errors if its last option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean errors if non null value is passed.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean errors if non null value is passed.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type boolean errors if non null value is passed.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type boolean errors if non null value is passed.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type list allows setting it to null.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list allows setting it to null.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type list allows setting it to null.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list allows setting it to null.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type list errors if its followed by another option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list errors if its followed by another option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type list errors if its followed by another option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list errors if its followed by another option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type list errors if its last option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list errors if its last option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type list errors if its last option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list errors if its last option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type list errors if non null value is passed.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list errors if non null value is passed.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type list errors if non null value is passed.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type list errors if non null value is passed.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type number allows setting it to null.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number allows setting it to null.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type number allows setting it to null.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number allows setting it to null.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type number errors if its followed by another option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number errors if its followed by another option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type number errors if its followed by another option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number errors if its followed by another option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type number errors if its last option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number errors if its last option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type number errors if its last option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number errors if its last option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type number errors if non null value is passed.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number errors if non null value is passed.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type number errors if non null value is passed.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type number errors if non null value is passed.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type object allows setting it to null.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type object allows setting it to null.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type object allows setting it to null.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type object allows setting it to null.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type object errors if its followed by another option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type object errors if its followed by another option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type object errors if its followed by another option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type object errors if its followed by another option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type object errors if its last option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type object errors if its last option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type object errors if its last option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type object errors if its last option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type string allows setting it to null.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string allows setting it to null.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type string allows setting it to null.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string allows setting it to null.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type string errors if its followed by another option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string errors if its followed by another option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type string errors if its followed by another option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string errors if its followed by another option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type string errors if its last option.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string errors if its last option.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type string errors if its last option.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string errors if its last option.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/option of type string errors if non null value is passed.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string errors if non null value is passed.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/option of type string errors if non null value is passed.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/option of type string errors if non null value is passed.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --excludeDirectories.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --excludeDirectories.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --excludeDirectories.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --excludeDirectories.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --excludeFiles.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --excludeFiles.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --excludeFiles.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --excludeFiles.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --fallbackPolling.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --fallbackPolling.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --fallbackPolling.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --fallbackPolling.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --incremental.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --incremental.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --incremental.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --incremental.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --synchronousWatchDirectory.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --synchronousWatchDirectory.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --synchronousWatchDirectory.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --synchronousWatchDirectory.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --tsBuildInfoFile.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --tsBuildInfoFile.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --tsBuildInfoFile.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --tsBuildInfoFile.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --watchDirectory.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --watchDirectory.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --watchDirectory.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --watchDirectory.js diff --git a/testdata/baselines/reference/tsoptions/commandLineParsing/parse --watchFile.js b/testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --watchFile.js similarity index 100% rename from testdata/baselines/reference/tsoptions/commandLineParsing/parse --watchFile.js rename to testdata/baselines/reference/tsoptions/commandLineParsing/parseCommandLine/parse --watchFile.js