From 42590bcb7e3b4620be716da723653ad03daaacbc Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 22 Aug 2025 09:16:48 -0700 Subject: [PATCH 01/31] stub for watch --- internal/core/watchoptions.go | 10 ++++ internal/execute/build/buildtask.go | 54 ++++++++++++++++- internal/execute/build/orchestrator.go | 80 ++++++++++++++++++++++++++ internal/execute/tsc/compile.go | 1 - internal/execute/tsctests/runner.go | 2 +- internal/execute/watcher.go | 21 +++---- 6 files changed, 151 insertions(+), 17 deletions(-) diff --git a/internal/core/watchoptions.go b/internal/core/watchoptions.go index e1840054b6..42d85775fe 100644 --- a/internal/core/watchoptions.go +++ b/internal/core/watchoptions.go @@ -1,5 +1,7 @@ package core +import "time" + type WatchOptions struct { Interval *int `json:"watchInterval"` FileKind WatchFileKind `json:"watchFile"` @@ -41,3 +43,11 @@ const ( PollingKindDynamicPriority PollingKind = 3 PollingKindFixedChunkSize PollingKind = 4 ) + +func (w *WatchOptions) WatchInterval() time.Duration { + watchInterval := 1000 * time.Millisecond + if w != nil && w.Interval != nil { + watchInterval = time.Duration(*w.Interval) * time.Millisecond + } + return watchInterval +} diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 3c69fc7847..ce67a101e4 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -2,7 +2,9 @@ package build import ( "fmt" + "slices" "strings" + "time" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" @@ -34,6 +36,11 @@ type buildTask struct { filesToDelete []string prevReporter *buildTask reportDone chan struct{} + + // Watching things + configTime time.Time + extendedConfigTTimes []time.Time + inputFiles []time.Time } func (t *buildTask) waitOnUpstream() []*upToDateStatus { @@ -136,6 +143,7 @@ func (t *buildTask) buildProject(orchestrator *Orchestrator, path tspath.Path) { if result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsSkipped || result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsGenerated { status = &upToDateStatus{kind: upToDateStatusTypeBuildErrors} } else { + // !!! sheetal - input output file names status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} } } else { @@ -189,7 +197,7 @@ func (t *buildTask) handleStatusThatDoesntRequireBuild(orchestrator *Orchestrato } t.updateTimeStamps(orchestrator, nil, diagnostics.Updating_output_timestamps_of_project_0) - status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + status = &upToDateStatus{kind: upToDateStatusTypeUpToDate, data: status.data} t.pseudoBuild = true return status } @@ -579,3 +587,47 @@ func (t *buildTask) cleanProjectOutput(orchestrator *Orchestrator, outputFile st } } } + +func (t *buildTask) updateWatch(orchestrator *Orchestrator) { + t.configTime = orchestrator.host.GetMTime(t.config) + if t.resolved != nil { + t.extendedConfigTTimes = core.Map(t.resolved.ExtendedSourceFiles(), func(p string) time.Time { + return orchestrator.host.GetMTime(p) + }) + t.inputFiles = core.Map(t.resolved.FileNames(), func(p string) time.Time { + return orchestrator.host.GetMTime(p) + }) + } +} + +type updateKind uint + +const ( + updateKindNone updateKind = iota + updateKindConfig + updateKindInputFiles +) + +func (t *buildTask) hasUpdate(orchestrator *Orchestrator) updateKind { + if configTime := orchestrator.host.GetMTime(t.config); configTime != t.configTime { + // !!! sheetal verify text as well? + // We need to update build tasks completely + return updateKindConfig + } + if t.resolved != nil { + for index, file := range t.resolved.ExtendedSourceFiles() { + if orchestrator.host.GetMTime(file) != t.extendedConfigTTimes[index] { + return updateKindConfig + } + } + if !slices.Equal(t.resolved.FileNames(), t.resolved.ReloadFileNamesOfParsedCommandLine(orchestrator.host.FS()).FileNames()) { + return updateKindInputFiles + } + for index, file := range t.resolved.FileNames() { + if orchestrator.host.GetMTime(file) != t.inputFiles[index] { + return updateKindInputFiles + } + } + } + return updateKindNone +} diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index 27535deb86..779bb689ca 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -3,6 +3,8 @@ package build import ( "io" "strings" + "sync/atomic" + "time" "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" @@ -12,6 +14,7 @@ import ( "github.com/microsoft/typescript-go/internal/execute/tsc" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" + "github.com/microsoft/typescript-go/internal/vfs/cachedvfs" ) type Options struct { @@ -60,6 +63,8 @@ type Orchestrator struct { errors []*ast.Diagnostic } +var _ tsc.Watcher = (*Orchestrator)(nil) + func (o *Orchestrator) relativeFileName(fileName string) string { return tspath.ConvertToRelativePath(fileName, o.comparePathsOptions) } @@ -171,6 +176,81 @@ func (o *Orchestrator) GenerateGraph() { func (o *Orchestrator) Start() tsc.CommandLineResult { o.GenerateGraph() + result := o.buildOrClean() + if o.opts.Command.CompilerOptions.Watch.IsTrue() { + o.Watch() + } + return result +} + +func (o *Orchestrator) Watch() { + wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) + o.tasks.Range(func(path tspath.Path, task *buildTask) bool { + wg.Queue(func() { + task.updateWatch(o) + }) + // Watch for file changes + return true + }) + wg.RunAndWait() + + // Clean out all the caches + + // 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] + + // !!! sheetal for now clear out all caches and then later keep with ref counting + cachesVfs := o.host.host.FS().(*cachedvfs.FS) + cachesVfs.ClearCache() + o.host.extendedConfigCache = tsc.ExtendedConfigCache{} + o.host.sourceFiles = collections.SyncMap[ast.SourceFileParseOptions, *ast.SourceFile]{} + o.host.resolvedReferences = collections.SyncMap[tspath.Path, *configAndTime]{} + o.host.buildInfos = collections.SyncMap[tspath.Path, *buildInfoAndConfig]{} + o.host.mTimes = collections.SyncMap[tspath.Path, time.Time]{} + o.host.latestChangedDtsFiles = collections.SyncMap[tspath.Path, time.Time]{} + + // Start watching for file changes + if o.opts.Testing == nil { + watchInterval := o.opts.Command.WatchOptions.WatchInterval() + for { + // Testing mode: run a single cycle and exit + time.Sleep(watchInterval) + o.DoCycle() + } + } +} + +func (o *Orchestrator) DoCycle() { + // !!! sheetal Figure out what changed + var needsUpdate atomic.Bool + wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) + o.tasks.Range(func(path tspath.Path, task *buildTask) bool { + wg.Queue(func() { + if updateKind := task.hasUpdate(o); updateKind != updateKindNone { + needsUpdate.Store(true) + } + }) + // Watch for file changes + return true + }) + wg.RunAndWait() + + if !needsUpdate.Load() { + return + } + + // Perform a single build cycle + o.tasks = collections.SyncMap[tspath.Path, *buildTask]{} + o.order = nil + o.errors = nil + o.GenerateGraph() + o.buildOrClean() +} + +func (o *Orchestrator) buildOrClean() tsc.CommandLineResult { build := !o.opts.Command.BuildOptions.Clean.IsTrue() if build && o.opts.Command.BuildOptions.Verbose.IsTrue() { o.createBuilderStatusReporter(nil)(ast.NewCompilerDiagnostic( diff --git a/internal/execute/tsc/compile.go b/internal/execute/tsc/compile.go index dc80c796ec..2a3294fcfc 100644 --- a/internal/execute/tsc/compile.go +++ b/internal/execute/tsc/compile.go @@ -36,7 +36,6 @@ const ( type Watcher interface { DoCycle() - GetProgram() *incremental.Program } type CommandLineResult struct { diff --git a/internal/execute/tsctests/runner.go b/internal/execute/tsctests/runner.go index 37fe3b8c38..6c5b8e4457 100644 --- a/internal/execute/tsctests/runner.go +++ b/internal/execute/tsctests/runner.go @@ -96,7 +96,7 @@ func (test *tscInput) run(t *testing.T, scenario string) { sys.baselineFSwithDiff(baselineBuilder) if result.Watcher == nil { - result = test.executeCommand(sys, baselineBuilder, commandLineArgs) + test.executeCommand(sys, baselineBuilder, commandLineArgs) } else { result.Watcher.DoCycle() } diff --git a/internal/execute/watcher.go b/internal/execute/watcher.go index 15cd3fcd9a..c2afa15538 100644 --- a/internal/execute/watcher.go +++ b/internal/execute/watcher.go @@ -16,7 +16,7 @@ import ( type Watcher struct { sys tsc.System configFileName string - options *tsoptions.ParsedCommandLine + config *tsoptions.ParsedCommandLine reportDiagnostic tsc.DiagnosticReporter reportErrorSummary tsc.DiagnosticsReporter testing tsc.CommandLineTesting @@ -32,7 +32,7 @@ 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, + config: configParseResult, reportDiagnostic: reportDiagnostic, reportErrorSummary: reportErrorSummary, testing: testing, @@ -46,13 +46,10 @@ func createWatcher(sys tsc.System, configParseResult *tsoptions.ParsedCommandLin func (w *Watcher) start() { w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), nil, getTraceFromSys(w.sys, w.testing)) - w.program = incremental.ReadBuildInfoProgram(w.options, incremental.NewBuildInfoReader(w.host), w.host) + w.program = incremental.ReadBuildInfoProgram(w.config, incremental.NewBuildInfoReader(w.host), w.host) if w.testing == nil { - watchInterval := 1000 * time.Millisecond - if w.options.ParsedConfig.WatchOptions != nil { - watchInterval = time.Duration(*w.options.ParsedConfig.WatchOptions.Interval) * time.Millisecond - } + watchInterval := w.config.ParsedConfig.WatchOptions.WatchInterval() for { w.DoCycle() time.Sleep(watchInterval) @@ -72,7 +69,7 @@ func (w *Watcher) DoCycle() { } // updateProgram() w.program = incremental.NewProgram(compiler.NewProgram(compiler.ProgramOptions{ - Config: w.options, + Config: w.config, Host: w.host, JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors, }), w.program, nil, w.testing != nil) @@ -110,11 +107,11 @@ func (w *Watcher) hasErrorsInTsConfig() bool { return true } // CompilerOptions contain fields which should not be compared; clone to get a copy without those set. - if !reflect.DeepEqual(w.options.CompilerOptions().Clone(), configParseResult.CompilerOptions().Clone()) { + if !reflect.DeepEqual(w.config.CompilerOptions().Clone(), configParseResult.CompilerOptions().Clone()) { // fmt.Fprintln(w.sys.Writer(), "build triggered due to config change") w.configModified = true } - w.options = configParseResult + w.config = configParseResult } w.host = compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), extendedConfigCache, getTraceFromSys(w.sys, w.testing)) return false @@ -152,7 +149,3 @@ func (w *Watcher) hasBeenModified(program *compiler.Program) bool { w.configModified = false return filesModified } - -func (w *Watcher) GetProgram() *incremental.Program { - return w.program -} From 8e547744b27b415481cd157b43d0f667c6d605da Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 22 Aug 2025 12:26:25 -0700 Subject: [PATCH 02/31] basic test --- internal/execute/tsctests/tscbuild_test.go | 55 ++ .../demo/updates-with-bad-reference.js | 917 ++++++++++++++++++ .../demo/updates-with-circular-reference.js | 574 +++++++++++ 3 files changed, 1546 insertions(+) create mode 100644 testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js create mode 100644 testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js diff --git a/internal/execute/tsctests/tscbuild_test.go b/internal/execute/tsctests/tscbuild_test.go index b67862b127..f74979032a 100644 --- a/internal/execute/tsctests/tscbuild_test.go +++ b/internal/execute/tsctests/tscbuild_test.go @@ -622,6 +622,61 @@ func TestBuildDemoProject(t *testing.T) { cwd: "/user/username/projects/demo", commandLineArgs: []string{"--b", "--verbose"}, }, + { + subScenario: "updates with circular reference", + 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", "-w", "--verbose"}, + edits: []*tscEdit{ + { + caption: "Fix error", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/demo/core/tsconfig.json", stringtestutil.Dedent(` + { + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + }, + } + `), false) + }, + }, + }, + }, + { + // !!! sheetal - this has missing errors from strada about files not in rootDir (3) + subScenario: "updates with bad reference", + 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", "-w", "--verbose"}, + edits: []*tscEdit{ + { + caption: "Prepend a line", + edit: func(sys *testSys) { + sys.prependFile("/user/username/projects/demo/core/utilities.ts", "\n") + }, + }, + }, + }, } for _, test := range testCases { diff --git a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js new file mode 100644 index 0000000000..3e3f61188f --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js @@ -0,0 +1,917 @@ +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 -w --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:13 - error TS6133: 'A' is declared but its value is never read. + +1 import * as A from '../animals' +   ~ + +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 4 errors in 2 files. + +Errors Files + 2 animals/index.ts:1 + 2 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":[[5,[{"pos":12,"end":13,"code":6133,"category":1,"message":"'A' is declared but its value is never read.","reportsUnnecessary":true}]]],"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": [ + [ + "../../core/utilities.ts", + [ + { + "pos": 12, + "end": 13, + "code": 6133, + "category": 1, + "message": "'A' is declared but its value is never read.", + "reportsUnnecessary": true + } + ] + ] + ], + "latestChangedDtsFile": "./utilities.d.ts", + "size": 3302 +} +//// [/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/animals/animal.ts +*refresh* /user/username/projects/demo/animals/dog.ts +*refresh* /user/username/projects/demo/animals/index.ts +*refresh* /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 + + +Edit [0]:: Prepend a line +//// [/user/username/projects/demo/core/utilities.ts] *modified* + +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]; +} + +tsgo --b -w --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 buildinfo file 'lib/core/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[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:2:13 - error TS6133: 'A' is declared but its value is never read. + +2 import * as A from '../animals' +   ~ + +core/utilities.ts:2: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' + +2 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 up to date with .d.ts files from its dependencies + +[HH:MM:SS AM] Updating output timestamps of project 'animals/tsconfig.json'... + +[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' + + +Found 4 errors in 2 files. + +Errors Files + 2 animals/index.ts:1 + 2 core/utilities.ts:2 + +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *modified* +{"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":"c3e46c15bb789df9e21a5ca1964be7a1-\nimport * 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":[[5,[{"pos":13,"end":14,"code":6133,"category":1,"message":"'A' is declared but its value is never read.","reportsUnnecessary":true}]]],"latestChangedDtsFile":"./utilities.d.ts"} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "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": "c3e46c15bb789df9e21a5ca1964be7a1-\nimport * 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": "c3e46c15bb789df9e21a5ca1964be7a1-\nimport * 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": [ + [ + "../../core/utilities.ts", + [ + { + "pos": 13, + "end": 14, + "code": 6133, + "category": 1, + "message": "'A' is declared but its value is never read.", + "reportsUnnecessary": true + } + ] + ] + ], + "latestChangedDtsFile": "./utilities.d.ts", + "size": 3304 +} +//// [/user/username/projects/demo/lib/core/utilities.js] *rewrite with same content* + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/demo/core/utilities.ts +Signatures:: +(computed .d.ts) /user/username/projects/demo/core/utilities.ts diff --git a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js new file mode 100644 index 0000000000..57bd31b559 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js @@ -0,0 +1,574 @@ +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 -w --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. + + + + +Edit [0]:: Fix error +//// [/user/username/projects/demo/core/tsconfig.json] *modified* +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + }, +} + +tsgo --b -w --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 From 2ae229f0ace1ddbd9b23889eee978ca62a7477f4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 22 Aug 2025 12:29:26 -0700 Subject: [PATCH 03/31] Update status --- internal/execute/build/buildtask.go | 21 ++++++++++++--------- internal/execute/build/orchestrator.go | 1 - 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index ce67a101e4..83482953a3 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -143,7 +143,6 @@ func (t *buildTask) buildProject(orchestrator *Orchestrator, path tspath.Path) { if result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsSkipped || result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsGenerated { status = &upToDateStatus{kind: upToDateStatusTypeBuildErrors} } else { - // !!! sheetal - input output file names status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} } } else { @@ -197,7 +196,7 @@ func (t *buildTask) handleStatusThatDoesntRequireBuild(orchestrator *Orchestrato } t.updateTimeStamps(orchestrator, nil, diagnostics.Updating_output_timestamps_of_project_0) - status = &upToDateStatus{kind: upToDateStatusTypeUpToDate, data: status.data} + status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} t.pseudoBuild = true return status } @@ -445,13 +444,17 @@ func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upT 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), - )) + // This is to ensure skipping verbose log for projects that were built, + // and then some other package changed but this package doesnt need update + if status.data != nil { + 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, diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index 779bb689ca..5067cc4690 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -224,7 +224,6 @@ func (o *Orchestrator) Watch() { } func (o *Orchestrator) DoCycle() { - // !!! sheetal Figure out what changed var needsUpdate atomic.Bool wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) o.tasks.Range(func(path tspath.Path, task *buildTask) bool { From 2278dfde4d2ec97c934e004fdcc976f21fbce05d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 22 Aug 2025 13:44:03 -0700 Subject: [PATCH 04/31] Reuse tasks and build order when we can --- internal/diagnostics/diagnostics_generated.go | 2 + .../diagnostics/extraDiagnosticMessages.json | 4 + internal/execute/build/buildtask.go | 346 ++++++++++++------ internal/execute/build/graph_test.go | 61 ++- internal/execute/build/host.go | 66 ++-- internal/execute/build/orchestrator.go | 124 +++++-- internal/execute/build/parseCache.go | 66 ++++ internal/execute/build/uptodatestatus.go | 28 +- internal/execute/incremental/buildHost.go | 43 +++ .../execute/incremental/emitfileshandler.go | 1 + internal/execute/incremental/program.go | 10 +- internal/execute/incremental/snapshot.go | 1 + internal/execute/tsc.go | 3 +- .../demo/updates-with-bad-reference.js | 5 +- .../demo/updates-with-circular-reference.js | 3 +- 15 files changed, 543 insertions(+), 220 deletions(-) create mode 100644 internal/execute/build/parseCache.go create mode 100644 internal/execute/incremental/buildHost.go diff --git a/internal/diagnostics/diagnostics_generated.go b/internal/diagnostics/diagnostics_generated.go index 56fa836f40..bb25f204aa 100644 --- a/internal/diagnostics/diagnostics_generated.go +++ b/internal/diagnostics/diagnostics_generated.go @@ -2980,6 +2980,8 @@ var Project_0_is_out_of_date_because_input_1_does_not_exist = &Message{code: 642 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."} +var Project_0_is_out_of_date_because_it_has_errors = &Message{code: 6423, category: CategoryMessage, key: "Project_0_is_out_of_date_because_it_has_errors_6423", text: "Project '{0}' is out of date because it has errors."} + var The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1 = &Message{code: 6500, category: CategoryMessage, key: "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", text: "The expected type comes from property '{0}' which is declared here on type '{1}'"} var The_expected_type_comes_from_this_index_signature = &Message{code: 6501, category: CategoryMessage, key: "The_expected_type_comes_from_this_index_signature_6501", text: "The expected type comes from this index signature."} diff --git a/internal/diagnostics/extraDiagnosticMessages.json b/internal/diagnostics/extraDiagnosticMessages.json index 8b91e65d9f..209b72db4b 100644 --- a/internal/diagnostics/extraDiagnosticMessages.json +++ b/internal/diagnostics/extraDiagnosticMessages.json @@ -38,5 +38,9 @@ "Failed to update timestamp of file '{0}'.": { "category": "Message", "code": 5074 + }, + "Project '{0}' is out of date because it has errors.": { + "category": "Message", + "code": 6423 } } diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 83482953a3..ce2fd397f4 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -4,6 +4,8 @@ import ( "fmt" "slices" "strings" + "sync" + "sync/atomic" "time" "github.com/microsoft/typescript-go/internal/ast" @@ -17,12 +19,29 @@ import ( "github.com/microsoft/typescript-go/internal/tspath" ) +type updateKind uint + +const ( + updateKindNone updateKind = iota + updateKindConfig + updateKindUpdate +) + +type buildKind uint + +const ( + buildKindNone buildKind = iota + buildKindPseudo + buildKindProgram +) + type buildTask struct { - config string - resolved *tsoptions.ParsedCommandLine - upStream []*buildTask - status *upToDateStatus - done chan struct{} + config string + resolved *tsoptions.ParsedCommandLine + upStream []*buildTask + downStream []*buildTask // Only set and used in watch mode + status *upToDateStatus + done chan struct{} // task reporting builder strings.Builder @@ -32,15 +51,20 @@ type buildTask struct { exitStatus tsc.ExitStatus statistics *tsc.Statistics program *incremental.Program - pseudoBuild bool + buildKind buildKind filesToDelete []string prevReporter *buildTask reportDone chan struct{} // Watching things - configTime time.Time - extendedConfigTTimes []time.Time - inputFiles []time.Time + configTime time.Time + extendedConfigTimes []time.Time + inputFiles []time.Time + + pending atomic.Bool + isInitialCycle bool + downStreamUpdateMu sync.Mutex + dirty bool } func (t *buildTask) waitOnUpstream() []*upToDateStatus { @@ -52,8 +76,9 @@ func (t *buildTask) waitOnUpstream() []*upToDateStatus { return upStreamStatus } -func (t *buildTask) unblockDownstream(status *upToDateStatus) { - t.status = status +func (t *buildTask) unblockDownstream() { + t.pending.Store(false) + t.isInitialCycle = false close(t.done) } @@ -70,21 +95,27 @@ func (t *buildTask) report(orchestrator *Orchestrator, configPath tspath.Path, b buildResult.errors = append(core.IfElse(buildResult.errors != nil, buildResult.errors, []*ast.Diagnostic{}), t.errors...) } fmt.Fprint(orchestrator.opts.Sys.Writer(), t.builder.String()) + t.builder.Reset() if t.exitStatus > buildResult.result.Status { buildResult.result.Status = t.exitStatus } if t.statistics != nil { buildResult.programStats = append(buildResult.programStats, t.statistics) + t.statistics = nil } - if t.program != nil { + // If we built the program, or updated timestamps, or had errors, we need to + // delete files that are no longer needed + switch t.buildKind { + case buildKindProgram: if orchestrator.opts.Testing != nil { orchestrator.opts.Testing.OnProgram(t.program) } t.program.MakeReadonly() buildResult.statistics.ProjectsBuilt++ - } - if t.pseudoBuild { + t.buildKind = buildKindNone + case buildKindPseudo: buildResult.statistics.TimestampUpdates++ + t.buildKind = buildKindNone } buildResult.filesToDelete = append(buildResult.filesToDelete, t.filesToDelete...) close(t.reportDone) @@ -93,81 +124,143 @@ func (t *buildTask) report(orchestrator *Orchestrator, configPath tspath.Path, b 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} + if t.pending.Load() { + t.status = t.getUpToDateStatus(orchestrator, path, upStreamStatus) + t.reportUpToDateStatus(orchestrator) + if !t.handleStatusThatDoesntRequireBuild(orchestrator) { + t.compileAndEmit(orchestrator, path) + t.updateDownstream(orchestrator, path) } else { - status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + if t.resolved != nil { + for _, diagnostic := range t.resolved.GetConfigFileParsingDiagnostics() { + t.reportDiagnostic(diagnostic) + } + } + if len(t.errors) > 0 { + t.exitStatus = tsc.ExitStatusDiagnosticsPresent_OutputsSkipped + } } } else { - status = handled - if t.resolved != nil { - for _, diagnostic := range t.resolved.GetConfigFileParsingDiagnostics() { - t.reportDiagnostic(diagnostic) + if len(t.errors) > 0 { + t.reportUpToDateStatus(orchestrator) + for _, err := range t.errors { + // Should not add the diagnostics so just reporting + t.diagnosticReporter(err) } } - if len(t.errors) > 0 { - t.exitStatus = tsc.ExitStatusDiagnosticsPresent_OutputsSkipped + } + t.unblockDownstream() +} + +func (t *buildTask) updateDownstream(orchestrator *Orchestrator, path tspath.Path) { + if t.isInitialCycle { + return + } + if orchestrator.opts.Command.BuildOptions.StopBuildOnErrors.IsTrue() && t.status.isError() { + return + } + + for _, downStream := range t.downStream { + downStream.downStreamUpdateMu.Lock() + if downStream.status != nil { + switch downStream.status.kind { + case upToDateStatusTypeUpToDate: + if !t.program.HasChangedDtsFile() { + downStream.status = &upToDateStatus{kind: upToDateStatusTypeUpToDateWithUpstreamTypes, data: downStream.status.data} + break + } + fallthrough + case upToDateStatusTypeUpToDateWithUpstreamTypes, + upToDateStatusTypeUpToDateWithInputFileText: + if t.program.HasChangedDtsFile() { + downStream.status = &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{t.config, downStream.status.oldestOutputFileName()}} + downStream.errors = nil + } + case upToDateStatusTypeUpstreamErrors: + upstreamErrors := downStream.status.upstreamErrors() + refConfig := core.ResolveConfigFileNameOfProjectReference(upstreamErrors.ref) + if orchestrator.toPath(refConfig) == path { + downStream.resetStatus(updateKindUpdate) + } + } + } + downStream.pending.Store(true) + downStream.downStreamUpdateMu.Unlock() + } +} + +func (t *buildTask) compileAndEmit(orchestrator *Orchestrator, path tspath.Path) { + 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 + configTime, _ := orchestrator.host.configTimes.Load(path) + compileTimes.ConfigTime = configTime + buildInfoReadStart := orchestrator.opts.Sys.Now() + var oldProgram *incremental.Program + if t.program != nil { + oldProgram = t.program + } else { + 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 || t.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) + } + t.buildKind = buildKindProgram + if result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsSkipped || result.Status == tsc.ExitStatusDiagnosticsPresent_OutputsGenerated { + t.status = &upToDateStatus{kind: upToDateStatusTypeBuildErrors} + } else { + var oldestOutputFileName string + if len(result.EmitResult.EmittedFiles) > 0 { + oldestOutputFileName = result.EmitResult.EmittedFiles[0] + } else { + oldestOutputFileName = core.FirstOrNilSeq(t.resolved.GetOutputFileNames()) } + t.status = &upToDateStatus{kind: upToDateStatusTypeUpToDate, data: oldestOutputFileName} } - t.unblockDownstream(status) } -func (t *buildTask) handleStatusThatDoesntRequireBuild(orchestrator *Orchestrator, status *upToDateStatus) *upToDateStatus { - switch status.kind { +func (t *buildTask) handleStatusThatDoesntRequireBuild(orchestrator *Orchestrator) bool { + switch t.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 + return true case upToDateStatusTypeUpstreamErrors: - upstreamStatus := status.data.(*upstreamErrors) + upstreamStatus := t.status.upstreamErrors() if orchestrator.opts.Command.BuildOptions.Verbose.IsTrue() { t.reportStatus(ast.NewCompilerDiagnostic( core.IfElse( @@ -179,37 +272,40 @@ func (t *buildTask) handleStatusThatDoesntRequireBuild(orchestrator *Orchestrato orchestrator.relativeFileName(upstreamStatus.ref), )) } - return status + return true case upToDateStatusTypeSolution: - return status + return true case upToDateStatusTypeConfigFileNotFound: t.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.File_0_not_found, t.config)) - return status + return true } // update timestamps - if status.isPseudoBuild() { + if t.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.status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + return true } t.updateTimeStamps(orchestrator, nil, diagnostics.Updating_output_timestamps_of_project_0) - status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} - t.pseudoBuild = true - return status + t.status = &upToDateStatus{kind: upToDateStatusTypeUpToDate, data: t.status.data} + t.buildKind = buildKindPseudo + return true } 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 + t.status = &upToDateStatus{kind: upToDateStatusTypeUpToDate} + return true } - return nil + return false } func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tspath.Path, upStreamStatus []*upToDateStatus) *upToDateStatus { + if t.status != nil { + return t.status + } // Config file not found if t.resolved == nil { return &upToDateStatus{kind: upToDateStatusTypeConfigFileNotFound} @@ -422,18 +518,18 @@ func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tsp } } -func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upToDateStatus) { +func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator) { if !orchestrator.opts.Command.BuildOptions.Verbose.IsTrue() { return } - switch status.kind { + switch t.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) + upstreamStatus := t.status.upstreamErrors() t.reportStatus(ast.NewCompilerDiagnostic( core.IfElse( upstreamStatus.refHasUpstreamErrors, @@ -443,11 +539,15 @@ func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upT orchestrator.relativeFileName(t.config), orchestrator.relativeFileName(upstreamStatus.ref), )) + case upToDateStatusTypeBuildErrors: + t.reportStatus(ast.NewCompilerDiagnostic( + diagnostics.Project_0_is_out_of_date_because_it_has_errors, + orchestrator.relativeFileName(t.config), + )) case upToDateStatusTypeUpToDate: // This is to ensure skipping verbose log for projects that were built, // and then some other package changed but this package doesnt need update - if status.data != nil { - inputOutputFileAndTime := status.data.(*inputOutputFileAndTime) + if inputOutputFileAndTime := t.status.inputOutputFileAndTime(); inputOutputFileAndTime != nil { t.reportStatus(ast.NewCompilerDiagnostic( diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2, orchestrator.relativeFileName(t.config), @@ -469,16 +569,16 @@ func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upT 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)), + orchestrator.relativeFileName(t.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)), + orchestrator.relativeFileName(t.status.data.(string)), )) case upToDateStatusTypeInputFileNewer: - inputOutput := status.data.(*inputOutputName) + inputOutput := t.status.inputOutputName() t.reportStatus(ast.NewCompilerDiagnostic( diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, orchestrator.relativeFileName(t.config), @@ -489,22 +589,22 @@ func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upT 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)), + orchestrator.relativeFileName(t.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)), + orchestrator.relativeFileName(t.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)), + orchestrator.relativeFileName(t.status.data.(string)), )) case upToDateStatusTypeOutOfDateRoots: - inputOutput := status.data.(*inputOutputName) + inputOutput := t.status.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), @@ -515,7 +615,7 @@ func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upT 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)), + orchestrator.relativeFileName(t.status.data.(string)), core.Version(), )) case upToDateStatusTypeForceBuild: @@ -526,7 +626,7 @@ func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator, status *upT case upToDateStatusTypeSolution: // Does not need to report status default: - panic(fmt.Sprintf("Unknown up to date status kind: %v", status.kind)) + panic(fmt.Sprintf("Unknown up to date status kind: %v", t.status.kind)) } } @@ -594,7 +694,7 @@ func (t *buildTask) cleanProjectOutput(orchestrator *Orchestrator, outputFile st func (t *buildTask) updateWatch(orchestrator *Orchestrator) { t.configTime = orchestrator.host.GetMTime(t.config) if t.resolved != nil { - t.extendedConfigTTimes = core.Map(t.resolved.ExtendedSourceFiles(), func(p string) time.Time { + t.extendedConfigTimes = core.Map(t.resolved.ExtendedSourceFiles(), func(p string) time.Time { return orchestrator.host.GetMTime(p) }) t.inputFiles = core.Map(t.resolved.FileNames(), func(p string) time.Time { @@ -603,32 +703,44 @@ func (t *buildTask) updateWatch(orchestrator *Orchestrator) { } } -type updateKind uint +func (t *buildTask) resetStatus(updateKind updateKind) updateKind { + t.status = nil + t.pending.Store(true) + t.errors = nil + return updateKind +} -const ( - updateKindNone updateKind = iota - updateKindConfig - updateKindInputFiles -) +func (t *buildTask) resetConfig(orchestrator *Orchestrator, path tspath.Path) updateKind { + t.dirty = true + orchestrator.host.resolvedReferences.Delete(path) + return t.resetStatus(updateKindConfig) +} -func (t *buildTask) hasUpdate(orchestrator *Orchestrator) updateKind { +func (t *buildTask) hasUpdate(orchestrator *Orchestrator, path tspath.Path) updateKind { if configTime := orchestrator.host.GetMTime(t.config); configTime != t.configTime { - // !!! sheetal verify text as well? - // We need to update build tasks completely - return updateKindConfig + return t.resetConfig(orchestrator, path) } if t.resolved != nil { for index, file := range t.resolved.ExtendedSourceFiles() { - if orchestrator.host.GetMTime(file) != t.extendedConfigTTimes[index] { - return updateKindConfig + if orchestrator.host.GetMTime(file) != t.extendedConfigTimes[index] { + return t.resetConfig(orchestrator, path) } } - if !slices.Equal(t.resolved.FileNames(), t.resolved.ReloadFileNamesOfParsedCommandLine(orchestrator.host.FS()).FileNames()) { - return updateKindInputFiles + configStart := orchestrator.opts.Sys.Now() + newConfig := t.resolved.ReloadFileNamesOfParsedCommandLine(orchestrator.host.FS()) + configTime := orchestrator.opts.Sys.Now().Sub(configStart) + // Make new channels if needed later + t.reportDone = make(chan struct{}) + t.done = make(chan struct{}) + if !slices.Equal(t.resolved.FileNames(), newConfig.FileNames()) { + orchestrator.host.resolvedReferences.Store(path, newConfig) + orchestrator.host.configTimes.Store(path, configTime) + t.resolved = newConfig + return t.resetStatus(updateKindUpdate) } for index, file := range t.resolved.FileNames() { if orchestrator.host.GetMTime(file) != t.inputFiles[index] { - return updateKindInputFiles + return t.resetStatus(updateKindUpdate) } } } diff --git a/internal/execute/build/graph_test.go b/internal/execute/build/graph_test.go index 0265b99d36..c0288f9486 100644 --- a/internal/execute/build/graph_test.go +++ b/internal/execute/build/graph_test.go @@ -62,6 +62,37 @@ func (b *buildOrderTestCase) run(t *testing.T) { "I": {"J"}, "J": {"H", "E"}, } + reverseDeps := map[string][]string{} + for project, deps := range deps { + for _, dep := range deps { + reverseDeps[dep] = append(reverseDeps[dep], project) + } + } + verifyDeps := func(orchestrator *build.Orchestrator, buildOrder []string, hasDownStream bool) { + 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)) + } + } + + downstream := core.Map(orchestrator.Downstream(b.configName(project)), b.projectName) + expectedDownstream := core.IfElse(hasDownStream, reverseDeps[project], nil) + assert.Assert(t, len(downstream) <= len(expectedDownstream), fmt.Sprintf("Expected downstream for %s to be at most %d, got %d", project, len(expectedDownstream), len(downstream))) + for _, expected := range expectedDownstream { + if slices.Contains(buildOrder[index+1:], expected) { + assert.Assert(t, slices.Contains(downstream, expected), fmt.Sprintf("Expected downstream for %s to contain %s", project, expected)) + } else { + assert.Assert(t, !slices.Contains(downstream, expected), fmt.Sprintf("Expected downstream for %s to not contain %s", project, expected)) + } + } + } + } 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 := "" @@ -84,22 +115,10 @@ func (b *buildOrderTestCase) run(t *testing.T) { Sys: sys, Command: buildCommand, }) - orchestrator.GenerateGraph() + orchestrator.GenerateGraph(nil) 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)) - } - } - } + verifyDeps(orchestrator, buildOrder, false) if !b.circular { for project, projectDeps := range deps { @@ -116,5 +135,19 @@ func (b *buildOrderTestCase) run(t *testing.T) { } } } + + orchestrator.GenerateGraphReusingOldTasks() + buildOrder2 := core.Map(orchestrator.Order(), b.projectName) + assert.DeepEqual(t, buildOrder2, b.expected) + + argsWatch := append([]string{"--build", "--watch"}, b.projects...) + buildCommandWatch := tsoptions.ParseBuildCommandLine(argsWatch, sys) + orchestrator = build.NewOrchestrator(build.Options{ + Sys: sys, + Command: buildCommandWatch, + }) + orchestrator.GenerateGraph(nil) + buildOrder3 := core.Map(orchestrator.Order(), b.projectName) + verifyDeps(orchestrator, buildOrder3, true) }) } diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index e9554f32ad..c214e562e5 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -13,22 +13,18 @@ import ( "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 + orchestrator *Orchestrator host compiler.CompilerHost extendedConfigCache tsc.ExtendedConfigCache - sourceFiles collections.SyncMap[ast.SourceFileParseOptions, *ast.SourceFile] - resolvedReferences collections.SyncMap[tspath.Path, *configAndTime] + sourceFiles parseCache[ast.SourceFileParseOptions, *ast.SourceFile] + resolvedReferences parseCache[tspath.Path, *tsoptions.ParsedCommandLine] + configTimes collections.SyncMap[tspath.Path, time.Duration] buildInfos collections.SyncMap[tspath.Path, *buildInfoAndConfig] mTimes collections.SyncMap[tspath.Path, time.Time] @@ -61,7 +57,7 @@ func (h *host) ReadFile(path string) (string, bool) { 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) + filePath := h.orchestrator.toPath(path) h.buildInfos.Delete(filePath) h.mTimes.Delete(filePath) } @@ -109,31 +105,27 @@ func (h *host) Trace(msg string) { } func (h *host) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile { - if existing, loaded := h.sourceFiles.Load(opts); loaded { - return existing - } - - file := h.host.GetSourceFile(opts) // Cache dts and json files as they will be reused - if file != nil && (tspath.IsDeclarationFileName(file.FileName()) || tspath.FileExtensionIs(file.FileName(), tspath.ExtensionJson)) { - file, _ = h.sourceFiles.LoadOrStore(opts, file) - } + file, _ := h.sourceFiles.LoadOrStoreNewIf(opts, func() (*ast.SourceFile, bool) { + file := h.host.GetSourceFile(opts) + return file, file != nil && (tspath.IsDeclarationFileName(opts.FileName) || tspath.FileExtensionIs(opts.FileName, tspath.ExtensionJson)) + }) 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 + resolved, _ := h.resolvedReferences.LoadOrStoreNew(path, func() *tsoptions.ParsedCommandLine { + configStart := h.orchestrator.opts.Sys.Now() + commandLine, _ := tsoptions.GetParsedCommandLineOfConfigFilePath(fileName, path, h.orchestrator.opts.Command.CompilerOptions, h, &h.extendedConfigCache) + configTime := h.orchestrator.opts.Sys.Now().Sub(configStart) + h.configTimes.Store(path, configTime) + return commandLine + }) + return resolved } func (h *host) ReadBuildInfo(buildInfoFileName string) *incremental.BuildInfo { - path := h.builder.toPath(buildInfoFileName) + path := h.orchestrator.toPath(buildInfoFileName) if existing, loaded := h.buildInfos.Load(path); loaded { return existing.buildInfo } @@ -141,13 +133,13 @@ func (h *host) ReadBuildInfo(buildInfoFileName string) *incremental.BuildInfo { } func (h *host) readOrStoreBuildInfo(configPath tspath.Path, buildInfoFileName string) *incremental.BuildInfo { - if existing, loaded := h.buildInfos.Load(h.builder.toPath(buildInfoFileName)); loaded { + if existing, loaded := h.buildInfos.Load(h.orchestrator.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) + entry, _ = h.buildInfos.LoadOrStore(h.orchestrator.toPath(buildInfoFileName), entry) return entry.buildInfo } @@ -159,22 +151,18 @@ func (h *host) hasConflictingBuildInfo(configPath tspath.Path) bool { } func (h *host) GetMTime(file string) time.Time { - path := h.builder.toPath(file) + path := h.orchestrator.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 := incremental.GetMTime(h.host, file) 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) + path := h.orchestrator.toPath(file) + err := incremental.SetMTime(h.host, file, mTime) if err == nil { h.mTimes.Store(path, mTime) } @@ -182,14 +170,14 @@ func (h *host) SetMTime(file string, mTime time.Time) error { } func (h *host) getLatestChangedDtsMTime(config string) time.Time { - path := h.builder.toPath(config) + path := h.orchestrator.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() + if resolved, loaded := h.resolvedReferences.Load(path); loaded { + buildInfoPath := resolved.GetBuildInfoFileName() buildInfo := h.readOrStoreBuildInfo(path, buildInfoPath) if buildInfo != nil && buildInfo.LatestChangedDtsFile != "" { changedDtsMTime = h.GetMTime( diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index 5067cc4690..9cfbdf8e99 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -11,6 +11,7 @@ import ( "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" @@ -58,7 +59,7 @@ type Orchestrator struct { host *host // order generation result - tasks collections.SyncMap[tspath.Path, *buildTask] + tasks *collections.SyncMap[tspath.Path, *buildTask] order []string errors []*ast.Diagnostic } @@ -88,17 +89,45 @@ func (o *Orchestrator) Upstream(configName string) []string { }) } -func (o *Orchestrator) createBuildTasks(configs []string, wg core.WorkGroup) { +func (o *Orchestrator) Downstream(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.downStream, func(t *buildTask) string { + return t.config + }) +} + +func (o *Orchestrator) createBuildTasks(oldTasks *collections.SyncMap[tspath.Path, *buildTask], configs []string, wg core.WorkGroup) { for _, config := range configs { wg.Queue(func() { path := o.toPath(config) - task := &buildTask{config: config} + var task *buildTask + var program *incremental.Program + if oldTasks != nil { + if existing, ok := oldTasks.Load(path); ok { + if !existing.dirty { + // Reuse existing task if config is same + task = existing + task.upStream = nil + } else { + program = existing.program + } + } + } + if task == nil { + task = &buildTask{config: config, isInitialCycle: oldTasks == nil} + task.pending.Store(true) + task.program = program + } 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) + o.createBuildTasks(oldTasks, task.resolved.ResolvedProjectReferencePaths(), wg) } }) } @@ -106,6 +135,7 @@ func (o *Orchestrator) createBuildTasks(configs []string, wg core.WorkGroup) { func (o *Orchestrator) setupBuildTask( configName string, + downStream *buildTask, inCircularContext bool, completed *collections.Set[tspath.Path], analyzing *collections.Set[tspath.Path], @@ -130,7 +160,7 @@ func (o *Orchestrator) setupBuildTask( 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) + upstream := o.setupBuildTask(subReference, task, inCircularContext || task.resolved.ProjectReferences()[index].Circular, completed, analyzing, circularityStack) if upstream != nil { task.upStream = append(task.upStream, upstream) } @@ -150,19 +180,25 @@ func (o *Orchestrator) setupBuildTask( task.done = make(chan struct{}) o.order = append(o.order, configName) } + if o.opts.Command.CompilerOptions.Watch.IsTrue() && downStream != nil { + task.downStream = append(task.downStream, downStream) + } 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), - } +func (o *Orchestrator) GenerateGraphReusingOldTasks() { + tasks := o.tasks + o.tasks = &collections.SyncMap[tspath.Path, *buildTask]{} + o.order = nil + o.errors = nil + o.GenerateGraph(tasks) +} +func (o *Orchestrator) GenerateGraph(oldTasks *collections.SyncMap[tspath.Path, *buildTask]) { projects := o.opts.Command.ResolvedProjectPaths() // Parse all config files in parallel wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) - o.createBuildTasks(projects, wg) + o.createBuildTasks(oldTasks, projects, wg) wg.RunAndWait() // Generate the graph @@ -170,34 +206,46 @@ func (o *Orchestrator) GenerateGraph() { analyzing := collections.Set[tspath.Path]{} circularityStack := []string{} for _, project := range projects { - o.setupBuildTask(project, false, &completed, &analyzing, circularityStack) + o.setupBuildTask(project, nil, false, &completed, &analyzing, circularityStack) } } func (o *Orchestrator) Start() tsc.CommandLineResult { - o.GenerateGraph() + o.GenerateGraph(nil) result := o.buildOrClean() if o.opts.Command.CompilerOptions.Watch.IsTrue() { o.Watch() + result.Watcher = o } return result } func (o *Orchestrator) Watch() { + o.updateWatchAndResetCaches() + + // Start watching for file changes + if o.opts.Testing == nil { + watchInterval := o.opts.Command.WatchOptions.WatchInterval() + for { + // Testing mode: run a single cycle and exit + time.Sleep(watchInterval) + o.DoCycle() + } + } +} + +func (o *Orchestrator) updateWatchAndResetCaches() { wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) o.tasks.Range(func(path tspath.Path, task *buildTask) bool { wg.Queue(func() { task.updateWatch(o) }) - // Watch for file changes return true }) wg.RunAndWait() // Clean out all the caches - // 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] @@ -206,30 +254,24 @@ func (o *Orchestrator) Watch() { cachesVfs := o.host.host.FS().(*cachedvfs.FS) cachesVfs.ClearCache() o.host.extendedConfigCache = tsc.ExtendedConfigCache{} - o.host.sourceFiles = collections.SyncMap[ast.SourceFileParseOptions, *ast.SourceFile]{} - o.host.resolvedReferences = collections.SyncMap[tspath.Path, *configAndTime]{} + o.host.sourceFiles.Reset() + o.host.configTimes = collections.SyncMap[tspath.Path, time.Duration]{} o.host.buildInfos = collections.SyncMap[tspath.Path, *buildInfoAndConfig]{} o.host.mTimes = collections.SyncMap[tspath.Path, time.Time]{} o.host.latestChangedDtsFiles = collections.SyncMap[tspath.Path, time.Time]{} - - // Start watching for file changes - if o.opts.Testing == nil { - watchInterval := o.opts.Command.WatchOptions.WatchInterval() - for { - // Testing mode: run a single cycle and exit - time.Sleep(watchInterval) - o.DoCycle() - } - } } func (o *Orchestrator) DoCycle() { + var needsConfigUpdate atomic.Bool var needsUpdate atomic.Bool wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) o.tasks.Range(func(path tspath.Path, task *buildTask) bool { wg.Queue(func() { - if updateKind := task.hasUpdate(o); updateKind != updateKindNone { + if updateKind := task.hasUpdate(o, path); updateKind != updateKindNone { needsUpdate.Store(true) + if updateKind == updateKindConfig { + needsConfigUpdate.Store(true) + } } }) // Watch for file changes @@ -241,12 +283,12 @@ func (o *Orchestrator) DoCycle() { return } - // Perform a single build cycle - o.tasks = collections.SyncMap[tspath.Path, *buildTask]{} - o.order = nil - o.errors = nil - o.GenerateGraph() + if needsConfigUpdate.Load() { + // Generate new tasks + o.GenerateGraphReusingOldTasks() + } o.buildOrClean() + o.updateWatchAndResetCaches() } func (o *Orchestrator) buildOrClean() tsc.CommandLineResult { @@ -305,11 +347,23 @@ func (o *Orchestrator) createDiagnosticReporter(task *buildTask) tsc.DiagnosticR } func NewOrchestrator(opts Options) *Orchestrator { - return &Orchestrator{ + orchestrator := &Orchestrator{ opts: opts, comparePathsOptions: tspath.ComparePathsOptions{ CurrentDirectory: opts.Sys.GetCurrentDirectory(), UseCaseSensitiveFileNames: opts.Sys.FS().UseCaseSensitiveFileNames(), }, + tasks: &collections.SyncMap[tspath.Path, *buildTask]{}, + } + orchestrator.host = &host{ + orchestrator: orchestrator, + host: compiler.NewCachedFSCompilerHost( + orchestrator.opts.Sys.GetCurrentDirectory(), + orchestrator.opts.Sys.FS(), + orchestrator.opts.Sys.DefaultLibraryPath(), + nil, + nil, + ), } + return orchestrator } diff --git a/internal/execute/build/parseCache.go b/internal/execute/build/parseCache.go new file mode 100644 index 0000000000..a4e53f30f1 --- /dev/null +++ b/internal/execute/build/parseCache.go @@ -0,0 +1,66 @@ +package build + +import ( + "sync" + + "github.com/microsoft/typescript-go/internal/collections" +) + +type parseCacheEntry[V any] struct { + value V + mu sync.Mutex + dirty bool +} + +type parseCache[K comparable, V any] struct { + entries collections.SyncMap[K, *parseCacheEntry[V]] +} + +func (c *parseCache[K, V]) LoadOrStoreNew(key K, parse func() V) (V, bool) { + return c.LoadOrStoreNewIf(key, func() (V, bool) { + return parse(), true + }) +} + +func (c *parseCache[K, V]) LoadOrStoreNewIf(key K, parse func() (V, bool)) (V, bool) { + newEntry := &parseCacheEntry[V]{} + newEntry.mu.Lock() + defer newEntry.mu.Unlock() + if entry, loaded := c.entries.LoadOrStore(key, newEntry); loaded && !entry.dirty { + // Ensure it was parsed before returning + entry.mu.Lock() + defer entry.mu.Unlock() + return entry.value, true + } + value, ok := parse() + if ok { + newEntry.value = value + } else { + // Dont use the cache entry + newEntry.dirty = true + c.entries.Delete(key) + } + return value, false +} + +func (c *parseCache[K, V]) Load(key K) (V, bool) { + if entry, ok := c.entries.Load(key); ok && !entry.dirty { + entry.mu.Lock() + defer entry.mu.Unlock() + return entry.value, true + } + var zero V + return zero, false +} + +func (c *parseCache[K, V]) Store(key K, value V) { + c.entries.Store(key, &parseCacheEntry[V]{value: value}) +} + +func (c *parseCache[K, V]) Delete(key K) { + c.entries.Delete(key) +} + +func (c *parseCache[K, V]) Reset() { + c.entries = collections.SyncMap[K, *parseCacheEntry[V]]{} +} diff --git a/internal/execute/build/uptodatestatus.go b/internal/execute/build/uptodatestatus.go index 8d6218b2f9..8c843ce118 100644 --- a/internal/execute/build/uptodatestatus.go +++ b/internal/execute/build/uptodatestatus.go @@ -36,7 +36,7 @@ const ( 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 + // build info indicates 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 @@ -105,3 +105,29 @@ func (s *upToDateStatus) inputOutputFileAndTime() *inputOutputFileAndTime { } return data } + +func (s *upToDateStatus) inputOutputName() *inputOutputName { + data, ok := s.data.(*inputOutputName) + if !ok { + return nil + } + return data +} + +func (s *upToDateStatus) oldestOutputFileName() string { + if !s.isPseudoBuild() || s.kind != upToDateStatusTypeUpToDate { + panic("only valid for up to date status of pseudo-build or up to date") + } + + if inputOutputFileAndTime := s.inputOutputFileAndTime(); inputOutputFileAndTime != nil { + return inputOutputFileAndTime.output.file + } + if inputOutputName := s.inputOutputName(); inputOutputName != nil { + return inputOutputName.output + } + return s.data.(string) +} + +func (s *upToDateStatus) upstreamErrors() *upstreamErrors { + return s.data.(*upstreamErrors) +} diff --git a/internal/execute/incremental/buildHost.go b/internal/execute/incremental/buildHost.go new file mode 100644 index 0000000000..1e95b67290 --- /dev/null +++ b/internal/execute/incremental/buildHost.go @@ -0,0 +1,43 @@ +package incremental + +import ( + "time" + + "github.com/microsoft/typescript-go/internal/compiler" +) + +type BuildHost interface { + GetMTime(fileName string) time.Time + SetMTime(fileName string, mTime time.Time) error +} + +type buildHost struct { + host compiler.CompilerHost +} + +var _ BuildHost = (*buildHost)(nil) + +func (b *buildHost) GetMTime(fileName string) time.Time { + return GetMTime(b.host, fileName) +} + +func (b *buildHost) SetMTime(fileName string, mTime time.Time) error { + return SetMTime(b.host, fileName, mTime) +} + +func CreateBuildHost(host compiler.CompilerHost) BuildHost { + return &buildHost{host: host} +} + +func GetMTime(host compiler.CompilerHost, fileName string) time.Time { + stat := host.FS().Stat(fileName) + var mTime time.Time + if stat != nil { + mTime = stat.ModTime() + } + return mTime +} + +func SetMTime(host compiler.CompilerHost, fileName string, mTime time.Time) error { + return host.FS().Chtimes(fileName, time.Time{}, mTime) +} diff --git a/internal/execute/incremental/emitfileshandler.go b/internal/execute/incremental/emitfileshandler.go index 273d0a7319..6ac6eeab2b 100644 --- a/internal/execute/incremental/emitfileshandler.go +++ b/internal/execute/incremental/emitfileshandler.go @@ -250,6 +250,7 @@ func (h *emitFilesHandler) updateSnapshot() []*compiler.EmitResult { if latestChangedDtsFile, ok := h.latestChangedDtsFiles.Load(file.Path()); ok { h.program.snapshot.latestChangedDtsFile = latestChangedDtsFile h.program.snapshot.buildInfoEmitPending.Store(true) + h.program.snapshot.hasChangedDtsFile = true } if update, ok := h.emitUpdates.Load(file.Path()); ok { if update.pendingKind == 0 { diff --git a/internal/execute/incremental/program.go b/internal/execute/incremental/program.go index aff766b617..59d4b62188 100644 --- a/internal/execute/incremental/program.go +++ b/internal/execute/incremental/program.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "slices" - "time" "github.com/go-json-experiment/json" "github.com/microsoft/typescript-go/internal/ast" @@ -24,11 +23,6 @@ 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 @@ -86,6 +80,10 @@ func (p *Program) MakeReadonly() { p.testingData = nil } +func (p *Program) HasChangedDtsFile() bool { + return p.snapshot.hasChangedDtsFile +} + // Options implements compiler.AnyProgram interface. func (p *Program) Options() *core.CompilerOptions { return p.snapshot.options diff --git a/internal/execute/incremental/snapshot.go b/internal/execute/incremental/snapshot.go index 1fc0222c08..88d53c47cd 100644 --- a/internal/execute/incremental/snapshot.go +++ b/internal/execute/incremental/snapshot.go @@ -226,6 +226,7 @@ type snapshot struct { allFilesExcludingDefaultLibraryFileOnce sync.Once // Cache of all files excluding default library file for the current program allFilesExcludingDefaultLibraryFile []*ast.SourceFile + hasChangedDtsFile bool // Used with testing to add text of hash for better comparison hashWithText bool diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go index 395685041f..4dec69f34a 100644 --- a/internal/execute/tsc.go +++ b/internal/execute/tsc.go @@ -86,7 +86,6 @@ func tscBuildCompilation(sys tsc.System, buildCommand *tsoptions.ParsedBuildComm return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess} } - // !!! sheetal watch mode orchestrator := build.NewOrchestrator(build.Options{ Sys: sys, Command: buildCommand, @@ -259,7 +258,7 @@ func performIncrementalCompilation( }) compileTimes.ParseTime = sys.Now().Sub(parseStart) changesComputeStart := sys.Now() - incrementalProgram := incremental.NewProgram(program, oldProgram, nil, testing != nil) + incrementalProgram := incremental.NewProgram(program, oldProgram, incremental.CreateBuildHost(host), testing != nil) compileTimes.ChangesComputeTime = sys.Now().Sub(changesComputeStart) result, _ := tsc.EmitAndReportStatistics( sys, diff --git a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js index 3e3f61188f..2c6174ccea 100644 --- a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js +++ b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js @@ -718,8 +718,7 @@ export function lastElementOf(arr: T[]): T | undefined { return arr[arr.length - 1]; } -tsgo --b -w --verbose -ExitStatus:: DiagnosticsPresent_OutputsGenerated + Output:: [HH:MM:SS AM] Projects in this build: * core/tsconfig.json @@ -762,8 +761,6 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'animals/tsconfig.json'... -[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' - Found 4 errors in 2 files. diff --git a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js index 57bd31b559..2e43c0bb8e 100644 --- a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js +++ b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js @@ -143,8 +143,7 @@ Edit [0]:: Fix error }, } -tsgo --b -w --verbose -ExitStatus:: Success + Output:: [HH:MM:SS AM] Projects in this build: * core/tsconfig.json From 2d5feeed80e89db95aa70cb0dfd256c0c1fd2650 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 27 Aug 2025 12:34:58 -0700 Subject: [PATCH 05/31] Cache buildInfo for life time --- internal/execute/build/buildtask.go | 141 ++++++++++++++---- internal/execute/build/host.go | 74 ++------- internal/execute/build/orchestrator.go | 42 +++--- internal/execute/incremental/buildHost.go | 6 + .../incremental/buildinfotosnapshot.go | 4 +- internal/execute/incremental/incremental.go | 20 +-- internal/execute/incremental/program.go | 1 + 7 files changed, 162 insertions(+), 126 deletions(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index ce2fd397f4..6af23d1813 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -35,10 +35,21 @@ const ( buildKindProgram ) +type upstreamTask struct { + task *buildTask + refIndex int +} +type buildInfoEntry struct { + buildInfo *incremental.BuildInfo + path tspath.Path + mTime time.Time + dtsTime *time.Time +} + type buildTask struct { config string resolved *tsoptions.ParsedCommandLine - upStream []*buildTask + upStream []*upstreamTask downStream []*buildTask // Only set and used in watch mode status *upToDateStatus done chan struct{} @@ -61,19 +72,19 @@ type buildTask struct { extendedConfigTimes []time.Time inputFiles []time.Time + buildInfoEntry *buildInfoEntry + buildInfoEntryMu sync.Mutex + pending atomic.Bool isInitialCycle bool downStreamUpdateMu sync.Mutex dirty bool } -func (t *buildTask) waitOnUpstream() []*upToDateStatus { - upStreamStatus := make([]*upToDateStatus, len(t.upStream)) - for i, upstream := range t.upStream { - <-upstream.done - upStreamStatus[i] = upstream.status +func (t *buildTask) waitOnUpstream() { + for _, upstream := range t.upStream { + <-upstream.task.done } - return upStreamStatus } func (t *buildTask) unblockDownstream() { @@ -123,9 +134,9 @@ func (t *buildTask) report(orchestrator *Orchestrator, configPath tspath.Path, b func (t *buildTask) buildProject(orchestrator *Orchestrator, path tspath.Path) { // Wait on upstream tasks to complete - upStreamStatus := t.waitOnUpstream() + t.waitOnUpstream() if t.pending.Load() { - t.status = t.getUpToDateStatus(orchestrator, path, upStreamStatus) + t.status = t.getUpToDateStatus(orchestrator, path) t.reportUpToDateStatus(orchestrator) if !t.handleStatusThatDoesntRequireBuild(orchestrator) { t.compileAndEmit(orchestrator, path) @@ -200,10 +211,12 @@ func (t *buildTask) compileAndEmit(orchestrator *Orchestrator, path tspath.Path) compileTimes.ConfigTime = configTime buildInfoReadStart := orchestrator.opts.Sys.Now() var oldProgram *incremental.Program - if t.program != nil { - oldProgram = t.program - } else { - oldProgram = incremental.ReadBuildInfoProgram(t.resolved, orchestrator.host, orchestrator.host) + if !orchestrator.opts.Command.BuildOptions.Force.IsTrue() { + if t.program != nil { + oldProgram = t.program + } else { + oldProgram = incremental.ReadBuildInfoProgram(t.resolved, orchestrator.host, orchestrator.host) + } } compileTimes.BuildInfoReadTime = orchestrator.opts.Sys.Now().Sub(buildInfoReadStart) parseStart := orchestrator.opts.Sys.Now() @@ -302,7 +315,7 @@ func (t *buildTask) handleStatusThatDoesntRequireBuild(orchestrator *Orchestrato return false } -func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tspath.Path, upStreamStatus []*upToDateStatus) *upToDateStatus { +func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tspath.Path) *upToDateStatus { if t.status != nil { return t.status } @@ -316,15 +329,10 @@ func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tsp 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() { + for _, upstream := range t.upStream { + if orchestrator.opts.Command.BuildOptions.StopBuildOnErrors.IsTrue() && upstream.task.status.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}} + return &upToDateStatus{kind: upToDateStatusTypeUpstreamErrors, data: &upstreamErrors{t.resolved.ProjectReferences()[upstream.refIndex].Path, upstream.task.status.kind == upToDateStatusTypeUpstreamErrors}} } } @@ -334,7 +342,7 @@ func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tsp // Check the build info buildInfoPath := t.resolved.GetBuildInfoFileName() - buildInfo := orchestrator.host.readOrStoreBuildInfo(configPath, buildInfoPath) + buildInfo, buildInfoTime := t.loadOrStoreBuildInfo(orchestrator, configPath, buildInfoPath) if buildInfo == nil { return &upToDateStatus{kind: upToDateStatusTypeOutputMissing, data: buildInfoPath} } @@ -375,7 +383,7 @@ func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tsp } } var inputTextUnchanged bool - oldestOutputFileAndTime := fileAndTime{buildInfoPath, orchestrator.host.GetMTime(buildInfoPath)} + oldestOutputFileAndTime := fileAndTime{buildInfoPath, buildInfoTime} var newestInputFileAndTime fileAndTime var seenRoots collections.Set[tspath.Path] var buildInfoRootInfoReader *incremental.BuildInfoRootInfoReader @@ -445,8 +453,8 @@ func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tsp } var refDtsUnchanged bool - for index, upstreamStatus := range upStreamStatus { - if upstreamStatus == nil || upstreamStatus.kind == upToDateStatusTypeSolution { + for _, upstream := range t.upStream { + if upstream.task.status.kind == upToDateStatusTypeSolution { // Not dependent on the status or this upstream project // (eg: expected cycle was detected and hence skipped, or is solution) continue @@ -456,26 +464,27 @@ func (t *buildTask) getUpToDateStatus(orchestrator *Orchestrator, configPath tsp // 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() + refInputOutputFileAndTime := upstream.task.status.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 t.hasConflictingBuildInfo(orchestrator, upstream.task) { + // We have an output older than an upstream output - we are out of date + return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{t.resolved.ProjectReferences()[upstream.refIndex].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]) + newestDtsChangeTime := upstream.task.getLatestChangedDtsMTime(orchestrator) 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}} + return &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{t.resolved.ProjectReferences()[upstream.refIndex].Path, oldestOutputFileAndTime.file}} } checkInputFileTime := func(inputFile string) *upToDateStatus { @@ -636,6 +645,8 @@ func (t *buildTask) updateTimeStamps(orchestrator *Orchestrator, emittedFiles [] } emitted := collections.NewSetFromItems(emittedFiles...) var verboseMessageReported bool + buildInfoName := t.resolved.GetBuildInfoFileName() + now := orchestrator.opts.Sys.Now() updateTimeStamp := func(file string) { if emitted.Has(file) { return @@ -644,9 +655,15 @@ func (t *buildTask) updateTimeStamps(orchestrator *Orchestrator, emittedFiles [] t.reportStatus(ast.NewCompilerDiagnostic(verboseMessage, orchestrator.relativeFileName(t.config))) verboseMessageReported = true } - err := orchestrator.host.SetMTime(file, orchestrator.opts.Sys.Now()) + err := orchestrator.host.SetMTime(file, now) if err != nil { t.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Failed_to_update_timestamp_of_file_0, file)) + } else if file == buildInfoName { + t.buildInfoEntryMu.Lock() + if t.buildInfoEntry != nil { + t.buildInfoEntry.mTime = now + } + t.buildInfoEntryMu.Unlock() } } @@ -746,3 +763,63 @@ func (t *buildTask) hasUpdate(orchestrator *Orchestrator, path tspath.Path) upda } return updateKindNone } + +func (t *buildTask) loadOrStoreBuildInfo(orchestrator *Orchestrator, configPath tspath.Path, buildInfoFileName string) (*incremental.BuildInfo, time.Time) { + path := orchestrator.toPath(buildInfoFileName) + t.buildInfoEntryMu.Lock() + defer t.buildInfoEntryMu.Unlock() + if t.buildInfoEntry != nil && t.buildInfoEntry.path == path { + return t.buildInfoEntry.buildInfo, t.buildInfoEntry.mTime + } + t.buildInfoEntry = &buildInfoEntry{ + buildInfo: incremental.NewBuildInfoReader(orchestrator.host).ReadBuildInfo(t.resolved), + path: path, + } + var mTime time.Time + if t.buildInfoEntry.buildInfo != nil { + mTime = orchestrator.host.GetMTime(buildInfoFileName) + } + t.buildInfoEntry.mTime = mTime + return t.buildInfoEntry.buildInfo, mTime +} + +func (t *buildTask) onBuildInfoEmit(orchestrator *Orchestrator, config *tsoptions.ParsedCommandLine, buildInfo *incremental.BuildInfo, hasChangedDtsFile bool) { + t.buildInfoEntryMu.Lock() + defer t.buildInfoEntryMu.Unlock() + var dtsTime *time.Time + mTime := orchestrator.opts.Sys.Now() + if hasChangedDtsFile { + dtsTime = &mTime + } else if t.buildInfoEntry != nil { + dtsTime = t.buildInfoEntry.dtsTime + } + t.buildInfoEntry = &buildInfoEntry{ + buildInfo: buildInfo, + path: orchestrator.toPath(config.GetBuildInfoFileName()), + mTime: mTime, + dtsTime: dtsTime, + } +} + +func (t *buildTask) hasConflictingBuildInfo(orchestrator *Orchestrator, upstream *buildTask) bool { + if t.buildInfoEntry != nil && upstream.buildInfoEntry != nil { + return t.buildInfoEntry.path == upstream.buildInfoEntry.path + } + return false +} + +func (t *buildTask) getLatestChangedDtsMTime(orchestrator *Orchestrator) time.Time { + t.buildInfoEntryMu.Lock() + defer t.buildInfoEntryMu.Unlock() + if t.buildInfoEntry.dtsTime != nil { + return *t.buildInfoEntry.dtsTime + } + dtsTime := orchestrator.host.GetMTime( + tspath.GetNormalizedAbsolutePath( + t.buildInfoEntry.buildInfo.LatestChangedDtsFile, + tspath.GetDirectoryPath(string(t.buildInfoEntry.path)), + ), + ) + t.buildInfoEntry.dtsTime = &dtsTime + return dtsTime +} diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index c214e562e5..4d922957e3 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -13,22 +13,18 @@ import ( "github.com/microsoft/typescript-go/internal/vfs" ) -type buildInfoAndConfig struct { - buildInfo *incremental.BuildInfo - config tspath.Path -} - type host struct { - orchestrator *Orchestrator - host compiler.CompilerHost + orchestrator *Orchestrator + host compiler.CompilerHost + + // Caches that last only for build cycle and then cleared out extendedConfigCache tsc.ExtendedConfigCache sourceFiles parseCache[ast.SourceFileParseOptions, *ast.SourceFile] - resolvedReferences parseCache[tspath.Path, *tsoptions.ParsedCommandLine] configTimes collections.SyncMap[tspath.Path, time.Duration] - buildInfos collections.SyncMap[tspath.Path, *buildInfoAndConfig] - mTimes collections.SyncMap[tspath.Path, time.Time] - latestChangedDtsFiles collections.SyncMap[tspath.Path, time.Time] + // caches that stay as long as they are needed + resolvedReferences parseCache[tspath.Path, *tsoptions.ParsedCommandLine] + mTimes collections.SyncMap[tspath.Path, time.Time] } var ( @@ -58,7 +54,6 @@ func (h *host) WriteFile(path string, data string, writeByteOrderMark bool) erro err := h.host.FS().WriteFile(path, data, writeByteOrderMark) if err == nil { filePath := h.orchestrator.toPath(path) - h.buildInfos.Delete(filePath) h.mTimes.Delete(filePath) } return err @@ -124,30 +119,11 @@ func (h *host) GetResolvedProjectReference(fileName string, path tspath.Path) *t return resolved } -func (h *host) ReadBuildInfo(buildInfoFileName string) *incremental.BuildInfo { - path := h.orchestrator.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.orchestrator.toPath(buildInfoFileName)); loaded { - return existing.buildInfo - } - - buildInfo := incremental.NewBuildInfoReader(h).ReadBuildInfo(buildInfoFileName) - entry := &buildInfoAndConfig{buildInfo, configPath} - entry, _ = h.buildInfos.LoadOrStore(h.orchestrator.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) ReadBuildInfo(config *tsoptions.ParsedCommandLine) *incremental.BuildInfo { + configPath := h.orchestrator.toPath(config.ConfigName()) + task := h.orchestrator.getTask(configPath) + buildInfo, _ := task.loadOrStoreBuildInfo(h.orchestrator, h.orchestrator.toPath(config.ConfigName()), config.GetBuildInfoFileName()) + return buildInfo } func (h *host) GetMTime(file string) time.Time { @@ -169,26 +145,8 @@ func (h *host) SetMTime(file string, mTime time.Time) error { return err } -func (h *host) getLatestChangedDtsMTime(config string) time.Time { - path := h.orchestrator.toPath(config) - if existing, loaded := h.latestChangedDtsFiles.Load(path); loaded { - return existing - } - - var changedDtsMTime time.Time - if resolved, loaded := h.resolvedReferences.Load(path); loaded { - buildInfoPath := 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 +func (h *host) OnBuildInfoEmit(config *tsoptions.ParsedCommandLine, buildInfo *incremental.BuildInfo, hasChangedDtsFile bool) { + configPath := h.orchestrator.toPath(config.ConfigName()) + task := h.orchestrator.getTask(configPath) + task.onBuildInfoEmit(h.orchestrator, config, buildInfo, hasChangedDtsFile) } diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index 9cfbdf8e99..28eb569008 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -80,32 +80,35 @@ func (o *Orchestrator) Order() []string { 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 + task := o.getTask(path) + return core.Map(task.upStream, func(t *upstreamTask) string { + return t.task.config }) } func (o *Orchestrator) Downstream(configName string) []string { path := o.toPath(configName) - task, ok := o.tasks.Load(path) - if !ok { - panic("No build task found for " + configName) - } + task := o.getTask(path) return core.Map(task.downStream, func(t *buildTask) string { return t.config }) } +func (o *Orchestrator) getTask(path tspath.Path) *buildTask { + task, ok := o.tasks.Load(path) + if !ok { + panic("No build task found for " + path) + } + return task +} + func (o *Orchestrator) createBuildTasks(oldTasks *collections.SyncMap[tspath.Path, *buildTask], configs []string, wg core.WorkGroup) { for _, config := range configs { wg.Queue(func() { path := o.toPath(config) var task *buildTask var program *incremental.Program + var buildInfo *buildInfoEntry if oldTasks != nil { if existing, ok := oldTasks.Load(path); ok { if !existing.dirty { @@ -114,6 +117,7 @@ func (o *Orchestrator) createBuildTasks(oldTasks *collections.SyncMap[tspath.Pat task.upStream = nil } else { program = existing.program + buildInfo = existing.buildInfoEntry } } } @@ -121,6 +125,7 @@ func (o *Orchestrator) createBuildTasks(oldTasks *collections.SyncMap[tspath.Pat task = &buildTask{config: config, isInitialCycle: oldTasks == nil} task.pending.Store(true) task.program = program + task.buildInfoEntry = buildInfo } if _, loaded := o.tasks.LoadOrStore(path, task); loaded { return @@ -142,10 +147,7 @@ func (o *Orchestrator) setupBuildTask( circularityStack []string, ) *buildTask { path := o.toPath(configName) - task, ok := o.tasks.Load(path) - if !ok { - panic("No build task found for " + configName) - } + task := o.getTask(path) if !completed.Has(path) { if analyzing.Has(path) { if !inCircularContext { @@ -162,7 +164,7 @@ func (o *Orchestrator) setupBuildTask( for index, subReference := range task.resolved.ResolvedProjectReferencePaths() { upstream := o.setupBuildTask(subReference, task, inCircularContext || task.resolved.ProjectReferences()[index].Circular, completed, analyzing, circularityStack) if upstream != nil { - task.upStream = append(task.upStream, upstream) + task.upStream = append(task.upStream, &upstreamTask{task: upstream, refIndex: index}) } } } @@ -171,11 +173,7 @@ func (o *Orchestrator) setupBuildTask( 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.prevReporter = o.getTask(o.toPath(prev)) } task.done = make(chan struct{}) o.order = append(o.order, configName) @@ -246,9 +244,7 @@ func (o *Orchestrator) updateWatchAndResetCaches() { // Clean out all the caches - // buildInfos collections.SyncMap[tspath.Path, *buildInfoAndConfig] // mTimes collections.SyncMap[tspath.Path, time.Time] - // latestChangedDtsFiles collections.SyncMap[tspath.Path, time.Time] // !!! sheetal for now clear out all caches and then later keep with ref counting cachesVfs := o.host.host.FS().(*cachedvfs.FS) @@ -256,9 +252,7 @@ func (o *Orchestrator) updateWatchAndResetCaches() { o.host.extendedConfigCache = tsc.ExtendedConfigCache{} o.host.sourceFiles.Reset() o.host.configTimes = collections.SyncMap[tspath.Path, time.Duration]{} - o.host.buildInfos = collections.SyncMap[tspath.Path, *buildInfoAndConfig]{} o.host.mTimes = collections.SyncMap[tspath.Path, time.Time]{} - o.host.latestChangedDtsFiles = collections.SyncMap[tspath.Path, time.Time]{} } func (o *Orchestrator) DoCycle() { diff --git a/internal/execute/incremental/buildHost.go b/internal/execute/incremental/buildHost.go index 1e95b67290..d59f365495 100644 --- a/internal/execute/incremental/buildHost.go +++ b/internal/execute/incremental/buildHost.go @@ -4,11 +4,13 @@ import ( "time" "github.com/microsoft/typescript-go/internal/compiler" + "github.com/microsoft/typescript-go/internal/tsoptions" ) type BuildHost interface { GetMTime(fileName string) time.Time SetMTime(fileName string, mTime time.Time) error + OnBuildInfoEmit(config *tsoptions.ParsedCommandLine, buildInfo *BuildInfo, hasChangedDtsFile bool) } type buildHost struct { @@ -25,6 +27,10 @@ func (b *buildHost) SetMTime(fileName string, mTime time.Time) error { return SetMTime(b.host, fileName, mTime) } +func (b *buildHost) OnBuildInfoEmit(config *tsoptions.ParsedCommandLine, buildInfo *BuildInfo, hasChangedDtsFile bool) { + // no-op +} + func CreateBuildHost(host compiler.CompilerHost) BuildHost { return &buildHost{host: host} } diff --git a/internal/execute/incremental/buildinfotosnapshot.go b/internal/execute/incremental/buildinfotosnapshot.go index 309ed32c95..10ebb40f64 100644 --- a/internal/execute/incremental/buildinfotosnapshot.go +++ b/internal/execute/incremental/buildinfotosnapshot.go @@ -10,10 +10,10 @@ import ( "github.com/microsoft/typescript-go/internal/tspath" ) -func buildInfoToSnapshot(buildInfo *BuildInfo, buildInfoFileName string, config *tsoptions.ParsedCommandLine, host compiler.CompilerHost) *snapshot { +func buildInfoToSnapshot(buildInfo *BuildInfo, config *tsoptions.ParsedCommandLine, host compiler.CompilerHost) *snapshot { to := &toSnapshot{ buildInfo: buildInfo, - buildInfoDirectory: tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(buildInfoFileName, config.GetCurrentDirectory())), + buildInfoDirectory: tspath.GetDirectoryPath(tspath.GetNormalizedAbsolutePath(config.GetBuildInfoFileName(), config.GetCurrentDirectory())), filePaths: make([]tspath.Path, 0, len(buildInfo.FileNames)), filePathSet: make([]*collections.Set[tspath.Path], 0, len(buildInfo.FileIdsList)), } diff --git a/internal/execute/incremental/incremental.go b/internal/execute/incremental/incremental.go index 8d85686fec..e449401a72 100644 --- a/internal/execute/incremental/incremental.go +++ b/internal/execute/incremental/incremental.go @@ -7,7 +7,7 @@ import ( ) type BuildInfoReader interface { - ReadBuildInfo(buildInfoFileName string) *BuildInfo + ReadBuildInfo(config *tsoptions.ParsedCommandLine) *BuildInfo } var _ BuildInfoReader = (*buildInfoReader)(nil) @@ -16,7 +16,12 @@ type buildInfoReader struct { host compiler.CompilerHost } -func (r *buildInfoReader) ReadBuildInfo(buildInfoFileName string) *BuildInfo { +func (r *buildInfoReader) ReadBuildInfo(config *tsoptions.ParsedCommandLine) *BuildInfo { + buildInfoFileName := config.GetBuildInfoFileName() + if buildInfoFileName == "" { + return nil + } + // Read build info file data, ok := r.host.FS().ReadFile(buildInfoFileName) if !ok { @@ -37,20 +42,15 @@ func NewBuildInfoReader( } func ReadBuildInfoProgram(config *tsoptions.ParsedCommandLine, reader BuildInfoReader, host compiler.CompilerHost) *Program { - buildInfoFileName := config.GetBuildInfoFileName() - if buildInfoFileName == "" { - return nil - } - - // Read buildinFo file - buildInfo := reader.ReadBuildInfo(buildInfoFileName) + // Read buildInfo file + buildInfo := reader.ReadBuildInfo(config) if buildInfo == nil || !buildInfo.IsValidVersion() || !buildInfo.IsIncremental() { return nil } // Convert to information that can be used to create incremental program incrementalProgram := &Program{ - snapshot: buildInfoToSnapshot(buildInfo, buildInfoFileName, config, host), + snapshot: buildInfoToSnapshot(buildInfo, config, host), } return incrementalProgram } diff --git a/internal/execute/incremental/program.go b/internal/execute/incremental/program.go index 59d4b62188..c96d61476c 100644 --- a/internal/execute/incremental/program.go +++ b/internal/execute/incremental/program.go @@ -292,6 +292,7 @@ func (p *Program) emitBuildInfo(ctx context.Context, options compiler.EmitOption } } p.snapshot.buildInfoEmitPending.Store(false) + p.host.OnBuildInfoEmit(p.program.CommandLine(), buildInfo, p.snapshot.hasChangedDtsFile) return &compiler.EmitResult{ EmitSkipped: false, EmittedFiles: []string{buildInfoFileName}, From e1a0d553e7c6e7b07bec452632992bba4d1f0e38 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 11:24:32 -0700 Subject: [PATCH 06/31] use writeFile callback to get updates about writing --- internal/compiler/emitter.go | 25 ++++++++++++----------- internal/compiler/program.go | 4 +++- internal/execute/build/buildtask.go | 19 +++++++++++++++-- internal/execute/build/host.go | 6 ------ internal/execute/build/orchestrator.go | 6 +----- internal/execute/incremental/buildHost.go | 6 ------ internal/execute/incremental/program.go | 3 +-- internal/execute/tsc.go | 2 ++ internal/execute/tsc/emit.go | 8 ++++++-- internal/execute/watcher.go | 2 +- 10 files changed, 44 insertions(+), 37 deletions(-) diff --git a/internal/compiler/emitter.go b/internal/compiler/emitter.go index 6e6cc023bc..daaf74e31c 100644 --- a/internal/compiler/emitter.go +++ b/internal/compiler/emitter.go @@ -262,7 +262,7 @@ func (e *emitter) printSourceFile(jsFilePath string, sourceMapFilePath string, s // Write the source map if len(sourceMapFilePath) > 0 { sourceMap := sourceMapGenerator.String() - err := e.host.WriteFile(sourceMapFilePath, sourceMap, false /*writeByteOrderMark*/) + err := e.writeText(sourceMapFilePath, sourceMap, false /*writeByteOrderMark*/, nil) if err != nil { e.emitterDiagnostics.Add(ast.NewCompilerDiagnostic(diagnostics.Could_not_write_file_0_Colon_1, jsFilePath, err.Error())) } else { @@ -275,18 +275,12 @@ func (e *emitter) printSourceFile(jsFilePath string, sourceMapFilePath string, s // Write the output file text := e.writer.String() - var err error - var skippedDtsWrite bool - if e.writeFile == nil { - err = e.host.WriteFile(jsFilePath, text, e.host.Options().EmitBOM.IsTrue()) - } else { - data := &WriteFileData{ - SourceMapUrlPos: sourceMapUrlPos, - Diagnostics: e.emitterDiagnostics.GetDiagnostics(), - } - err = e.writeFile(jsFilePath, text, e.host.Options().EmitBOM.IsTrue(), data) - skippedDtsWrite = data.SkippedDtsWrite + data := &WriteFileData{ + SourceMapUrlPos: sourceMapUrlPos, + Diagnostics: e.emitterDiagnostics.GetDiagnostics(), } + err := e.writeText(jsFilePath, text, options.EmitBOM.IsTrue(), data) + skippedDtsWrite := data.SkippedDtsWrite if err != nil { e.emitterDiagnostics.Add(ast.NewCompilerDiagnostic(diagnostics.Could_not_write_file_0_Colon_1, jsFilePath, err.Error())) } else if !skippedDtsWrite { @@ -297,6 +291,13 @@ func (e *emitter) printSourceFile(jsFilePath string, sourceMapFilePath string, s e.writer.Clear() } +func (e *emitter) writeText(fileName string, text string, writeByteOrderMark bool, data *WriteFileData) error { + if e.writeFile != nil { + return e.writeFile(fileName, text, writeByteOrderMark, data) + } + return e.host.WriteFile(fileName, text, writeByteOrderMark) +} + func shouldEmitSourceMaps(mapOptions *core.CompilerOptions, sourceFile *ast.SourceFile) bool { return (mapOptions.SourceMap.IsTrue() || mapOptions.InlineSourceMap.IsTrue()) && !tspath.FileExtensionIs(sourceFile.FileName(), tspath.ExtensionJson) diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 3de0851adf..a19e18b495 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1341,10 +1341,12 @@ type WriteFileData struct { SkippedDtsWrite bool } +type WriteFile func(fileName string, text string, writeByteOrderMark bool, data *WriteFileData) error + type EmitOptions struct { TargetSourceFile *ast.SourceFile // Single file to emit. If `nil`, emits all files EmitOnly EmitOnly - WriteFile func(fileName string, text string, writeByteOrderMark bool, data *WriteFileData) error + WriteFile WriteFile } type EmitResult struct { diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 6af23d1813..a8d74a0211 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -241,6 +241,9 @@ func (t *buildTask) compileAndEmit(orchestrator *Orchestrator, path tspath.Path) t.reportDiagnostic, tsc.QuietDiagnosticsReporter, &t.builder, + func(fileName, text string, writeByteOrderMark bool, data *compiler.WriteFileData) error { + return t.writeFile(orchestrator, fileName, text, writeByteOrderMark, data) + }, &compileTimes, orchestrator.opts.Testing, ) @@ -783,7 +786,7 @@ func (t *buildTask) loadOrStoreBuildInfo(orchestrator *Orchestrator, configPath return t.buildInfoEntry.buildInfo, mTime } -func (t *buildTask) onBuildInfoEmit(orchestrator *Orchestrator, config *tsoptions.ParsedCommandLine, buildInfo *incremental.BuildInfo, hasChangedDtsFile bool) { +func (t *buildTask) onBuildInfoEmit(orchestrator *Orchestrator, buildInfoFileName string, buildInfo *incremental.BuildInfo, hasChangedDtsFile bool) { t.buildInfoEntryMu.Lock() defer t.buildInfoEntryMu.Unlock() var dtsTime *time.Time @@ -795,7 +798,7 @@ func (t *buildTask) onBuildInfoEmit(orchestrator *Orchestrator, config *tsoption } t.buildInfoEntry = &buildInfoEntry{ buildInfo: buildInfo, - path: orchestrator.toPath(config.GetBuildInfoFileName()), + path: orchestrator.toPath(buildInfoFileName), mTime: mTime, dtsTime: dtsTime, } @@ -823,3 +826,15 @@ func (t *buildTask) getLatestChangedDtsMTime(orchestrator *Orchestrator) time.Ti t.buildInfoEntry.dtsTime = &dtsTime return dtsTime } + +func (t *buildTask) writeFile(orchestrator *Orchestrator, fileName string, text string, writeByteOrderMark bool, data *compiler.WriteFileData) error { + err := orchestrator.host.WriteFile(fileName, text, writeByteOrderMark) + if err == nil { + if data != nil && data.BuildInfo != nil { + t.onBuildInfoEmit(orchestrator, fileName, data.BuildInfo.(*incremental.BuildInfo), t.program.HasChangedDtsFile()) + } else if !t.resolved.CompilerOptions().IsIncremental() { + // Store time stamps + } + } + return err +} diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index 4d922957e3..8613d63a21 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -144,9 +144,3 @@ func (h *host) SetMTime(file string, mTime time.Time) error { } return err } - -func (h *host) OnBuildInfoEmit(config *tsoptions.ParsedCommandLine, buildInfo *incremental.BuildInfo, hasChangedDtsFile bool) { - configPath := h.orchestrator.toPath(config.ConfigName()) - task := h.orchestrator.getTask(configPath) - task.onBuildInfoEmit(h.orchestrator, config, buildInfo, hasChangedDtsFile) -} diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index 28eb569008..59f1ddfa46 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -243,16 +243,12 @@ func (o *Orchestrator) updateWatchAndResetCaches() { wg.RunAndWait() // Clean out all the caches - - // mTimes collections.SyncMap[tspath.Path, time.Time] - - // !!! sheetal for now clear out all caches and then later keep with ref counting cachesVfs := o.host.host.FS().(*cachedvfs.FS) cachesVfs.ClearCache() o.host.extendedConfigCache = tsc.ExtendedConfigCache{} o.host.sourceFiles.Reset() o.host.configTimes = collections.SyncMap[tspath.Path, time.Duration]{} - o.host.mTimes = collections.SyncMap[tspath.Path, time.Time]{} + o.host.mTimes = collections.SyncMap[tspath.Path, time.Time]{} // !!! sheetal } func (o *Orchestrator) DoCycle() { diff --git a/internal/execute/incremental/buildHost.go b/internal/execute/incremental/buildHost.go index d59f365495..1e95b67290 100644 --- a/internal/execute/incremental/buildHost.go +++ b/internal/execute/incremental/buildHost.go @@ -4,13 +4,11 @@ import ( "time" "github.com/microsoft/typescript-go/internal/compiler" - "github.com/microsoft/typescript-go/internal/tsoptions" ) type BuildHost interface { GetMTime(fileName string) time.Time SetMTime(fileName string, mTime time.Time) error - OnBuildInfoEmit(config *tsoptions.ParsedCommandLine, buildInfo *BuildInfo, hasChangedDtsFile bool) } type buildHost struct { @@ -27,10 +25,6 @@ func (b *buildHost) SetMTime(fileName string, mTime time.Time) error { return SetMTime(b.host, fileName, mTime) } -func (b *buildHost) OnBuildInfoEmit(config *tsoptions.ParsedCommandLine, buildInfo *BuildInfo, hasChangedDtsFile bool) { - // no-op -} - func CreateBuildHost(host compiler.CompilerHost) BuildHost { return &buildHost{host: host} } diff --git a/internal/execute/incremental/program.go b/internal/execute/incremental/program.go index c96d61476c..33b6adc4d9 100644 --- a/internal/execute/incremental/program.go +++ b/internal/execute/incremental/program.go @@ -278,7 +278,7 @@ func (p *Program) emitBuildInfo(ctx context.Context, options compiler.EmitOption } if options.WriteFile != nil { err = options.WriteFile(buildInfoFileName, string(text), false, &compiler.WriteFileData{ - BuildInfo: &buildInfo, + BuildInfo: buildInfo, }) } else { err = p.program.Host().FS().WriteFile(buildInfoFileName, string(text), false) @@ -292,7 +292,6 @@ func (p *Program) emitBuildInfo(ctx context.Context, options compiler.EmitOption } } p.snapshot.buildInfoEmitPending.Store(false) - p.host.OnBuildInfoEmit(p.program.CommandLine(), buildInfo, p.snapshot.hasChangedDtsFile) return &compiler.EmitResult{ EmitSkipped: false, EmittedFiles: []string{buildInfoFileName}, diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go index 4dec69f34a..7f723b90bd 100644 --- a/internal/execute/tsc.go +++ b/internal/execute/tsc.go @@ -268,6 +268,7 @@ func performIncrementalCompilation( reportDiagnostic, reportErrorSummary, sys.Writer(), + nil, compileTimes, testing, ) @@ -305,6 +306,7 @@ func performCompilation( reportDiagnostic, reportErrorSummary, sys.Writer(), + nil, compileTimes, testing, ) diff --git a/internal/execute/tsc/emit.go b/internal/execute/tsc/emit.go index 56350f9a87..f4aeba6f50 100644 --- a/internal/execute/tsc/emit.go +++ b/internal/execute/tsc/emit.go @@ -30,11 +30,12 @@ func EmitAndReportStatistics( reportDiagnostic DiagnosticReporter, reportErrorSummary DiagnosticsReporter, w io.Writer, + writeFile compiler.WriteFile, compileTimes *CompileTimes, testing CommandLineTesting, ) (CompileAndEmitResult, *Statistics) { var statistics *Statistics - result := EmitFilesAndReportErrors(sys, programLike, program, reportDiagnostic, reportErrorSummary, w, compileTimes, testing) + result := EmitFilesAndReportErrors(sys, programLike, program, reportDiagnostic, reportErrorSummary, w, writeFile, compileTimes, testing) if result.Status != ExitStatusSuccess { // compile exited early return result, nil @@ -67,6 +68,7 @@ func EmitFilesAndReportErrors( reportDiagnostic DiagnosticReporter, reportErrorSummary DiagnosticsReporter, w io.Writer, + writeFile compiler.WriteFile, compileTimes *CompileTimes, testing CommandLineTesting, ) (result CompileAndEmitResult) { @@ -98,7 +100,9 @@ func EmitFilesAndReportErrors( emitResult := &compiler.EmitResult{EmitSkipped: true, Diagnostics: []*ast.Diagnostic{}} if !programLike.Options().ListFilesOnly.IsTrue() { emitStart := sys.Now() - emitResult = programLike.Emit(ctx, compiler.EmitOptions{}) + emitResult = programLike.Emit(ctx, compiler.EmitOptions{ + WriteFile: writeFile, + }) result.times.emitTime = sys.Now().Sub(emitStart) } if emitResult != nil { diff --git a/internal/execute/watcher.go b/internal/execute/watcher.go index c2afa15538..b306a85245 100644 --- a/internal/execute/watcher.go +++ b/internal/execute/watcher.go @@ -91,7 +91,7 @@ func (w *Watcher) DoCycle() { func (w *Watcher) compileAndEmit() { // !!! output/error reporting is currently the same as non-watch mode // diagnostics, emitResult, exitStatus := - tsc.EmitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.reportErrorSummary, w.sys.Writer(), &tsc.CompileTimes{}, w.testing) + tsc.EmitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.reportErrorSummary, w.sys.Writer(), nil, &tsc.CompileTimes{}, w.testing) } func (w *Watcher) hasErrorsInTsConfig() bool { From 182364b61babb09debc5b1e883c61508a403bb4f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 11:33:21 -0700 Subject: [PATCH 07/31] rename --- internal/execute/build/host.go | 2 +- .../execute/incremental/{buildHost.go => host.go} | 14 +++++++------- internal/execute/incremental/program.go | 6 +++--- internal/execute/tsc.go | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename internal/execute/incremental/{buildHost.go => host.go} (67%) diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index 8613d63a21..2087256000 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -31,7 +31,7 @@ var ( _ vfs.FS = (*host)(nil) _ compiler.CompilerHost = (*host)(nil) _ incremental.BuildInfoReader = (*host)(nil) - _ incremental.BuildHost = (*host)(nil) + _ incremental.Host = (*host)(nil) ) func (h *host) FS() vfs.FS { diff --git a/internal/execute/incremental/buildHost.go b/internal/execute/incremental/host.go similarity index 67% rename from internal/execute/incremental/buildHost.go rename to internal/execute/incremental/host.go index 1e95b67290..cac8d9e6b0 100644 --- a/internal/execute/incremental/buildHost.go +++ b/internal/execute/incremental/host.go @@ -6,27 +6,27 @@ import ( "github.com/microsoft/typescript-go/internal/compiler" ) -type BuildHost interface { +type Host interface { GetMTime(fileName string) time.Time SetMTime(fileName string, mTime time.Time) error } -type buildHost struct { +type host struct { host compiler.CompilerHost } -var _ BuildHost = (*buildHost)(nil) +var _ Host = (*host)(nil) -func (b *buildHost) GetMTime(fileName string) time.Time { +func (b *host) GetMTime(fileName string) time.Time { return GetMTime(b.host, fileName) } -func (b *buildHost) SetMTime(fileName string, mTime time.Time) error { +func (b *host) SetMTime(fileName string, mTime time.Time) error { return SetMTime(b.host, fileName, mTime) } -func CreateBuildHost(host compiler.CompilerHost) BuildHost { - return &buildHost{host: host} +func CreateHost(compilerHost compiler.CompilerHost) Host { + return &host{host: compilerHost} } func GetMTime(host compiler.CompilerHost, fileName string) time.Time { diff --git a/internal/execute/incremental/program.go b/internal/execute/incremental/program.go index 33b6adc4d9..1512126297 100644 --- a/internal/execute/incremental/program.go +++ b/internal/execute/incremental/program.go @@ -26,7 +26,7 @@ const ( type Program struct { snapshot *snapshot program *compiler.Program - host BuildHost + host Host // Testing data testingData *TestingData @@ -34,11 +34,11 @@ type Program struct { var _ compiler.ProgramLike = (*Program)(nil) -func NewProgram(program *compiler.Program, oldProgram *Program, buildHost BuildHost, testing bool) *Program { +func NewProgram(program *compiler.Program, oldProgram *Program, host Host, testing bool) *Program { incrementalProgram := &Program{ snapshot: programToSnapshot(program, oldProgram, testing), program: program, - host: buildHost, + host: host, } if testing { diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go index 7f723b90bd..b6b3ab9a5f 100644 --- a/internal/execute/tsc.go +++ b/internal/execute/tsc.go @@ -258,7 +258,7 @@ func performIncrementalCompilation( }) compileTimes.ParseTime = sys.Now().Sub(parseStart) changesComputeStart := sys.Now() - incrementalProgram := incremental.NewProgram(program, oldProgram, incremental.CreateBuildHost(host), testing != nil) + incrementalProgram := incremental.NewProgram(program, oldProgram, incremental.CreateHost(host), testing != nil) compileTimes.ChangesComputeTime = sys.Now().Sub(changesComputeStart) result, _ := tsc.EmitAndReportStatistics( sys, From 19f5686ff31c1244dca956a4cc521ea3e9b5dd7f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 13:06:34 -0700 Subject: [PATCH 08/31] Handle mtimes caching --- internal/execute/build/buildtask.go | 72 +++++++++++++-------- internal/execute/build/host.go | 86 +++++++++----------------- internal/execute/build/orchestrator.go | 6 +- internal/execute/incremental/host.go | 6 +- internal/execute/tsctests/sys.go | 1 + internal/vfs/cachedvfs/cachedvfs.go | 1 - 6 files changed, 79 insertions(+), 93 deletions(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index a8d74a0211..86f87e0a0a 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -191,7 +191,7 @@ func (t *buildTask) updateDownstream(orchestrator *Orchestrator, path tspath.Pat upstreamErrors := downStream.status.upstreamErrors() refConfig := core.ResolveConfigFileNameOfProjectReference(upstreamErrors.ref) if orchestrator.toPath(refConfig) == path { - downStream.resetStatus(updateKindUpdate) + downStream.resetStatus() } } } @@ -667,6 +667,8 @@ func (t *buildTask) updateTimeStamps(orchestrator *Orchestrator, emittedFiles [] t.buildInfoEntry.mTime = now } t.buildInfoEntryMu.Unlock() + } else if t.storeOutputTimeStamp(orchestrator) { + orchestrator.host.storeMTime(file, now) } } @@ -711,60 +713,71 @@ func (t *buildTask) cleanProjectOutput(orchestrator *Orchestrator, outputFile st } } -func (t *buildTask) updateWatch(orchestrator *Orchestrator) { - t.configTime = orchestrator.host.GetMTime(t.config) +func (t *buildTask) updateWatch(orchestrator *Orchestrator, oldCache *collections.SyncMap[tspath.Path, time.Time]) { + t.configTime = orchestrator.host.loadOrStoreMTime(t.config, oldCache, false) if t.resolved != nil { t.extendedConfigTimes = core.Map(t.resolved.ExtendedSourceFiles(), func(p string) time.Time { - return orchestrator.host.GetMTime(p) + return orchestrator.host.loadOrStoreMTime(p, oldCache, false) }) t.inputFiles = core.Map(t.resolved.FileNames(), func(p string) time.Time { - return orchestrator.host.GetMTime(p) + return orchestrator.host.loadOrStoreMTime(p, oldCache, false) }) + if !t.resolved.CompilerOptions().IsIncremental() { + for outputFile := range t.resolved.GetOutputFileNames() { + orchestrator.host.storeMTimeFromOldCache(outputFile, oldCache) + } + } } } -func (t *buildTask) resetStatus(updateKind updateKind) updateKind { +func (t *buildTask) resetStatus() { t.status = nil t.pending.Store(true) t.errors = nil - return updateKind } -func (t *buildTask) resetConfig(orchestrator *Orchestrator, path tspath.Path) updateKind { +func (t *buildTask) resetConfig(orchestrator *Orchestrator, path tspath.Path) { t.dirty = true orchestrator.host.resolvedReferences.Delete(path) - return t.resetStatus(updateKindConfig) } func (t *buildTask) hasUpdate(orchestrator *Orchestrator, path tspath.Path) updateKind { + var needsConfigUpdate bool + var needsUpdate bool if configTime := orchestrator.host.GetMTime(t.config); configTime != t.configTime { - return t.resetConfig(orchestrator, path) + t.resetConfig(orchestrator, path) + needsConfigUpdate = true } if t.resolved != nil { for index, file := range t.resolved.ExtendedSourceFiles() { if orchestrator.host.GetMTime(file) != t.extendedConfigTimes[index] { - return t.resetConfig(orchestrator, path) + t.resetConfig(orchestrator, path) + needsConfigUpdate = true } } - configStart := orchestrator.opts.Sys.Now() - newConfig := t.resolved.ReloadFileNamesOfParsedCommandLine(orchestrator.host.FS()) - configTime := orchestrator.opts.Sys.Now().Sub(configStart) - // Make new channels if needed later - t.reportDone = make(chan struct{}) - t.done = make(chan struct{}) - if !slices.Equal(t.resolved.FileNames(), newConfig.FileNames()) { - orchestrator.host.resolvedReferences.Store(path, newConfig) - orchestrator.host.configTimes.Store(path, configTime) - t.resolved = newConfig - return t.resetStatus(updateKindUpdate) - } for index, file := range t.resolved.FileNames() { if orchestrator.host.GetMTime(file) != t.inputFiles[index] { - return t.resetStatus(updateKindUpdate) + t.resetStatus() + needsUpdate = true + } + } + if !needsConfigUpdate { + configStart := orchestrator.opts.Sys.Now() + newConfig := t.resolved.ReloadFileNamesOfParsedCommandLine(orchestrator.host.FS()) + configTime := orchestrator.opts.Sys.Now().Sub(configStart) + // Make new channels if needed later + t.reportDone = make(chan struct{}) + t.done = make(chan struct{}) + if !slices.Equal(t.resolved.FileNames(), newConfig.FileNames()) { + orchestrator.host.resolvedReferences.Store(path, newConfig) + orchestrator.host.configTimes.Store(path, configTime) + t.resolved = newConfig + t.resetStatus() + needsUpdate = true } } } - return updateKindNone + return core.IfElse(needsConfigUpdate, updateKindConfig, core.IfElse(needsUpdate, updateKindUpdate, updateKindNone)) } func (t *buildTask) loadOrStoreBuildInfo(orchestrator *Orchestrator, configPath tspath.Path, buildInfoFileName string) (*incremental.BuildInfo, time.Time) { @@ -827,13 +840,18 @@ func (t *buildTask) getLatestChangedDtsMTime(orchestrator *Orchestrator) time.Ti return dtsTime } +func (t *buildTask) storeOutputTimeStamp(orchestrator *Orchestrator) bool { + return orchestrator.opts.Command.CompilerOptions.Watch.IsTrue() && !t.resolved.CompilerOptions().IsIncremental() +} + func (t *buildTask) writeFile(orchestrator *Orchestrator, fileName string, text string, writeByteOrderMark bool, data *compiler.WriteFileData) error { - err := orchestrator.host.WriteFile(fileName, text, writeByteOrderMark) + err := orchestrator.host.FS().WriteFile(fileName, text, writeByteOrderMark) if err == nil { if data != nil && data.BuildInfo != nil { t.onBuildInfoEmit(orchestrator, fileName, data.BuildInfo.(*incremental.BuildInfo), t.program.HasChangedDtsFile()) - } else if !t.resolved.CompilerOptions().IsIncremental() { + } else if t.storeOutputTimeStamp(orchestrator) { // Store time stamps + orchestrator.host.storeMTime(fileName, orchestrator.opts.Sys.Now()) } } return err diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index 2087256000..48ce770ad8 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -24,67 +24,17 @@ type host struct { // caches that stay as long as they are needed resolvedReferences parseCache[tspath.Path, *tsoptions.ParsedCommandLine] - mTimes collections.SyncMap[tspath.Path, time.Time] + mTimes *collections.SyncMap[tspath.Path, time.Time] } var ( - _ vfs.FS = (*host)(nil) _ compiler.CompilerHost = (*host)(nil) _ incremental.BuildInfoReader = (*host)(nil) _ incremental.Host = (*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.orchestrator.toPath(path) - 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) + return h.host.FS() } func (h *host) DefaultLibraryPath() string { @@ -127,20 +77,40 @@ func (h *host) ReadBuildInfo(config *tsoptions.ParsedCommandLine) *incremental.B } func (h *host) GetMTime(file string) time.Time { + return h.loadOrStoreMTime(file, nil, true) +} + +func (h *host) SetMTime(file string, mTime time.Time) error { + return h.FS().Chtimes(file, time.Time{}, mTime) +} + +func (h *host) loadOrStoreMTime(file string, oldCache *collections.SyncMap[tspath.Path, time.Time], store bool) time.Time { path := h.orchestrator.toPath(file) if existing, loaded := h.mTimes.Load(path); loaded { return existing } - mTime := incremental.GetMTime(h.host, file) - mTime, _ = h.mTimes.LoadOrStore(path, mTime) + var found bool + var mTime time.Time + if oldCache != nil { + mTime, found = oldCache.Load(path) + } + if !found { + mTime = incremental.GetMTime(h.host, file) + } + if store { + mTime, _ = h.mTimes.LoadOrStore(path, mTime) + } return mTime } -func (h *host) SetMTime(file string, mTime time.Time) error { +func (h *host) storeMTime(file string, mTime time.Time) { + path := h.orchestrator.toPath(file) + h.mTimes.Store(path, mTime) +} + +func (h *host) storeMTimeFromOldCache(file string, oldCache *collections.SyncMap[tspath.Path, time.Time]) { path := h.orchestrator.toPath(file) - err := incremental.SetMTime(h.host, file, mTime) - if err == nil { + if mTime, found := oldCache.Load(path); found { h.mTimes.Store(path, mTime) } - return err } diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index 59f1ddfa46..bbbbbe5390 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -233,10 +233,12 @@ func (o *Orchestrator) Watch() { } func (o *Orchestrator) updateWatchAndResetCaches() { + oldCache := o.host.mTimes + o.host.mTimes = &collections.SyncMap[tspath.Path, time.Time]{} wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) o.tasks.Range(func(path tspath.Path, task *buildTask) bool { wg.Queue(func() { - task.updateWatch(o) + task.updateWatch(o, oldCache) }) return true }) @@ -248,7 +250,6 @@ func (o *Orchestrator) updateWatchAndResetCaches() { o.host.extendedConfigCache = tsc.ExtendedConfigCache{} o.host.sourceFiles.Reset() o.host.configTimes = collections.SyncMap[tspath.Path, time.Duration]{} - o.host.mTimes = collections.SyncMap[tspath.Path, time.Time]{} // !!! sheetal } func (o *Orchestrator) DoCycle() { @@ -354,6 +355,7 @@ func NewOrchestrator(opts Options) *Orchestrator { nil, nil, ), + mTimes: &collections.SyncMap[tspath.Path, time.Time]{}, } return orchestrator } diff --git a/internal/execute/incremental/host.go b/internal/execute/incremental/host.go index cac8d9e6b0..55d6bbc088 100644 --- a/internal/execute/incremental/host.go +++ b/internal/execute/incremental/host.go @@ -22,7 +22,7 @@ func (b *host) GetMTime(fileName string) time.Time { } func (b *host) SetMTime(fileName string, mTime time.Time) error { - return SetMTime(b.host, fileName, mTime) + return b.host.FS().Chtimes(fileName, time.Time{}, mTime) } func CreateHost(compilerHost compiler.CompilerHost) Host { @@ -37,7 +37,3 @@ func GetMTime(host compiler.CompilerHost, fileName string) time.Time { } return mTime } - -func SetMTime(host compiler.CompilerHost, fileName string, mTime time.Time) error { - return host.FS().Chtimes(fileName, time.Time{}, mTime) -} diff --git a/internal/execute/tsctests/sys.go b/internal/execute/tsctests/sys.go index 62f10bde25..ae4c8d3114 100644 --- a/internal/execute/tsctests/sys.go +++ b/internal/execute/tsctests/sys.go @@ -223,6 +223,7 @@ func (s *testSys) OnEmittedFiles(result *compiler.EmitResult) { for _, file := range result.EmittedFiles { // Ensure that the timestamp for emitted files is in the order now := s.Now() + // !!! sheetal TODO this on buildHost so that watch can cache these times if err := s.fsFromFileMap().Chtimes(file, time.Time{}, now); err != nil { panic("Failed to change time for emitted file: " + file + ": " + err.Error()) } diff --git a/internal/vfs/cachedvfs/cachedvfs.go b/internal/vfs/cachedvfs/cachedvfs.go index 6fcc3d92f4..13ec842f72 100644 --- a/internal/vfs/cachedvfs/cachedvfs.go +++ b/internal/vfs/cachedvfs/cachedvfs.go @@ -146,6 +146,5 @@ 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) } From 6e15d4c0fd594c0682b37d320ddaeb26f93cd695 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 15:51:25 -0700 Subject: [PATCH 09/31] Handle updates to mTimes in test --- internal/execute/build/buildtask.go | 25 +- internal/execute/tsc.go | 46 +- internal/execute/tsc/compile.go | 4 +- internal/execute/tsc/emit.go | 105 +++-- internal/execute/tsc/statistics.go | 16 +- internal/execute/tsctests/sys.go | 21 +- internal/execute/watcher.go | 11 +- internal/vfs/vfstest/vfstest.go | 12 + .../sample/when-declarationMap-changes.js | 406 +++++++++++++++++- 9 files changed, 528 insertions(+), 118 deletions(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 86f87e0a0a..0a5682eb3b 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -233,20 +233,21 @@ func (t *buildTask) compileAndEmit(orchestrator *Orchestrator, path tspath.Path) 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, - func(fileName, text string, writeByteOrderMark bool, data *compiler.WriteFileData) error { + result, statistics := tsc.EmitAndReportStatistics(tsc.EmitInput{ + Sys: orchestrator.opts.Sys, + ProgramLike: t.program, + Program: program, + Config: t.resolved, + ReportDiagnostic: t.reportDiagnostic, + ReportErrorSummary: tsc.QuietDiagnosticsReporter, + Writer: &t.builder, + WriteFile: func(fileName, text string, writeByteOrderMark bool, data *compiler.WriteFileData) error { return t.writeFile(orchestrator, fileName, text, writeByteOrderMark, data) }, - &compileTimes, - orchestrator.opts.Testing, - ) + CompileTimes: &compileTimes, + Testing: orchestrator.opts.Testing, + TestingMTimesCache: orchestrator.host.mTimes, + }) t.exitStatus = result.Status t.statistics = statistics if (!program.Options().NoEmitOnError.IsTrue() || len(result.Diagnostics) == 0) && diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go index b6b3ab9a5f..65bf8d43bb 100644 --- a/internal/execute/tsc.go +++ b/internal/execute/tsc.go @@ -260,18 +260,17 @@ func performIncrementalCompilation( changesComputeStart := sys.Now() incrementalProgram := incremental.NewProgram(program, oldProgram, incremental.CreateHost(host), testing != nil) compileTimes.ChangesComputeTime = sys.Now().Sub(changesComputeStart) - result, _ := tsc.EmitAndReportStatistics( - sys, - incrementalProgram, - incrementalProgram.GetProgram(), - config, - reportDiagnostic, - reportErrorSummary, - sys.Writer(), - nil, - compileTimes, - testing, - ) + result, _ := tsc.EmitAndReportStatistics(tsc.EmitInput{ + Sys: sys, + ProgramLike: incrementalProgram, + Program: incrementalProgram.GetProgram(), + Config: config, + ReportDiagnostic: reportDiagnostic, + ReportErrorSummary: reportErrorSummary, + Writer: sys.Writer(), + CompileTimes: compileTimes, + Testing: testing, + }) if testing != nil { testing.OnProgram(incrementalProgram) } @@ -298,18 +297,17 @@ func performCompilation( JSDocParsingMode: ast.JSDocParsingModeParseForTypeErrors, }) compileTimes.ParseTime = sys.Now().Sub(parseStart) - result, _ := tsc.EmitAndReportStatistics( - sys, - program, - program, - config, - reportDiagnostic, - reportErrorSummary, - sys.Writer(), - nil, - compileTimes, - testing, - ) + result, _ := tsc.EmitAndReportStatistics(tsc.EmitInput{ + Sys: sys, + ProgramLike: program, + Program: program, + Config: config, + ReportDiagnostic: reportDiagnostic, + ReportErrorSummary: reportErrorSummary, + Writer: sys.Writer(), + CompileTimes: compileTimes, + Testing: testing, + }) return tsc.CommandLineResult{ Status: result.Status, } diff --git a/internal/execute/tsc/compile.go b/internal/execute/tsc/compile.go index 2a3294fcfc..b624d07e73 100644 --- a/internal/execute/tsc/compile.go +++ b/internal/execute/tsc/compile.go @@ -5,8 +5,10 @@ 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/tspath" "github.com/microsoft/typescript-go/internal/vfs" ) @@ -45,7 +47,7 @@ type CommandLineResult struct { type CommandLineTesting interface { // Ensure that all emitted files are timestamped in order to ensure they are deterministic for test baseline - OnEmittedFiles(result *compiler.EmitResult) + OnEmittedFiles(result *compiler.EmitResult, mTimesCache *collections.SyncMap[tspath.Path, time.Time]) OnListFilesStart(w io.Writer) OnListFilesEnd(w io.Writer) OnStatisticsStart(w io.Writer) diff --git a/internal/execute/tsc/emit.go b/internal/execute/tsc/emit.go index f4aeba6f50..f03e25b14d 100644 --- a/internal/execute/tsc/emit.go +++ b/internal/execute/tsc/emit.go @@ -5,8 +5,10 @@ import ( "fmt" "io" "runtime" + "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/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" @@ -22,35 +24,38 @@ func GetTraceWithWriterFromSys(w io.Writer, testing CommandLineTesting) func(msg } } -func EmitAndReportStatistics( - sys System, - programLike compiler.ProgramLike, - program *compiler.Program, - config *tsoptions.ParsedCommandLine, - reportDiagnostic DiagnosticReporter, - reportErrorSummary DiagnosticsReporter, - w io.Writer, - writeFile compiler.WriteFile, - compileTimes *CompileTimes, - testing CommandLineTesting, -) (CompileAndEmitResult, *Statistics) { +type EmitInput struct { + Sys System + ProgramLike compiler.ProgramLike + Program *compiler.Program + Config *tsoptions.ParsedCommandLine + ReportDiagnostic DiagnosticReporter + ReportErrorSummary DiagnosticsReporter + Writer io.Writer + WriteFile compiler.WriteFile + CompileTimes *CompileTimes + Testing CommandLineTesting + TestingMTimesCache *collections.SyncMap[tspath.Path, time.Time] +} + +func EmitAndReportStatistics(input EmitInput) (CompileAndEmitResult, *Statistics) { var statistics *Statistics - result := EmitFilesAndReportErrors(sys, programLike, program, reportDiagnostic, reportErrorSummary, w, writeFile, compileTimes, testing) + result := EmitFilesAndReportErrors(input) if result.Status != ExitStatusSuccess { // compile exited early return result, nil } - result.times.totalTime = sys.SinceStart() + result.times.totalTime = input.Sys.SinceStart() - if config.CompilerOptions().Diagnostics.IsTrue() || config.CompilerOptions().ExtendedDiagnostics.IsTrue() { + if input.Config.CompilerOptions().Diagnostics.IsTrue() || input.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) + statistics = statisticsFromProgram(input, &memStats) + statistics.Report(input.Writer, input.Testing) } if result.EmitResult.EmitSkipped && len(result.Diagnostics) > 0 { @@ -61,87 +66,77 @@ func EmitAndReportStatistics( return result, statistics } -func EmitFilesAndReportErrors( - sys System, - programLike compiler.ProgramLike, - program *compiler.Program, - reportDiagnostic DiagnosticReporter, - reportErrorSummary DiagnosticsReporter, - w io.Writer, - writeFile compiler.WriteFile, - compileTimes *CompileTimes, - testing CommandLineTesting, -) (result CompileAndEmitResult) { - result.times = compileTimes +func EmitFilesAndReportErrors(input EmitInput) (result CompileAndEmitResult) { + result.times = input.CompileTimes ctx := context.Background() allDiagnostics := compiler.GetDiagnosticsOfAnyProgram( ctx, - programLike, + input.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) + bindStart := input.Sys.Now() + diags := input.ProgramLike.GetBindDiagnostics(ctx, file) + result.times.bindTime = input.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) + checkStart := input.Sys.Now() + diags := input.ProgramLike.GetSemanticDiagnostics(ctx, file) + result.times.checkTime = input.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{ - WriteFile: writeFile, + if !input.ProgramLike.Options().ListFilesOnly.IsTrue() { + emitStart := input.Sys.Now() + emitResult = input.ProgramLike.Emit(ctx, compiler.EmitOptions{ + WriteFile: input.WriteFile, }) - result.times.emitTime = sys.Now().Sub(emitStart) + result.times.emitTime = input.Sys.Now().Sub(emitStart) } if emitResult != nil { allDiagnostics = append(allDiagnostics, emitResult.Diagnostics...) } - if testing != nil { - testing.OnEmittedFiles(emitResult) + if input.Testing != nil { + input.Testing.OnEmittedFiles(emitResult, input.TestingMTimesCache) } allDiagnostics = compiler.SortAndDeduplicateDiagnostics(allDiagnostics) for _, diagnostic := range allDiagnostics { - reportDiagnostic(diagnostic) + input.ReportDiagnostic(diagnostic) } - listFiles(w, program, emitResult, testing) + listFiles(input, emitResult) - reportErrorSummary(allDiagnostics) + input.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) +func listFiles(input EmitInput, emitResult *compiler.EmitResult) { + if input.Testing != nil { + input.Testing.OnListFilesStart(input.Writer) + defer input.Testing.OnListFilesEnd(input.Writer) } - options := program.Options() + options := input.Program.Options() if options.ListEmittedFiles.IsTrue() { for _, file := range emitResult.EmittedFiles { - fmt.Fprintln(w, "TSFILE: ", tspath.GetNormalizedAbsolutePath(file, program.GetCurrentDirectory())) + fmt.Fprintln(input.Writer, "TSFILE: ", tspath.GetNormalizedAbsolutePath(file, input.Program.GetCurrentDirectory())) } } if options.ExplainFiles.IsTrue() { - program.ExplainFiles(w) + input.Program.ExplainFiles(input.Writer) } else if options.ListFiles.IsTrue() || options.ListFilesOnly.IsTrue() { - for _, file := range program.GetSourceFiles() { - fmt.Fprintln(w, file.FileName()) + for _, file := range input.Program.GetSourceFiles() { + fmt.Fprintln(input.Writer, file.FileName()) } } } diff --git a/internal/execute/tsc/statistics.go b/internal/execute/tsc/statistics.go index fe2e548fa1..843e1902d1 100644 --- a/internal/execute/tsc/statistics.go +++ b/internal/execute/tsc/statistics.go @@ -67,17 +67,17 @@ type Statistics struct { compileTimes *CompileTimes } -func statisticsFromProgram(program *compiler.Program, compileTimes *CompileTimes, memStats *runtime.MemStats) *Statistics { +func statisticsFromProgram(input EmitInput, 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(), + files: len(input.Program.SourceFiles()), + lines: input.Program.LineCount(), + identifiers: input.Program.IdentifierCount(), + symbols: input.Program.SymbolCount(), + types: input.Program.TypeCount(), + instantiations: input.Program.InstantiationCount(), memoryUsed: memStats.Alloc, memoryAllocs: memStats.Mallocs, - compileTimes: compileTimes, + compileTimes: input.CompileTimes, } } diff --git a/internal/execute/tsctests/sys.go b/internal/execute/tsctests/sys.go index ae4c8d3114..376b0c2330 100644 --- a/internal/execute/tsctests/sys.go +++ b/internal/execute/tsctests/sys.go @@ -218,15 +218,29 @@ func (s *testSys) GetEnvironmentVariable(name string) string { return s.env[name] } -func (s *testSys) OnEmittedFiles(result *compiler.EmitResult) { +func (s *testSys) OnEmittedFiles(result *compiler.EmitResult, mTimesCache *collections.SyncMap[tspath.Path, time.Time]) { if result != nil { for _, file := range result.EmittedFiles { + modTime := s.mapFs().GetModTime(file) + if s.serializedDiff != nil { + if diff, ok := s.serializedDiff.snap[file]; ok && diff.mTime.Equal(modTime) { + // Even though written, timestamp was reverted + continue + } + } + // Ensure that the timestamp for emitted files is in the order now := s.Now() - // !!! sheetal TODO this on buildHost so that watch can cache these times if err := s.fsFromFileMap().Chtimes(file, time.Time{}, now); err != nil { panic("Failed to change time for emitted file: " + file + ": " + err.Error()) } + // Update the mTime cache in --b mode to store the updated timestamp so tests will behave deteministically when finding newest output + if mTimesCache != nil { + path := tspath.ToPath(file, s.GetCurrentDirectory(), s.FS().UseCaseSensitiveFileNames()) + if _, found := mTimesCache.Load(path); found { + mTimesCache.Store(path, now) + } + } } } } @@ -309,9 +323,6 @@ func (s *testSys) baselinePrograms(baseline *strings.Builder) { s.programBaselines.Reset() } -func (s *testSys) baselineProgram(program *incremental.Program) { -} - func (s *testSys) serializeState(baseline *strings.Builder) { s.baselineOutput(baseline) s.baselineFSwithDiff(baseline) diff --git a/internal/execute/watcher.go b/internal/execute/watcher.go index b306a85245..1c1a97b238 100644 --- a/internal/execute/watcher.go +++ b/internal/execute/watcher.go @@ -91,7 +91,16 @@ func (w *Watcher) DoCycle() { func (w *Watcher) compileAndEmit() { // !!! output/error reporting is currently the same as non-watch mode // diagnostics, emitResult, exitStatus := - tsc.EmitFilesAndReportErrors(w.sys, w.program, w.program.GetProgram(), w.reportDiagnostic, w.reportErrorSummary, w.sys.Writer(), nil, &tsc.CompileTimes{}, w.testing) + tsc.EmitFilesAndReportErrors(tsc.EmitInput{ + Sys: w.sys, + ProgramLike: w.program, + Program: w.program.GetProgram(), + ReportDiagnostic: w.reportDiagnostic, + ReportErrorSummary: w.reportErrorSummary, + Writer: w.sys.Writer(), + CompileTimes: &tsc.CompileTimes{}, + Testing: w.testing, + }) } func (w *Watcher) hasErrorsInTsConfig() bool { diff --git a/internal/vfs/vfstest/vfstest.go b/internal/vfs/vfstest/vfstest.go index 4e8a0d7fe1..d3c3d27efe 100644 --- a/internal/vfs/vfstest/vfstest.go +++ b/internal/vfs/vfstest/vfstest.go @@ -565,6 +565,18 @@ func (m *MapFS) GetTargetOfSymlink(path string) (string, bool) { return "", false } +func (m *MapFS) GetModTime(path string) time.Time { + path, _ = strings.CutPrefix(path, "/") + m.mu.RLock() + defer m.mu.RUnlock() + canonical := m.getCanonicalPath(path) + canonicalString := string(canonical) + if fileInfo, ok := m.m[canonicalString]; ok { + return fileInfo.ModTime + } + return time.Time{} +} + func (m *MapFS) Entries() iter.Seq2[string, *fstest.MapFile] { return func(yield func(string, *fstest.MapFile) bool) { m.mu.RLock() diff --git a/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js b/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js index 19114f67c1..1ce22e6833 100644 --- a/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js +++ b/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js @@ -468,13 +468,13 @@ Output:: [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] Project 'logic/tsconfig.json' is out of date because output 'logic/tsconfig.tsbuildinfo' is older than input 'core' -[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... +[HH:MM:SS AM] Building 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] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'core' -[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... //// [/user/username/projects/sample1/core/anotherModule.d.ts] *modified* export declare const World = "hello"; @@ -565,13 +565,204 @@ export declare function multiply(a: number, b: number): number; "latestChangedDtsFile": "./index.d.ts", "size": 1819 } -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1801 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "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": 1960 +} core/tsconfig.json:: SemanticDiagnostics:: Signatures:: +logic/tsconfig.json:: +SemanticDiagnostics:: +*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:: +(used version) /user/username/projects/sample1/core/index.d.ts +(used version) /user/username/projects/sample1/core/anotherModule.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/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(used version) /user/username/projects/sample1/core/anotherModule.d.ts +(used version) /user/username/projects/sample1/logic/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts + Edit [1]:: Enable declarationMap //// [/user/username/projects/sample1/core/tsconfig.json] *modified* @@ -596,13 +787,13 @@ Output:: [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] Project 'logic/tsconfig.json' is out of date because output 'logic/tsconfig.tsbuildinfo' is older than input 'core' -[HH:MM:SS AM] Updating output timestamps of project 'logic/tsconfig.json'... +[HH:MM:SS AM] Building 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] Project 'tests/tsconfig.json' is out of date because output 'tests/tsconfig.tsbuildinfo' is older than input 'core' -[HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... //// [/user/username/projects/sample1/core/anotherModule.d.ts] *modified* export declare const World = "hello"; @@ -695,9 +886,200 @@ export declare function multiply(a: number, b: number): number; "latestChangedDtsFile": "./index.d.ts", "size": 1818 } -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* +//// [/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] *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": "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.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 +} core/tsconfig.json:: SemanticDiagnostics:: Signatures:: + +logic/tsconfig.json:: +SemanticDiagnostics:: +*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:: +(used version) /user/username/projects/sample1/core/index.d.ts +(used version) /user/username/projects/sample1/core/anotherModule.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/core/anotherModule.d.ts +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/core/index.d.ts +(used version) /user/username/projects/sample1/core/anotherModule.d.ts +(used version) /user/username/projects/sample1/logic/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts From 75ab83d2200c592928718ebeee49968a11213cbd Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 16:38:10 -0700 Subject: [PATCH 10/31] Fix the dts emit time stamp reversal found from test update --- .../execute/incremental/emitfileshandler.go | 2 +- .../sample/when-declarationMap-changes.js | 406 +----------------- 2 files changed, 13 insertions(+), 395 deletions(-) diff --git a/internal/execute/incremental/emitfileshandler.go b/internal/execute/incremental/emitfileshandler.go index 6ac6eeab2b..10129432b2 100644 --- a/internal/execute/incremental/emitfileshandler.go +++ b/internal/execute/incremental/emitfileshandler.go @@ -180,7 +180,7 @@ func (h *emitFilesHandler) getEmitOptions(options compiler.EmitOptions) compiler } else { err = h.program.program.Host().FS().WriteFile(fileName, text, writeByteOrderMark) } - if err != nil && differsOnlyInMap { + if err == nil && differsOnlyInMap { // Revert the time to original one err = h.program.host.SetMTime(fileName, aTime) } diff --git a/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js b/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js index 1ce22e6833..19114f67c1 100644 --- a/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js +++ b/testdata/baselines/reference/tsbuild/sample/when-declarationMap-changes.js @@ -468,13 +468,13 @@ Output:: [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] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies -[HH:MM:SS AM] Building project 'logic/tsconfig.json'... +[HH:MM:SS AM] Updating output timestamps of 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] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies -[HH:MM:SS AM] Building project 'tests/tsconfig.json'... +[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"; @@ -565,204 +565,13 @@ export declare function multiply(a: number, b: number): number; "latestChangedDtsFile": "./index.d.ts", "size": 1819 } -//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "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": "../core/anotherModule.d.ts", - "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", - "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1801 -} -//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "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": "../core/anotherModule.d.ts", - "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", - "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", - "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": 1960 -} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* core/tsconfig.json:: SemanticDiagnostics:: Signatures:: -logic/tsconfig.json:: -SemanticDiagnostics:: -*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:: -(used version) /user/username/projects/sample1/core/index.d.ts -(used version) /user/username/projects/sample1/core/anotherModule.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/core/anotherModule.d.ts -*refresh* /user/username/projects/sample1/logic/index.d.ts -*refresh* /user/username/projects/sample1/tests/index.ts -Signatures:: -(used version) /user/username/projects/sample1/core/index.d.ts -(used version) /user/username/projects/sample1/core/anotherModule.d.ts -(used version) /user/username/projects/sample1/logic/index.d.ts -(computed .d.ts) /user/username/projects/sample1/tests/index.ts - Edit [1]:: Enable declarationMap //// [/user/username/projects/sample1/core/tsconfig.json] *modified* @@ -787,13 +596,13 @@ Output:: [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] Project 'logic/tsconfig.json' is up to date with .d.ts files from its dependencies -[HH:MM:SS AM] Building project 'logic/tsconfig.json'... +[HH:MM:SS AM] Updating output timestamps of 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] Project 'tests/tsconfig.json' is up to date with .d.ts files from its dependencies -[HH:MM:SS AM] Building project 'tests/tsconfig.json'... +[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"; @@ -886,200 +695,9 @@ export declare function multiply(a: number, b: number): number; "latestChangedDtsFile": "./index.d.ts", "size": 1818 } -//// [/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] *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": "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.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 -} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* core/tsconfig.json:: SemanticDiagnostics:: Signatures:: - -logic/tsconfig.json:: -SemanticDiagnostics:: -*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:: -(used version) /user/username/projects/sample1/core/index.d.ts -(used version) /user/username/projects/sample1/core/anotherModule.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/core/anotherModule.d.ts -*refresh* /user/username/projects/sample1/logic/index.d.ts -*refresh* /user/username/projects/sample1/tests/index.ts -Signatures:: -(used version) /user/username/projects/sample1/core/index.d.ts -(used version) /user/username/projects/sample1/core/anotherModule.d.ts -(used version) /user/username/projects/sample1/logic/index.d.ts -(computed .d.ts) /user/username/projects/sample1/tests/index.ts From 45d6996f36fe11ba618f051de54993978f790421 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 15:08:59 -0700 Subject: [PATCH 11/31] tsc -b -w root tests porting --- internal/execute/tsctests/tscbuild_test.go | 14 + ...-referenced-project-and-shared-is-first.js | 480 ++++++++++++++++++ ...en-root-file-is-from-referenced-project.js | 480 ++++++++++++++++++ 3 files changed, 974 insertions(+) create mode 100644 testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js create mode 100644 testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js diff --git a/internal/execute/tsctests/tscbuild_test.go b/internal/execute/tsctests/tscbuild_test.go index f74979032a..757ab4daf5 100644 --- a/internal/execute/tsctests/tscbuild_test.go +++ b/internal/execute/tsctests/tscbuild_test.go @@ -2139,6 +2139,20 @@ func TestBuildRoots(t *testing.T) { commandLineArgs: []string{"--b", "projects/server", "-v", "--traceResolution", "--explainFiles"}, edits: getBuildRootsFromProjectReferencedProjectTestEdits(), }, + { + subScenario: "when root file is from referenced project", + files: getBuildRootsFromProjectReferencedProjectFileMap(true), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "-w", "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", "-w", "projects/server", "-v", "--traceResolution", "--explainFiles"}, + edits: getBuildRootsFromProjectReferencedProjectTestEdits(), + }, } for _, test := range testCases { diff --git a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js new file mode 100644 index 0000000000..914a872b2e --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js @@ -0,0 +1,480 @@ +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 -w 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 + + +Output:: + + + +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; + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; + + +Edit [2]:: no change + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; + + +Edit [3]:: delete random file +//// [/home/src/workspaces/solution/projects/shared/src/random.ts] *deleted* + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; + + +Edit [4]:: no change + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; diff --git a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js new file mode 100644 index 0000000000..c51d111b9a --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js @@ -0,0 +1,480 @@ +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 -w 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 + + +Output:: + + + +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; + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; + + +Edit [2]:: no change + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; + + +Edit [3]:: delete random file +//// [/home/src/workspaces/solution/projects/shared/src/random.ts] *deleted* + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; + + +Edit [4]:: no change + + +Output:: + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts +@@ -1,2 +1,1 @@ + export declare function log(str: string): void; +-export declare const x = 10; +--- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js ++++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js +@@ -1,8 +1,6 @@ + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +-exports.x = void 0; + exports.log = log; + function log(str) { + console.log(str); + } +-exports.x = 10; From 258a27f96ec780cdac9c42631f221a2fbc4ab4ae Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 15:09:23 -0700 Subject: [PATCH 12/31] Fix issue with noChange retaining input times in cache --- internal/collections/syncmap.go | 9 + internal/execute/build/orchestrator.go | 13 +- ...-referenced-project-and-shared-is-first.js | 519 +++++++++++++++--- ...en-root-file-is-from-referenced-project.js | 519 +++++++++++++++--- 4 files changed, 913 insertions(+), 147 deletions(-) diff --git a/internal/collections/syncmap.go b/internal/collections/syncmap.go index b28178fe62..17bbf9c4ad 100644 --- a/internal/collections/syncmap.go +++ b/internal/collections/syncmap.go @@ -71,3 +71,12 @@ func (s *SyncMap[K, V]) Keys() iter.Seq[K] { }) } } + +func (s *SyncMap[K, V]) Clone() *SyncMap[K, V] { + clone := &SyncMap[K, V]{} + s.m.Range(func(key, value any) bool { + clone.m.Store(key, value) + return true + }) + return clone +} diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index bbbbbe5390..db4381abec 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -219,7 +219,8 @@ func (o *Orchestrator) Start() tsc.CommandLineResult { } func (o *Orchestrator) Watch() { - o.updateWatchAndResetCaches() + o.updateWatch() + o.resetCaches() // Start watching for file changes if o.opts.Testing == nil { @@ -232,7 +233,7 @@ func (o *Orchestrator) Watch() { } } -func (o *Orchestrator) updateWatchAndResetCaches() { +func (o *Orchestrator) updateWatch() { oldCache := o.host.mTimes o.host.mTimes = &collections.SyncMap[tspath.Path, time.Time]{} wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) @@ -243,7 +244,9 @@ func (o *Orchestrator) updateWatchAndResetCaches() { return true }) wg.RunAndWait() +} +func (o *Orchestrator) resetCaches() { // Clean out all the caches cachesVfs := o.host.host.FS().(*cachedvfs.FS) cachesVfs.ClearCache() @@ -255,6 +258,7 @@ func (o *Orchestrator) updateWatchAndResetCaches() { func (o *Orchestrator) DoCycle() { var needsConfigUpdate atomic.Bool var needsUpdate atomic.Bool + mTimes := o.host.mTimes.Clone() wg := core.NewWorkGroup(o.opts.Command.CompilerOptions.SingleThreaded.IsTrue()) o.tasks.Range(func(path tspath.Path, task *buildTask) bool { wg.Queue(func() { @@ -271,6 +275,8 @@ func (o *Orchestrator) DoCycle() { wg.RunAndWait() if !needsUpdate.Load() { + o.host.mTimes = mTimes + o.resetCaches() return } @@ -279,7 +285,8 @@ func (o *Orchestrator) DoCycle() { o.GenerateGraphReusingOldTasks() } o.buildOrClean() - o.updateWatchAndResetCaches() + o.updateWatch() + o.resetCaches() } func (o *Orchestrator) buildOrClean() tsc.CommandLineResult { diff --git a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js index 914a872b2e..69c40a1c66 100644 --- a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js +++ b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js @@ -379,52 +379,264 @@ export function log(str: string) { 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'... -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; +../../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'... -Edit [2]:: no change +======== 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; -Output:: +//// [/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 -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; +Edit [2]:: no change + + +Output:: + Edit [3]:: delete random file @@ -432,49 +644,212 @@ Edit [3]:: delete random file 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'... -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; +../../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'... -Edit [4]:: no change +======== 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:: -Output:: + +Edit [4]:: no change +Output:: -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; diff --git a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js index c51d111b9a..84642fd28a 100644 --- a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js +++ b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js @@ -379,52 +379,264 @@ export function log(str: string) { 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'... -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; +../../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'... -Edit [2]:: no change +======== 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; -Output:: +//// [/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 -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; +Edit [2]:: no change + + +Output:: + Edit [3]:: delete random file @@ -432,49 +644,212 @@ Edit [3]:: delete random file 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'... -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; +../../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'... -Edit [4]:: no change +======== 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:: -Output:: + +Edit [4]:: no change +Output:: -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.d.ts -@@ -1,2 +1,1 @@ - export declare function log(str: string): void; --export declare const x = 10; ---- nonIncremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -+++ incremental /home/src/workspaces/solution/projects/shared/dist/src/logging.js -@@ -1,8 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); --exports.x = void 0; - exports.log = log; - function log(str) { - console.log(str); - } --exports.x = 10; From 69fd252eb32392073700ce2de67547fda651390f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 16:47:17 -0700 Subject: [PATCH 13/31] reexport test --- internal/execute/tsctests/tscbuild_test.go | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/internal/execute/tsctests/tscbuild_test.go b/internal/execute/tsctests/tscbuild_test.go index 757ab4daf5..c69bbaceec 100644 --- a/internal/execute/tsctests/tscbuild_test.go +++ b/internal/execute/tsctests/tscbuild_test.go @@ -1734,6 +1734,75 @@ func TestBuildProjectReferenceWithRootDirInParent(t *testing.T) { } } +func TestBuildReexport(t *testing.T) { + t.Parallel() + testCases := []*tscInput{ + { + subScenario: "Reports errors correctly", + files: FileMap{ + "/user/username/projects/reexport/src/tsconfig.json": stringtestutil.Dedent(` + { + "files": [], + "include": [], + "references": [{ "path": "./pure" }, { "path": "./main" }], + }`), + "/user/username/projects/reexport/src/main/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "outDir": "../../out", + "rootDir": "../", + }, + "include": ["**/*.ts"], + "references": [{ "path": "../pure" }], + }`), + "/user/username/projects/reexport/src/main/index.ts": stringtestutil.Dedent(` + import { Session } from "../pure"; + + export const session: Session = { + foo: 1 + }; + `), + "/user/username/projects/reexport/src/pure/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "../../out", + "rootDir": "../", + }, + "include": ["**/*.ts"], + }`), + "/user/username/projects/reexport/src/pure/index.ts": `export * from "./session";`, + "/user/username/projects/reexport/src/pure/session.ts": stringtestutil.Dedent(` + export interface Session { + foo: number; + // bar: number; + } + `), + }, + cwd: `/user/username/projects/reexport`, + commandLineArgs: []string{"-b", "-w", "-verbose", "src"}, + edits: []*tscEdit{ + { + caption: "Introduce error", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/reexport/src/pure/session.ts`, "// ", "") + }, + }, + { + caption: "Fix error", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/reexport/src/pure/session.ts`, "bar: ", "// bar: ") + }, + }, + }, + }, + } + + for _, test := range testCases { + test.run(t, "reexport") + } +} + func TestBuildResolveJsonModule(t *testing.T) { t.Parallel() type buildResolveJsonModuleScenario struct { From 77cbab1dea6a9a24b9ec04800d565f4561eb6dd5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 Aug 2025 22:34:34 -0700 Subject: [PATCH 14/31] Fix incorrect resets for errors --- internal/execute/build/buildtask.go | 3 +- internal/execute/build/uptodatestatus.go | 2 +- .../reexport/Reports-errors-correctly.js | 527 ++++++++++++++++++ 3 files changed, 530 insertions(+), 2 deletions(-) create mode 100644 testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 0a5682eb3b..10e0c6968f 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -185,7 +185,6 @@ func (t *buildTask) updateDownstream(orchestrator *Orchestrator, path tspath.Pat upToDateStatusTypeUpToDateWithInputFileText: if t.program.HasChangedDtsFile() { downStream.status = &upToDateStatus{kind: upToDateStatusTypeInputFileNewer, data: &inputOutputName{t.config, downStream.status.oldestOutputFileName()}} - downStream.errors = nil } case upToDateStatusTypeUpstreamErrors: upstreamErrors := downStream.status.upstreamErrors() @@ -201,6 +200,7 @@ func (t *buildTask) updateDownstream(orchestrator *Orchestrator, path tspath.Pat } func (t *buildTask) compileAndEmit(orchestrator *Orchestrator, path tspath.Path) { + t.errors = nil if orchestrator.opts.Command.BuildOptions.Verbose.IsTrue() { t.reportStatus(ast.NewCompilerDiagnostic(diagnostics.Building_project_0, orchestrator.relativeFileName(t.config))) } @@ -740,6 +740,7 @@ func (t *buildTask) resetStatus() { func (t *buildTask) resetConfig(orchestrator *Orchestrator, path tspath.Path) { t.dirty = true orchestrator.host.resolvedReferences.Delete(path) + t.pending.Store(true) } func (t *buildTask) hasUpdate(orchestrator *Orchestrator, path tspath.Path) updateKind { diff --git a/internal/execute/build/uptodatestatus.go b/internal/execute/build/uptodatestatus.go index 8c843ce118..ca3477874d 100644 --- a/internal/execute/build/uptodatestatus.go +++ b/internal/execute/build/uptodatestatus.go @@ -115,7 +115,7 @@ func (s *upToDateStatus) inputOutputName() *inputOutputName { } func (s *upToDateStatus) oldestOutputFileName() string { - if !s.isPseudoBuild() || s.kind != upToDateStatusTypeUpToDate { + if !s.isPseudoBuild() && s.kind != upToDateStatusTypeUpToDate { panic("only valid for up to date status of pseudo-build or up to date") } diff --git a/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js b/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js new file mode 100644 index 0000000000..620b00b4df --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js @@ -0,0 +1,527 @@ +currentDirectory::/user/username/projects/reexport +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/reexport/src/main/index.ts] *new* +import { Session } from "../pure"; + +export const session: Session = { + foo: 1 +}; +//// [/user/username/projects/reexport/src/main/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "../../out", + "rootDir": "../", + }, + "include": ["**/*.ts"], + "references": [{ "path": "../pure" }], +} +//// [/user/username/projects/reexport/src/pure/index.ts] *new* +export * from "./session"; +//// [/user/username/projects/reexport/src/pure/session.ts] *new* +export interface Session { + foo: number; + // bar: number; +} +//// [/user/username/projects/reexport/src/pure/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "../../out", + "rootDir": "../", + }, + "include": ["**/*.ts"], +} +//// [/user/username/projects/reexport/src/tsconfig.json] *new* +{ + "files": [], + "include": [], + "references": [{ "path": "./pure" }, { "path": "./main" }], +} + +tsgo -b -w -verbose src +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * src/pure/tsconfig.json + * src/main/tsconfig.json + * src/tsconfig.json + +[HH:MM:SS AM] Project 'src/pure/tsconfig.json' is out of date because output file 'out/pure/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/pure/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/main/tsconfig.json' is out of date because output file 'out/main/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'src/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; }; +//// [/user/username/projects/reexport/out/main/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.session = void 0; +exports.session = { + foo: 1 +}; + +//// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["../../src/main/index.ts"]} +//// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/main/index.ts" + ], + "original": "../../src/main/index.ts" + } + ], + "size": 62 +} +//// [/user/username/projects/reexport/out/pure/index.d.ts] *new* +export * from "./session"; + +//// [/user/username/projects/reexport/out/pure/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("./session"), exports); + +//// [/user/username/projects/reexport/out/pure/session.d.ts] *new* +export interface Session { + foo: number; +} + +//// [/user/username/projects/reexport/out/pure/session.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../src/pure/session.ts","../../src/pure/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":"1beb34deefa28062ed4b4b605c69e42f-export interface Session {\n foo: number;\n // bar: number;\n}","signature":"90b43415bdb2993dfd8c888e444ab471-export interface Session {\n foo: number;\n}\n","impliedNodeFormat":1},{"version":"c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";","signature":"14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"..","rootDir":"../../src"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/pure/session.ts", + "../../src/pure/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../src/pure/session.ts", + "../../src/pure/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/pure/session.ts", + "version": "1beb34deefa28062ed4b4b605c69e42f-export interface Session {\n foo: number;\n // bar: number;\n}", + "signature": "90b43415bdb2993dfd8c888e444ab471-export interface Session {\n foo: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1beb34deefa28062ed4b4b605c69e42f-export interface Session {\n foo: number;\n // bar: number;\n}", + "signature": "90b43415bdb2993dfd8c888e444ab471-export interface Session {\n foo: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../src/pure/index.ts", + "version": "c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";", + "signature": "14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";", + "signature": "14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../src/pure/session.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../src" + }, + "referencedMap": { + "../../src/pure/index.ts": [ + "../../src/pure/session.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1463 +} + +src/pure/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/reexport/src/pure/session.ts +*refresh* /user/username/projects/reexport/src/pure/index.ts +Signatures:: +(stored at emit) /user/username/projects/reexport/src/pure/session.ts +(stored at emit) /user/username/projects/reexport/src/pure/index.ts + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/reexport/out/pure/session.d.ts +*refresh* /user/username/projects/reexport/out/pure/index.d.ts +*refresh* /user/username/projects/reexport/src/main/index.ts +Signatures:: + + +Edit [0]:: Introduce error +//// [/user/username/projects/reexport/src/pure/session.ts] *modified* +export interface Session { + foo: number; + bar: number; +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * src/pure/tsconfig.json + * src/main/tsconfig.json + * src/tsconfig.json + +[HH:MM:SS AM] Project 'src/pure/tsconfig.json' is out of date because output 'out/pure/tsconfig.tsbuildinfo' is older than input 'src/pure/session.ts' + +[HH:MM:SS AM] Building project 'src/pure/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/main/tsconfig.json' is out of date because output 'out/main/index.js' is older than input 'src/pure/tsconfig.json' + +[HH:MM:SS AM] Building project 'src/main/tsconfig.json'... + +src/main/index.ts:3:14 - error TS2741: Property 'bar' is missing in type '{ foo: number; }' but required in type 'Session'. + +3 export const session: Session = { +   ~~~~~~~ + + out/pure/session.d.ts:3:5 - 'bar' is declared here. + 3 bar: number; +    ~~~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'src/main/tsconfig.json'... + + +Found 1 error in src/main/index.ts:3 + +//// [/user/username/projects/reexport/out/main/index.js] *mTime changed* +//// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["../../src/main/index.ts"],"semanticErrors":true} +//// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/main/index.ts" + ], + "original": "../../src/main/index.ts" + } + ], + "size": 84, + "semanticErrors": true +} +//// [/user/username/projects/reexport/out/pure/index.js] *rewrite with same content* +//// [/user/username/projects/reexport/out/pure/session.d.ts] *modified* +export interface Session { + foo: number; + bar: number; +} + +//// [/user/username/projects/reexport/out/pure/session.js] *rewrite with same content* +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../src/pure/session.ts","../../src/pure/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":"f993dc94313f77cb079d7ee366b10997-export interface Session {\n foo: number;\n bar: number;\n}","signature":"5daeec8bad73c67127f3b3aae951c919-export interface Session {\n foo: number;\n bar: number;\n}\n","impliedNodeFormat":1},{"version":"c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";","signature":"14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"..","rootDir":"../../src"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./session.d.ts"} +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/pure/session.ts", + "../../src/pure/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../src/pure/session.ts", + "../../src/pure/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/pure/session.ts", + "version": "f993dc94313f77cb079d7ee366b10997-export interface Session {\n foo: number;\n bar: number;\n}", + "signature": "5daeec8bad73c67127f3b3aae951c919-export interface Session {\n foo: number;\n bar: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "f993dc94313f77cb079d7ee366b10997-export interface Session {\n foo: number;\n bar: number;\n}", + "signature": "5daeec8bad73c67127f3b3aae951c919-export interface Session {\n foo: number;\n bar: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../src/pure/index.ts", + "version": "c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";", + "signature": "14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";", + "signature": "14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../src/pure/session.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../src" + }, + "referencedMap": { + "../../src/pure/index.ts": [ + "../../src/pure/session.ts" + ] + }, + "latestChangedDtsFile": "./session.d.ts", + "size": 1480 +} + +src/pure/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/reexport/src/pure/session.ts +*refresh* /user/username/projects/reexport/src/pure/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/reexport/src/pure/session.ts +(computed .d.ts) /user/username/projects/reexport/src/pure/index.ts + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/reexport/out/pure/session.d.ts +*refresh* /user/username/projects/reexport/out/pure/index.d.ts +*refresh* /user/username/projects/reexport/src/main/index.ts +Signatures:: +(used version) /user/username/projects/reexport/out/pure/session.d.ts +(used version) /user/username/projects/reexport/out/pure/index.d.ts +(used version) /user/username/projects/reexport/src/main/index.ts + + +Edit [1]:: Fix error +//// [/user/username/projects/reexport/src/pure/session.ts] *modified* +export interface Session { + foo: number; + // bar: number; +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * src/pure/tsconfig.json + * src/main/tsconfig.json + * src/tsconfig.json + +[HH:MM:SS AM] Project 'src/pure/tsconfig.json' is out of date because output 'out/pure/tsconfig.tsbuildinfo' is older than input 'src/pure/session.ts' + +[HH:MM:SS AM] Building project 'src/pure/tsconfig.json'... + +[HH:MM:SS AM] Project 'src/main/tsconfig.json' is out of date because it has errors. + +[HH:MM:SS AM] Building project 'src/main/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'src/main/tsconfig.json'... + +//// [/user/username/projects/reexport/out/main/index.js] *mTime changed* +//// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["../../src/main/index.ts"]} +//// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/main/index.ts" + ], + "original": "../../src/main/index.ts" + } + ], + "size": 62 +} +//// [/user/username/projects/reexport/out/pure/index.js] *rewrite with same content* +//// [/user/username/projects/reexport/out/pure/session.d.ts] *modified* +export interface Session { + foo: number; +} + +//// [/user/username/projects/reexport/out/pure/session.js] *rewrite with same content* +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","../../src/pure/session.ts","../../src/pure/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":"1beb34deefa28062ed4b4b605c69e42f-export interface Session {\n foo: number;\n // bar: number;\n}","signature":"90b43415bdb2993dfd8c888e444ab471-export interface Session {\n foo: number;\n}\n","impliedNodeFormat":1},{"version":"c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";","signature":"14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"..","rootDir":"../../src"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./session.d.ts"} +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../../src/pure/session.ts", + "../../src/pure/index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../../src/pure/session.ts", + "../../src/pure/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/pure/session.ts", + "version": "1beb34deefa28062ed4b4b605c69e42f-export interface Session {\n foo: number;\n // bar: number;\n}", + "signature": "90b43415bdb2993dfd8c888e444ab471-export interface Session {\n foo: number;\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1beb34deefa28062ed4b4b605c69e42f-export interface Session {\n foo: number;\n // bar: number;\n}", + "signature": "90b43415bdb2993dfd8c888e444ab471-export interface Session {\n foo: number;\n}\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../../src/pure/index.ts", + "version": "c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";", + "signature": "14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c3b7227625b1dcb56b6fb13c17c504fe-export * from \"./session\";", + "signature": "14ab788547e1e852fa86d4bf1731e8c8-export * from \"./session\";\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../../src/pure/session.ts" + ] + ], + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../src" + }, + "referencedMap": { + "../../src/pure/index.ts": [ + "../../src/pure/session.ts" + ] + }, + "latestChangedDtsFile": "./session.d.ts", + "size": 1465 +} + +src/pure/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/reexport/src/pure/session.ts +*refresh* /user/username/projects/reexport/src/pure/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/reexport/src/pure/session.ts +(computed .d.ts) /user/username/projects/reexport/src/pure/index.ts + +src/main/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/reexport/out/pure/session.d.ts +*refresh* /user/username/projects/reexport/out/pure/index.d.ts +*refresh* /user/username/projects/reexport/src/main/index.ts +Signatures:: +(used version) /user/username/projects/reexport/out/pure/session.d.ts +(used version) /user/username/projects/reexport/out/pure/index.d.ts +(used version) /user/username/projects/reexport/src/main/index.ts From 38554fc12317ea6b287b8c74a954c8c729f7d14b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 29 Aug 2025 12:51:05 -0700 Subject: [PATCH 15/31] tsc -b -w program updates tests --- internal/execute/tsctests/sys.go | 9 + internal/execute/tsctests/tscbuild_test.go | 788 +++++++++- ...ceError-when-file-with-no-error-changes.js | 423 ++++++ ...ing-errors-only-changed-file-is-emitted.js | 385 +++++ ...tErrors-when-file-with-no-error-changes.js | 326 ++++ ...ixing-error-files-all-files-are-emitted.js | 288 ++++ .../programUpdates/tsbuildinfo-has-error.js | 87 ++ ...e-down-stream-project-and-then-fixes-it.js | 394 +++++ ...project-with-extended-config-is-removed.js | 263 ++++ ...hen-noUnusedParameters-changes-to-false.js | 105 ++ .../works-with-extended-source-files.js | 549 +++++++ ...equent-updates-with-circular-references.js | 677 +++++++++ ...le-is-added,-and-its-subsequent-updates.js | 690 +++++++++ ...errors-message-with-circular-references.js | 1332 ++++++++++++++++ ...hanges-and-reports-found-errors-message.js | 1349 +++++++++++++++++ .../incremental-updates-in-verbose-mode.js | 803 ++++++++++ ...ncing-projects-with-circular-references.js | 532 +++++++ ...not-start-build-of-referencing-projects.js | 540 +++++++ ...rs-when-preserveWatchOutput-is-not-used.js | 829 ++++++++++ ...veWatchOutput-is-passed-on-command-line.js | 829 ++++++++++ ...BuildOnErrors-is-passed-on-command-line.js | 748 +++++++++ ...e-of-program-emit-with-outDir-specified.js | 342 +++++ ...r-recompilation-because-of-program-emit.js | 354 +++++ ...rrors-when-test-does-not-reference-core.js | 605 ++++++++ ...ects-have-errors-with-stopBuildOnErrors.js | 606 ++++++++ ...tches-config-files-that-are-not-present.js | 575 +++++++ 26 files changed, 14366 insertions(+), 62 deletions(-) create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js create mode 100644 testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js create mode 100644 testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js diff --git a/internal/execute/tsctests/sys.go b/internal/execute/tsctests/sys.go index 376b0c2330..b7b462cb33 100644 --- a/internal/execute/tsctests/sys.go +++ b/internal/execute/tsctests/sys.go @@ -551,6 +551,15 @@ func (s *testSys) replaceFileText(path string, oldText string, newText string) { s.writeFileNoError(path, content, false) } +func (s *testSys) replaceFileTextAll(path string, oldText string, newText string) { + content, ok := s.fsFromFileMap().ReadFile(path) + if !ok { + panic("File not found: " + path) + } + content = strings.ReplaceAll(content, oldText, newText) + s.writeFileNoError(path, content, false) +} + func (s *testSys) appendFile(path string, text string) { content, ok := s.fsFromFileMap().ReadFile(path) if !ok { diff --git a/internal/execute/tsctests/tscbuild_test.go b/internal/execute/tsctests/tscbuild_test.go index c69bbaceec..c41e730350 100644 --- a/internal/execute/tsctests/tscbuild_test.go +++ b/internal/execute/tsctests/tscbuild_test.go @@ -1582,6 +1582,439 @@ func TestBuildOutputPaths(t *testing.T) { } } +func TestBuildProgramUpdates(t *testing.T) { + t.Parallel() + testCases := []*tscInput{ + { + subScenario: "when referenced project change introduces error in the down stream project and then fixes it", + files: FileMap{ + "/user/username/projects/sample1/Library/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + "/user/username/projects/sample1/Library/library.ts": stringtestutil.Dedent(` + interface SomeObject + { + message: string; + } + + export function createSomeObject(): SomeObject + { + return { + message: "new Object" + }; + } + `), + "/user/username/projects/sample1/App/tsconfig.json": stringtestutil.Dedent(` + { + "references": [{ "path": "../Library" }] + }`), + "/user/username/projects/sample1/App/app.ts": stringtestutil.Dedent(` + import { createSomeObject } from "../Library/library"; + createSomeObject().message; + `), + }, + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"-b", "-w", "App"}, + edits: []*tscEdit{ + { + caption: "Introduce error", + // Change message in library to message2 + edit: func(sys *testSys) { + sys.replaceFileTextAll("/user/username/projects/sample1/Library/library.ts", "message", "message2") + }, + }, + { + caption: "Fix error", + // Revert library changes + edit: func(sys *testSys) { + sys.replaceFileTextAll("/user/username/projects/sample1/Library/library.ts", "message2", "message") + }, + }, + }, + }, + { + subScenario: "declarationEmitErrors when fixing error files all files are emitted", + files: FileMap{ + "/user/username/projects/solution/app/fileWithError.ts": stringtestutil.Dedent(` + export var myClassWithError = class { + tags() { } + private p = 12 + }; + `), + "/user/username/projects/solution/app/fileWithoutError.ts": "export class myClass { }", + "/user/username/projects/solution/app/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + }, + cwd: "/user/username/projects/solution", + commandLineArgs: []string{"-b", "-w", "app"}, + edits: []*tscEdit{ + { + caption: "Fix error", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/solution/app/fileWithError.ts", "private p = 12", "") + }, + }, + }, + }, + { + subScenario: "declarationEmitErrors when file with no error changes", + files: FileMap{ + "/user/username/projects/solution/app/fileWithError.ts": stringtestutil.Dedent(` + export var myClassWithError = class { + tags() { } + private p = 12 + }; + `), + "/user/username/projects/solution/app/fileWithoutError.ts": "export class myClass { }", + "/user/username/projects/solution/app/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + }, + cwd: "/user/username/projects/solution", + commandLineArgs: []string{"-b", "-w", "app"}, + edits: []*tscEdit{ + { + caption: "Change fileWithoutError", + edit: func(sys *testSys) { + sys.replaceFileTextAll("/user/username/projects/solution/app/fileWithoutError.ts", "myClass", "myClass2") + }, + }, + }, + }, + { + subScenario: "declarationEmitErrors introduceError when fixing errors only changed file is emitted", + files: FileMap{ + "/user/username/projects/solution/app/fileWithError.ts": stringtestutil.Dedent(` + export var myClassWithError = class { + tags() { } + + }; + `), + "/user/username/projects/solution/app/fileWithoutError.ts": "export class myClass { }", + "/user/username/projects/solution/app/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + }, + cwd: "/user/username/projects/solution", + commandLineArgs: []string{"-b", "-w", "app"}, + edits: []*tscEdit{ + { + caption: "Introduce error", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/solution/app/fileWithError.ts", stringtestutil.Dedent(` + export var myClassWithError = class { + tags() { } + private p = 12 + }; + `), false) + }, + }, + { + caption: "Fix error", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/solution/app/fileWithError.ts", "private p = 12", "") + }, + }, + }, + }, + { + subScenario: "declarationEmitErrors introduceError when file with no error changes", + files: FileMap{ + "/user/username/projects/solution/app/fileWithError.ts": stringtestutil.Dedent(` + export var myClassWithError = class { + tags() { } + + }; + `), + "/user/username/projects/solution/app/fileWithoutError.ts": "export class myClass { }", + "/user/username/projects/solution/app/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true + } + }`), + }, + cwd: "/user/username/projects/solution", + commandLineArgs: []string{"-b", "-w", "app"}, + edits: []*tscEdit{ + { + caption: "Introduce error", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/solution/app/fileWithError.ts", stringtestutil.Dedent(` + export var myClassWithError = class { + tags() { } + private p = 12 + }; + `), false) + }, + }, + { + caption: "Change fileWithoutError", + edit: func(sys *testSys) { + sys.replaceFileTextAll("/user/username/projects/solution/app/fileWithoutError.ts", "myClass", "myClass2") + }, + }, + }, + }, + { + subScenario: "works when noUnusedParameters changes to false", + files: FileMap{ + "/user/username/projects/myproject/index.ts": `const fn = (a: string, b: string) => b;`, + "/user/username/projects/myproject/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "noUnusedParameters": true, + }, + }`), + }, + cwd: "/user/username/projects/myproject", + commandLineArgs: []string{"-b", "-w"}, + + edits: []*tscEdit{ + { + caption: "Change tsconfig to set noUnusedParameters to false", + edit: func(sys *testSys) { + sys.writeFileNoError( + `/user/username/projects/myproject/tsconfig.json`, + stringtestutil.Dedent(` + { + "compilerOptions": { + "noUnusedParameters": false, + }, + }`), + false, + ) + }, + }, + }, + }, + { + subScenario: "works with extended source files", + cwd: "/user/username/projects/project", + files: FileMap{ + "/user/username/projects/project/commonFile1.ts": "let x = 1", + "/user/username/projects/project/commonFile2.ts": "let y = 1", + "/user/username/projects/project/alpha.tsconfig.json": "{}", + "/user/username/projects/project/project1.tsconfig.json": stringtestutil.Dedent(` + { + "extends": "./alpha.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["commonFile1.ts", "commonFile2.ts"], + } + `), + "/user/username/projects/project/bravo.tsconfig.json": stringtestutil.Dedent(` + { + "extends": "./alpha.tsconfig.json", + } + `), + "/user/username/projects/project/other.ts": "let z = 0;", + "/user/username/projects/project/project2.tsconfig.json": stringtestutil.Dedent(` + { + "extends": "./bravo.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["other.ts"], + } + `), + "/user/username/projects/project/other2.ts": "let k = 0;", + "/user/username/projects/project/extendsConfig1.tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + }, + } + `), + "/user/username/projects/project/extendsConfig2.tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strictNullChecks": false, + }, + } + `), + "/user/username/projects/project/extendsConfig3.tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "noImplicitAny": true, + }, + } + `), + "/user/username/projects/project/project3.tsconfig.json": stringtestutil.Dedent(` + { + "extends": [ + "./extendsConfig1.tsconfig.json", + "./extendsConfig2.tsconfig.json", + "./extendsConfig3.tsconfig.json", + ], + "compilerOptions": { + "composite": false, + }, + "files": ["other2.ts"], + }`), + }, + commandLineArgs: []string{"-b", "-w", "-v", "project1.tsconfig.json", "project2.tsconfig.json", "project3.tsconfig.json"}, + edits: []*tscEdit{ + { + caption: "Modify alpha config", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/project/alpha.tsconfig.json", stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true + } + }`), false) + }, + }, + { + caption: "change bravo config", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/project/bravo.tsconfig.json", stringtestutil.Dedent(` + { + "extends": "./alpha.tsconfig.json", + "compilerOptions": { "strict": false } + }`), false) + }, + }, + { + caption: "project 2 extends alpha", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/project/project2.tsconfig.json", stringtestutil.Dedent(` + { + "extends": "./alpha.tsconfig.json", + }`), false) + }, + }, + { + caption: "update aplha config", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/project/alpha.tsconfig.json", "{}", false) + }, + }, + { + caption: "Modify extendsConfigFile2", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/project/extendsConfig2.tsconfig.json", stringtestutil.Dedent(` + { + "compilerOptions": { "strictNullChecks": true } + }`), false) + }, + }, + { + caption: "Modify project 3", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/project/project3.tsconfig.json", stringtestutil.Dedent(` + { + "extends": ["./extendsConfig1.tsconfig.json", "./extendsConfig2.tsconfig.json"], + "compilerOptions": { "composite": false }, + "files": ["other2.ts"], + }`), false) + }, + }, + { + caption: "Delete extendedConfigFile2 and report error", + edit: func(sys *testSys) { + sys.removeNoError("/user/username/projects/project/extendsConfig2.tsconfig.json") + }, + }, + }, + }, + { + subScenario: "works correctly when project with extended config is removed", + files: FileMap{ + "/user/username/projects/project/commonFile1.ts": "let x = 1", + "/user/username/projects/project/commonFile2.ts": "let y = 1", + "/user/username/projects/project/alpha.tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true, + }, + }`), + "/user/username/projects/project/project1.tsconfig.json": stringtestutil.Dedent(` + { + "extends": "./alpha.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["commonFile1.ts", "commonFile2.ts"], + }`), + "/user/username/projects/project/bravo.tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "strict": true, + }, + }`), + "/user/username/projects/project/other.ts": "let z = 0;", + "/user/username/projects/project/project2.tsconfig.json": stringtestutil.Dedent(` + { + "extends": "./bravo.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["other.ts"], + }`), + "/user/username/projects/project/tsconfig.json": stringtestutil.Dedent(` + { + "references": [ + { + "path": "./project1.tsconfig.json", + }, + { + "path": "./project2.tsconfig.json", + }, + ], + "files": [], + }`), + }, + cwd: "/user/username/projects/project", + commandLineArgs: []string{"-b", "-w", "-v"}, + edits: []*tscEdit{ + { + caption: "Remove project2 from base config", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/project/tsconfig.json", stringtestutil.Dedent(` + { + "references": [ + { + "path": "./project1.tsconfig.json", + }, + ], + "files": [], + }`), false) + }, + }, + }, + }, + { + subScenario: "tsbuildinfo has error", + files: FileMap{ + "/user/username/projects/project/main.ts": "export const x = 10;", + "/user/username/projects/project/tsconfig.json": "{}", + "/user/username/projects/project/tsconfig.tsbuildinfo": "Some random string", + }, + cwd: "/user/username/projects/project", + commandLineArgs: []string{"--b", "-i", "-w"}, + }, + } + for _, test := range testCases { + test.run(t, "programUpdates") + } +} + func TestBuildProjectReferenceWithRootDirInParent(t *testing.T) { t.Parallel() getBuildProjectReferenceWithRootDirInParentFileMap := func(modify func(files FileMap)) FileMap { @@ -2232,6 +2665,21 @@ func TestBuildRoots(t *testing.T) { func TestBuildSample(t *testing.T) { t.Parallel() + getLogicConfig := func() string { + return stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], + }`) + } + getBuildSampleFileMap := func(modify func(files FileMap)) FileMap { files := FileMap{ "/user/username/projects/sample1/core/tsconfig.json": stringtestutil.Dedent(` @@ -2250,18 +2698,7 @@ func TestBuildSample(t *testing.T) { `), "/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/tsconfig.json": getLogicConfig(), "/user/username/projects/sample1/logic/index.ts": stringtestutil.Dedent(` import * as c from '../core/index'; export function getSecondsInDay() { @@ -2299,6 +2736,63 @@ func TestBuildSample(t *testing.T) { } return files } + getStopBuildOnErrorTests := func(options []string) []*tscInput { + noChange := core.IfElse(options == nil, noChangeOnlyEdit, nil) + return []*tscInput{ + { + 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: slices.Concat([]string{"--b", "tests", "--verbose", "--stopBuildOnErrors"}, options), + edits: slices.Concat( + noChange, + []*tscEdit{ + { + 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: slices.Concat([]string{"--b", "tests", "--verbose", "--stopBuildOnErrors"}, options), + edits: slices.Concat( + noChange, + []*tscEdit{ + { + caption: "fix error", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/index.ts", "multiply();", "") + }, + }, + }, + ), + }, + } + } getBuildSampleCoreChangeEdits := func() []*tscEdit { return []*tscEdit{ { @@ -2324,7 +2818,104 @@ class someClass2 { }`, noChange, } } - testCases := []*tscInput{ + getBuildSampleWatchDtsChangingEdits := func() []*tscEdit { + return []*tscEdit{ + { + caption: "Make change to core", + edit: func(sys *testSys) { + sys.appendFile("/user/username/projects/sample1/core/index.ts", "\nexport class someClass { }") + }, + }, + { + caption: "Revert core file", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/core/index.ts", "\nexport class someClass { }", "") + }, + }, + { + caption: "Make two changes", + edit: func(sys *testSys) { + sys.appendFile("/user/username/projects/sample1/core/index.ts", "\nexport class someClass { }") + sys.appendFile("/user/username/projects/sample1/core/index.ts", "\nexport class someClass2 { }") + }, + }, + } + } + getBuildSampleWatchNonDtsChangingEdits := func() []*tscEdit { + return []*tscEdit{ + { + caption: "Make local change to core", + edit: func(sys *testSys) { + sys.appendFile("/user/username/projects/sample1/core/index.ts", "\nfunction foo() { }") + }, + }, + } + } + getBuildSampleWatchNewFileEdits := func() []*tscEdit { + return []*tscEdit{ + { + caption: "Change to new File and build core", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/sample1/core/newfile.ts", `export const newFileConst = 30;`, false) + }, + }, + { + caption: "Change to new File and build core", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/sample1/core/newfile.ts", "\nexport class someClass2 { }", false) + }, + }, + } + } + makeCircularReferences := func(files FileMap) { + files["/user/username/projects/sample1/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "declaration": true + }, + "references": [ + { "path": "../tests", "circular": true } + ], + }`) + } + getIncrementalErrorTest := func(subScenario string, options []string) *tscInput { + var expectedDiffWithLogicError string + if slices.Contains(options, "--stopBuildOnErrors") { + expectedDiffWithLogicError = stringtestutil.Dedent(` + Clean build will stop on error in core and will not report error in logic + Watch build will retain previous errors from logic and report it + `) + } + return &tscInput{ + subScenario: "reportErrors " + subScenario, + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: slices.Concat([]string{"-b", "-w", "tests"}, options), + edits: []*tscEdit{ + { + caption: "change logic", + edit: func(sys *testSys) { + sys.appendFile("/user/username/projects/sample1/logic/index.ts", "\nlet y: string = 10;") + }, + }, + { + caption: "change core", + edit: func(sys *testSys) { + sys.appendFile("/user/username/projects/sample1/core/index.ts", "\nlet x: string = 10;") + }, + expectedDiff: expectedDiffWithLogicError, + }, + { + caption: "fix error in logic", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/logic/index.ts", "\nlet y: string = 10;", "") + }, + }, + }, + } + } + testCases := slices.Concat([]*tscInput{ { subScenario: "builds correctly when outDir is specified", files: getBuildSampleFileMap(func(files FileMap) { @@ -2579,54 +3170,6 @@ class someClass2 { }`, 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), @@ -2815,7 +3358,128 @@ class someClass2 { }`, cwd: "/user/username/projects/sample1", commandLineArgs: []string{"--b", "tests", "--verbose", "--force"}, }, - } + { + subScenario: "change builds changes and reports found errors message", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests"}, + edits: getBuildSampleWatchDtsChangingEdits(), + }, + { + subScenario: "non local change does not start build of referencing projects", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests"}, + edits: getBuildSampleWatchNonDtsChangingEdits(), + }, + { + subScenario: "builds when new file is added, and its subsequent updates", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests"}, + edits: getBuildSampleWatchNewFileEdits(), + }, + { + subScenario: "change builds changes and reports found errors message with circular references", + files: getBuildSampleFileMap(makeCircularReferences), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests"}, + edits: getBuildSampleWatchDtsChangingEdits(), + }, + { + subScenario: "non local change does not start build of referencing projects with circular references", + files: getBuildSampleFileMap(makeCircularReferences), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests"}, + edits: getBuildSampleWatchNonDtsChangingEdits(), + }, + { + subScenario: "builds when new file is added, and its subsequent updates with circular references", + files: getBuildSampleFileMap(makeCircularReferences), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests"}, + edits: getBuildSampleWatchNewFileEdits(), + }, + { + subScenario: "watches config files that are not present", + files: getBuildSampleFileMap(func(files FileMap) { + delete(files, "/user/username/projects/sample1/logic/tsconfig.json") + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests"}, + edits: []*tscEdit{ + { + caption: "Write logic", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/sample1/logic/tsconfig.json", getLogicConfig(), false) + }, + }, + }, + }, + getIncrementalErrorTest("when preserveWatchOutput is not used", nil), + getIncrementalErrorTest("when preserveWatchOutput is passed on command line", []string{"--preserveWatchOutput"}), + getIncrementalErrorTest("when stopBuildOnErrors is passed on command line", []string{"--stopBuildOnErrors"}), + { + subScenario: "incremental updates in verbose mode", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "tests", "--verbose"}, + edits: []*tscEdit{ + { + caption: "Make non dts change", + edit: func(sys *testSys) { + sys.appendFile("/user/username/projects/sample1/logic/index.ts", "\nfunction someFn() { }") + }, + }, + { + caption: "Make dts change", + edit: func(sys *testSys) { + sys.replaceFileText("/user/username/projects/sample1/logic/index.ts", "\nfunction someFn() { }", "\nexport function someFn() { }") + }, + }, + }, + }, + { + subScenario: "should not trigger recompilation because of program emit", + files: getBuildSampleFileMap(nil), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "core", "--verbose"}, + edits: []*tscEdit{ + noChange, + { + caption: "Add new file", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/sample1/core/file3.ts", `export const y = 10;`, false) + }, + }, + noChange, + }, + }, + { + subScenario: "should not trigger recompilation because of program emit with outDir specified", + files: getBuildSampleFileMap(func(files FileMap) { + files["/user/username/projects/sample1/core/tsconfig.json"] = stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "outDir" + } + }`) + }), + cwd: "/user/username/projects/sample1", + commandLineArgs: []string{"--b", "-w", "core", "--verbose"}, + edits: []*tscEdit{ + noChange, + { + caption: "Add new file", + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/sample1/core/file3.ts", `export const y = 10;`, false) + }, + }, + noChange, + }, + }, + }, getStopBuildOnErrorTests(nil), getStopBuildOnErrorTests([]string{"--watch"})) for _, test := range testCases { test.run(t, "sample") diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js new file mode 100644 index 0000000000..b60aa0a999 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js @@ -0,0 +1,423 @@ +currentDirectory::/user/username/projects/solution +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/solution/app/fileWithError.ts] *new* + export var myClassWithError = class { + tags() { } + + }; +//// [/user/username/projects/solution/app/fileWithoutError.ts] *new* +export class myClass { } +//// [/user/username/projects/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + } +} + +tsgo -b -w app +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/solution/app/fileWithError.d.ts] *new* +export declare var myClassWithError: { + new (): { + tags(): void; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] *new* +export declare class myClass { +} + +//// [/user/username/projects/solution/app/fileWithoutError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClass = void 0; +class myClass { +} +exports.myClass = myClass; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithoutError.d.ts"} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./fileWithoutError.d.ts", + "size": 1460 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/solution/app/fileWithError.ts +*refresh* /user/username/projects/solution/app/fileWithoutError.ts +Signatures:: +(stored at emit) /user/username/projects/solution/app/fileWithError.ts +(stored at emit) /user/username/projects/solution/app/fileWithoutError.ts + + +Edit [0]:: Introduce error +//// [/user/username/projects/solution/app/fileWithError.ts] *modified* +export var myClassWithError = class { + tags() { } + private p = 12 +}; + + +Output:: +app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export var myClassWithError = class { +   ~~~~~~~~~~~~~~~~ + + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + 1 export var myClassWithError = class { +    ~~~~~~~~~~~~~~~~ + + +Found 1 error in app/fileWithError.ts:1 + +//// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* +export declare var myClassWithError: { + new (): { + tags(): void; + p: number; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } + p = 12; +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "emitDiagnosticsPerFile": [ + [ + "./fileWithError.ts", + [ + { + "pos": 11, + "end": 27, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 11, + "end": 27, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable myClassWithError." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./fileWithError.d.ts", + "emitSignatures": [ + { + "file": "./fileWithError.ts", + "signature": "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n", + "original": [ + 2, + "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n" + ] + } + ], + "size": 2104 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/solution/app/fileWithError.ts +Signatures:: +(computed .d.ts) /user/username/projects/solution/app/fileWithError.ts + + +Edit [1]:: Change fileWithoutError +//// [/user/username/projects/solution/app/fileWithoutError.ts] *modified* +export class myClass2 { } + + +Output:: +app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export var myClassWithError = class { +   ~~~~~~~~~~~~~~~~ + + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + 1 export var myClassWithError = class { +    ~~~~~~~~~~~~~~~~ + + +Found 1 error in app/fileWithError.ts:1 + +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] *modified* +export declare class myClass2 { +} + +//// [/user/username/projects/solution/app/fileWithoutError.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClass2 = void 0; +class myClass2 { +} +exports.myClass2 = myClass2; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"4494620e0f3a6379be16c2477b86b919-export class myClass2 { }","signature":"cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "4494620e0f3a6379be16c2477b86b919-export class myClass2 { }", + "signature": "cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4494620e0f3a6379be16c2477b86b919-export class myClass2 { }", + "signature": "cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "emitDiagnosticsPerFile": [ + [ + "./fileWithError.ts", + [ + { + "pos": 11, + "end": 27, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 11, + "end": 27, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable myClassWithError." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./fileWithoutError.d.ts", + "emitSignatures": [ + { + "file": "./fileWithError.ts", + "signature": "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n", + "original": [ + 2, + "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n" + ] + } + ], + "size": 2109 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/solution/app/fileWithoutError.ts +Signatures:: +(computed .d.ts) /user/username/projects/solution/app/fileWithoutError.ts diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js new file mode 100644 index 0000000000..1391768a9f --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js @@ -0,0 +1,385 @@ +currentDirectory::/user/username/projects/solution +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/solution/app/fileWithError.ts] *new* + export var myClassWithError = class { + tags() { } + + }; +//// [/user/username/projects/solution/app/fileWithoutError.ts] *new* +export class myClass { } +//// [/user/username/projects/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + } +} + +tsgo -b -w app +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/solution/app/fileWithError.d.ts] *new* +export declare var myClassWithError: { + new (): { + tags(): void; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] *new* +export declare class myClass { +} + +//// [/user/username/projects/solution/app/fileWithoutError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClass = void 0; +class myClass { +} +exports.myClass = myClass; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithoutError.d.ts"} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d4354dbd4fafaa0ad3a5b65966837613- export var myClassWithError = class {\n tags() { }\n\n };", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./fileWithoutError.d.ts", + "size": 1460 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/solution/app/fileWithError.ts +*refresh* /user/username/projects/solution/app/fileWithoutError.ts +Signatures:: +(stored at emit) /user/username/projects/solution/app/fileWithError.ts +(stored at emit) /user/username/projects/solution/app/fileWithoutError.ts + + +Edit [0]:: Introduce error +//// [/user/username/projects/solution/app/fileWithError.ts] *modified* +export var myClassWithError = class { + tags() { } + private p = 12 +}; + + +Output:: +app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export var myClassWithError = class { +   ~~~~~~~~~~~~~~~~ + + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + 1 export var myClassWithError = class { +    ~~~~~~~~~~~~~~~~ + + +Found 1 error in app/fileWithError.ts:1 + +//// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* +export declare var myClassWithError: { + new (): { + tags(): void; + p: number; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } + p = 12; +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "emitDiagnosticsPerFile": [ + [ + "./fileWithError.ts", + [ + { + "pos": 11, + "end": 27, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 11, + "end": 27, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable myClassWithError." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./fileWithError.d.ts", + "emitSignatures": [ + { + "file": "./fileWithError.ts", + "signature": "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n", + "original": [ + 2, + "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n" + ] + } + ], + "size": 2104 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/solution/app/fileWithError.ts +Signatures:: +(computed .d.ts) /user/username/projects/solution/app/fileWithError.ts + + +Edit [1]:: Fix error +//// [/user/username/projects/solution/app/fileWithError.ts] *modified* +export var myClassWithError = class { + tags() { } + +}; + + +Output:: +//// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* +export declare var myClassWithError: { + new (): { + tags(): void; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f90afddb8044264e464dd4c18c7b59a-export var myClassWithError = class {\n tags() { }\n \n};","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithError.d.ts"} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "4f90afddb8044264e464dd4c18c7b59a-export var myClassWithError = class {\n tags() { }\n \n};", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4f90afddb8044264e464dd4c18c7b59a-export var myClassWithError = class {\n tags() { }\n \n};", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./fileWithError.d.ts", + "size": 1419 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/solution/app/fileWithError.ts +Signatures:: +(computed .d.ts) /user/username/projects/solution/app/fileWithError.ts diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js new file mode 100644 index 0000000000..a8f4dc1be1 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js @@ -0,0 +1,326 @@ +currentDirectory::/user/username/projects/solution +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/solution/app/fileWithError.ts] *new* +export var myClassWithError = class { + tags() { } + private p = 12 +}; +//// [/user/username/projects/solution/app/fileWithoutError.ts] *new* +export class myClass { } +//// [/user/username/projects/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + } +} + +tsgo -b -w app +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export var myClassWithError = class { +   ~~~~~~~~~~~~~~~~ + + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + 1 export var myClassWithError = class { +    ~~~~~~~~~~~~~~~~ + + +Found 1 error in app/fileWithError.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/solution/app/fileWithError.d.ts] *new* +export declare var myClassWithError: { + new (): { + tags(): void; + p: number; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } + p = 12; +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] *new* +export declare class myClass { +} + +//// [/user/username/projects/solution/app/fileWithoutError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClass = void 0; +class myClass { +} +exports.myClass = myClass; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "emitDiagnosticsPerFile": [ + [ + "./fileWithError.ts", + [ + { + "pos": 11, + "end": 27, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 11, + "end": 27, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable myClassWithError." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./fileWithoutError.d.ts", + "emitSignatures": [ + { + "file": "./fileWithError.ts", + "signature": "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n", + "original": [ + 2, + "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n" + ] + } + ], + "size": 2107 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/solution/app/fileWithError.ts +*refresh* /user/username/projects/solution/app/fileWithoutError.ts +Signatures:: +(stored at emit) /user/username/projects/solution/app/fileWithError.ts +(stored at emit) /user/username/projects/solution/app/fileWithoutError.ts + + +Edit [0]:: Change fileWithoutError +//// [/user/username/projects/solution/app/fileWithoutError.ts] *modified* +export class myClass2 { } + + +Output:: +app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export var myClassWithError = class { +   ~~~~~~~~~~~~~~~~ + + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + 1 export var myClassWithError = class { +    ~~~~~~~~~~~~~~~~ + + +Found 1 error in app/fileWithError.ts:1 + +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] *modified* +export declare class myClass2 { +} + +//// [/user/username/projects/solution/app/fileWithoutError.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClass2 = void 0; +class myClass2 { +} +exports.myClass2 = myClass2; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"4494620e0f3a6379be16c2477b86b919-export class myClass2 { }","signature":"cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "4494620e0f3a6379be16c2477b86b919-export class myClass2 { }", + "signature": "cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4494620e0f3a6379be16c2477b86b919-export class myClass2 { }", + "signature": "cdd06be46566b8da2e1a2b5b161ff551-export declare class myClass2 {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "emitDiagnosticsPerFile": [ + [ + "./fileWithError.ts", + [ + { + "pos": 11, + "end": 27, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 11, + "end": 27, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable myClassWithError." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./fileWithoutError.d.ts", + "emitSignatures": [ + { + "file": "./fileWithError.ts", + "signature": "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n", + "original": [ + 2, + "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n" + ] + } + ], + "size": 2109 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/solution/app/fileWithoutError.ts +Signatures:: +(computed .d.ts) /user/username/projects/solution/app/fileWithoutError.ts diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js new file mode 100644 index 0000000000..5bb8b80896 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js @@ -0,0 +1,288 @@ +currentDirectory::/user/username/projects/solution +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/solution/app/fileWithError.ts] *new* +export var myClassWithError = class { + tags() { } + private p = 12 +}; +//// [/user/username/projects/solution/app/fileWithoutError.ts] *new* +export class myClass { } +//// [/user/username/projects/solution/app/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + } +} + +tsgo -b -w app +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. + +1 export var myClassWithError = class { +   ~~~~~~~~~~~~~~~~ + + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + 1 export var myClassWithError = class { +    ~~~~~~~~~~~~~~~~ + + +Found 1 error in app/fileWithError.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/solution/app/fileWithError.d.ts] *new* +export declare var myClassWithError: { + new (): { + tags(): void; + p: number; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } + p = 12; +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] *new* +export declare class myClass { +} + +//// [/user/username/projects/solution/app/fileWithoutError.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClass = void 0; +class myClass { +} +exports.myClass = myClass; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};","signature":"4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"emitDiagnosticsPerFile":[[2,[{"pos":11,"end":27,"code":4094,"category":1,"message":"Property 'p' of exported anonymous class type may not be private or protected.","relatedInformation":[{"pos":11,"end":27,"code":9027,"category":1,"message":"Add a type annotation to the variable myClassWithError."}]}]]],"latestChangedDtsFile":"./fileWithoutError.d.ts","emitSignatures":[[2,"b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n"]]} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "02dc54a766c51fbc368b69a386e90b57-export var myClassWithError = class {\n tags() { }\n private p = 12\n};", + "signature": "4763ea6446bf27424942ef44caadabed-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n\n(11,16): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(11,16): error9027: Add a type annotation to the variable myClassWithError.", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "emitDiagnosticsPerFile": [ + [ + "./fileWithError.ts", + [ + { + "pos": 11, + "end": 27, + "code": 4094, + "category": 1, + "message": "Property 'p' of exported anonymous class type may not be private or protected.", + "relatedInformation": [ + { + "pos": 11, + "end": 27, + "code": 9027, + "category": 1, + "message": "Add a type annotation to the variable myClassWithError." + } + ] + } + ] + ] + ], + "latestChangedDtsFile": "./fileWithoutError.d.ts", + "emitSignatures": [ + { + "file": "./fileWithError.ts", + "signature": "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n", + "original": [ + 2, + "b73b369b8f252d3d9d6dcbf326b8e0e8-export declare var myClassWithError: {\n new (): {\n tags(): void;\n p: number;\n };\n};\n" + ] + } + ], + "size": 2107 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/solution/app/fileWithError.ts +*refresh* /user/username/projects/solution/app/fileWithoutError.ts +Signatures:: +(stored at emit) /user/username/projects/solution/app/fileWithError.ts +(stored at emit) /user/username/projects/solution/app/fileWithoutError.ts + + +Edit [0]:: Fix error +//// [/user/username/projects/solution/app/fileWithError.ts] *modified* +export var myClassWithError = class { + tags() { } + +}; + + +Output:: +//// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* +export declare var myClassWithError: { + new (): { + tags(): void; + }; +}; + +//// [/user/username/projects/solution/app/fileWithError.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.myClassWithError = void 0; +var myClassWithError = class { + tags() { } +}; +exports.myClassWithError = myClassWithError; + +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./fileWithError.ts","./fileWithoutError.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f90afddb8044264e464dd4c18c7b59a-export var myClassWithError = class {\n tags() { }\n \n};","signature":"767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n","impliedNodeFormat":1},{"version":"181818468a51a2348d25d30b10b6b1bb-export class myClass { }","signature":"00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./fileWithError.d.ts"} +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./fileWithError.ts", + "./fileWithoutError.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithError.ts", + "version": "4f90afddb8044264e464dd4c18c7b59a-export var myClassWithError = class {\n tags() { }\n \n};", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4f90afddb8044264e464dd4c18c7b59a-export var myClassWithError = class {\n tags() { }\n \n};", + "signature": "767d370715ef9e7e7e190b09dbf6cb11-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./fileWithoutError.ts", + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "181818468a51a2348d25d30b10b6b1bb-export class myClass { }", + "signature": "00d3ac9a4cccbf94649ca3c19d44376a-export declare class myClass {\n}\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./fileWithError.d.ts", + "size": 1419 +} + +app/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/solution/app/fileWithError.ts +Signatures:: +(computed .d.ts) /user/username/projects/solution/app/fileWithError.ts diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js new file mode 100644 index 0000000000..98e4f9cd42 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js @@ -0,0 +1,87 @@ +currentDirectory::/user/username/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/project/main.ts] *new* +export const x = 10; +//// [/user/username/projects/project/tsconfig.json] *new* +{} +//// [/user/username/projects/project/tsconfig.tsbuildinfo] *new* +Some random string + +tsgo --b -i -w +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/project/main.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + +//// [/user/username/projects/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;"]} +//// [/user/username/projects/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* /user/username/projects/project/main.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js new file mode 100644 index 0000000000..d36fb6b4f6 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js @@ -0,0 +1,394 @@ +currentDirectory::/user/username/projects/sample1 +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/sample1/App/app.ts] *new* +import { createSomeObject } from "../Library/library"; +createSomeObject().message; +//// [/user/username/projects/sample1/App/tsconfig.json] *new* +{ + "references": [{ "path": "../Library" }] +} +//// [/user/username/projects/sample1/Library/library.ts] *new* +interface SomeObject +{ + message: string; +} + +export function createSomeObject(): SomeObject +{ + return { + message: "new Object" + }; +} +//// [/user/username/projects/sample1/Library/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true + } +} + +tsgo -b -w App +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/App/app.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const library_1 = require("../Library/library"); +(0, library_1.createSomeObject)().message; + +//// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./app.ts"]} +//// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./app.ts" + ], + "original": "./app.ts" + } + ], + "size": 47 +} +//// [/user/username/projects/sample1/Library/library.d.ts] *new* +interface SomeObject { + message: string; +} +export declare function createSomeObject(): SomeObject; +export {}; + +//// [/user/username/projects/sample1/Library/library.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSomeObject = createSomeObject; +function createSomeObject() { + return { + message: "new Object" + }; +} + +//// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./library.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e7ed447430123527643b512119fcfd4f-interface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}","signature":"4e6561e4d0bb63e65443157d6f0b1d5d-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./library.d.ts"} +//// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./library.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./library.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./library.ts", + "version": "e7ed447430123527643b512119fcfd4f-interface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}", + "signature": "4e6561e4d0bb63e65443157d6f0b1d5d-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7ed447430123527643b512119fcfd4f-interface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}", + "signature": "4e6561e4d0bb63e65443157d6f0b1d5d-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./library.d.ts", + "size": 1326 +} + +Library/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/Library/library.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/Library/library.ts + +App/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/Library/library.d.ts +*refresh* /user/username/projects/sample1/App/app.ts +Signatures:: + + +Edit [0]:: Introduce error +//// [/user/username/projects/sample1/Library/library.ts] *modified* +interface SomeObject +{ + message2: string; +} + +export function createSomeObject(): SomeObject +{ + return { + message2: "new Object" + }; +} + + +Output:: +App/app.ts:2:20 - error TS2551: Property 'message' does not exist on type 'SomeObject'. Did you mean 'message2'? + +2 createSomeObject().message; +   ~~~~~~~ + + Library/library.d.ts:2:5 - 'message2' is declared here. + 2 message2: string; +    ~~~~~~~~ + + +Found 1 error in App/app.ts:2 + +//// [/user/username/projects/sample1/App/app.js] *rewrite with same content* +//// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./app.ts"],"semanticErrors":true} +//// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./app.ts" + ], + "original": "./app.ts" + } + ], + "size": 69, + "semanticErrors": true +} +//// [/user/username/projects/sample1/Library/library.d.ts] *modified* +interface SomeObject { + message2: string; +} +export declare function createSomeObject(): SomeObject; +export {}; + +//// [/user/username/projects/sample1/Library/library.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSomeObject = createSomeObject; +function createSomeObject() { + return { + message2: "new Object" + }; +} + +//// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./library.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"81f8dc50fd9871a106f1c06cc8e652ac-interface SomeObject\n{\n message2: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message2: \"new Object\"\n };\n}","signature":"f8bbfda93d56bdf575656b7c6a31c95f-interface SomeObject {\n message2: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./library.d.ts"} +//// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./library.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./library.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./library.ts", + "version": "81f8dc50fd9871a106f1c06cc8e652ac-interface SomeObject\n{\n message2: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message2: \"new Object\"\n };\n}", + "signature": "f8bbfda93d56bdf575656b7c6a31c95f-interface SomeObject {\n message2: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "81f8dc50fd9871a106f1c06cc8e652ac-interface SomeObject\n{\n message2: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message2: \"new Object\"\n };\n}", + "signature": "f8bbfda93d56bdf575656b7c6a31c95f-interface SomeObject {\n message2: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./library.d.ts", + "size": 1329 +} + +Library/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/Library/library.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/Library/library.ts + +App/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/Library/library.d.ts +*refresh* /user/username/projects/sample1/App/app.ts +Signatures:: +(used version) /user/username/projects/sample1/Library/library.d.ts +(computed .d.ts) /user/username/projects/sample1/App/app.ts + + +Edit [1]:: Fix error +//// [/user/username/projects/sample1/Library/library.ts] *modified* +interface SomeObject +{ + message: string; +} + +export function createSomeObject(): SomeObject +{ + return { + message: "new Object" + }; +} + + +Output:: +//// [/user/username/projects/sample1/App/app.js] *rewrite with same content* +//// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./app.ts"]} +//// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./app.ts" + ], + "original": "./app.ts" + } + ], + "size": 47 +} +//// [/user/username/projects/sample1/Library/library.d.ts] *modified* +interface SomeObject { + message: string; +} +export declare function createSomeObject(): SomeObject; +export {}; + +//// [/user/username/projects/sample1/Library/library.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSomeObject = createSomeObject; +function createSomeObject() { + return { + message: "new Object" + }; +} + +//// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./library.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e7ed447430123527643b512119fcfd4f-interface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}","signature":"4e6561e4d0bb63e65443157d6f0b1d5d-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n","impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./library.d.ts"} +//// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./library.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./library.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./library.ts", + "version": "e7ed447430123527643b512119fcfd4f-interface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}", + "signature": "4e6561e4d0bb63e65443157d6f0b1d5d-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "e7ed447430123527643b512119fcfd4f-interface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}", + "signature": "4e6561e4d0bb63e65443157d6f0b1d5d-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n", + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./library.d.ts", + "size": 1326 +} + +Library/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/Library/library.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/Library/library.ts + +App/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/Library/library.d.ts +*refresh* /user/username/projects/sample1/App/app.ts +Signatures:: +(used version) /user/username/projects/sample1/Library/library.d.ts +(computed .d.ts) /user/username/projects/sample1/App/app.ts diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js new file mode 100644 index 0000000000..a2f4c792ec --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js @@ -0,0 +1,263 @@ +currentDirectory::/user/username/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/project/alpha.tsconfig.json] *new* +{ + "compilerOptions": { + "strict": true, + }, +} +//// [/user/username/projects/project/bravo.tsconfig.json] *new* +{ + "compilerOptions": { + "strict": true, + }, +} +//// [/user/username/projects/project/commonFile1.ts] *new* +let x = 1 +//// [/user/username/projects/project/commonFile2.ts] *new* +let y = 1 +//// [/user/username/projects/project/other.ts] *new* +let z = 0; +//// [/user/username/projects/project/project1.tsconfig.json] *new* +{ + "extends": "./alpha.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["commonFile1.ts", "commonFile2.ts"], +} +//// [/user/username/projects/project/project2.tsconfig.json] *new* +{ + "extends": "./bravo.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["other.ts"], +} +//// [/user/username/projects/project/tsconfig.json] *new* +{ + "references": [ + { + "path": "./project1.tsconfig.json", + }, + { + "path": "./project2.tsconfig.json", + }, + ], + "files": [], +} + +tsgo -b -w -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * 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'... + +[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'... + +//// [/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/project/commonFile1.d.ts] *new* +declare let x: number; + +//// [/user/username/projects/project/commonFile1.js] *new* +let x = 1; + +//// [/user/username/projects/project/commonFile2.d.ts] *new* +declare let y: number; + +//// [/user/username/projects/project/commonFile2.js] *new* +let y = 1; + +//// [/user/username/projects/project/other.d.ts] *new* +declare let z: number; + +//// [/user/username/projects/project/other.js] *new* +let z = 0; + +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./commonFile1.ts","./commonFile2.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1","signature":"0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"06ce815ba25b02847f0b8550f82f5a25-let y = 1","signature":"114cede92fdd1b7222858083021aeba2-declare let y: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"strict":true},"latestChangedDtsFile":"./commonFile2.d.ts"} +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./commonFile1.ts", + "./commonFile2.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./commonFile1.ts", + "./commonFile2.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile1.ts", + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile2.ts", + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "strict": true + }, + "latestChangedDtsFile": "./commonFile2.d.ts", + "size": 1330 +} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./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":"7148e8559d706b66aaba2a2423755c63-let z = 0;","signature":"879426698e1db06899fd57775c19b230-declare let z: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"strict":true},"latestChangedDtsFile":"./other.d.ts"} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./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": "./other.ts", + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "strict": true + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1119 +} + +project1.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/commonFile1.ts +*refresh* /user/username/projects/project/commonFile2.ts +Signatures:: +(stored at emit) /user/username/projects/project/commonFile1.ts +(stored at emit) /user/username/projects/project/commonFile2.ts + +project2.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/other.ts +Signatures:: +(stored at emit) /user/username/projects/project/other.ts + + +Edit [0]:: Remove project2 from base config +//// [/user/username/projects/project/tsconfig.json] *modified* +{ + "references": [ + { + "path": "./project1.tsconfig.json", + }, + ], + "files": [], +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * tsconfig.json + + diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js new file mode 100644 index 0000000000..c7b8ea79c1 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js @@ -0,0 +1,105 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/index.ts] *new* +const fn = (a: string, b: string) => b; +//// [/user/username/projects/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "noUnusedParameters": true, + }, +} + +tsgo -b -w +ExitStatus:: DiagnosticsPresent_OutputsGenerated +Output:: +index.ts:1:13 - error TS6133: 'a' is declared but its value is never read. + +1 const fn = (a: string, b: string) => b; +   ~ + + +Found 1 error in 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; }; +//// [/user/username/projects/myproject/index.js] *new* +const fn = (a, b) => b; + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./index.ts"],"semanticErrors":true} +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": "./index.ts" + } + ], + "size": 71, + "semanticErrors": true +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/index.ts +Signatures:: + + +Edit [0]:: Change tsconfig to set noUnusedParameters to false +//// [/user/username/projects/myproject/tsconfig.json] *modified* +{ + "compilerOptions": { + "noUnusedParameters": false, + }, +} + + +Output:: +//// [/user/username/projects/myproject/index.js] *mTime changed* +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./index.ts"]} +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": "./index.ts" + } + ], + "size": 49 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/index.ts +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js new file mode 100644 index 0000000000..8155e6f7bb --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js @@ -0,0 +1,549 @@ +currentDirectory::/user/username/projects/project +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/project/alpha.tsconfig.json] *new* +{} +//// [/user/username/projects/project/bravo.tsconfig.json] *new* +{ + "extends": "./alpha.tsconfig.json", +} +//// [/user/username/projects/project/commonFile1.ts] *new* +let x = 1 +//// [/user/username/projects/project/commonFile2.ts] *new* +let y = 1 +//// [/user/username/projects/project/extendsConfig1.tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + }, +} +//// [/user/username/projects/project/extendsConfig2.tsconfig.json] *new* +{ + "compilerOptions": { + "strictNullChecks": false, + }, +} +//// [/user/username/projects/project/extendsConfig3.tsconfig.json] *new* +{ + "compilerOptions": { + "noImplicitAny": true, + }, +} +//// [/user/username/projects/project/other.ts] *new* +let z = 0; +//// [/user/username/projects/project/other2.ts] *new* +let k = 0; +//// [/user/username/projects/project/project1.tsconfig.json] *new* +{ + "extends": "./alpha.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["commonFile1.ts", "commonFile2.ts"], +} +//// [/user/username/projects/project/project2.tsconfig.json] *new* +{ + "extends": "./bravo.tsconfig.json", + "compilerOptions": { + "composite": true, + }, + "files": ["other.ts"], +} +//// [/user/username/projects/project/project3.tsconfig.json] *new* +{ + "extends": [ + "./extendsConfig1.tsconfig.json", + "./extendsConfig2.tsconfig.json", + "./extendsConfig3.tsconfig.json", + ], + "compilerOptions": { + "composite": false, + }, + "files": ["other2.ts"], +} + +tsgo -b -w -v project1.tsconfig.json project2.tsconfig.json project3.tsconfig.json +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.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'... + +[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'... + +[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'... + +//// [/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/project/commonFile1.d.ts] *new* +declare let x: number; + +//// [/user/username/projects/project/commonFile1.js] *new* +let x = 1; + +//// [/user/username/projects/project/commonFile2.d.ts] *new* +declare let y: number; + +//// [/user/username/projects/project/commonFile2.js] *new* +let y = 1; + +//// [/user/username/projects/project/other.d.ts] *new* +declare let z: number; + +//// [/user/username/projects/project/other.js] *new* +let z = 0; + +//// [/user/username/projects/project/other2.js] *new* +let k = 0; + +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./commonFile1.ts","./commonFile2.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1","signature":"0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"06ce815ba25b02847f0b8550f82f5a25-let y = 1","signature":"114cede92fdd1b7222858083021aeba2-declare let y: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./commonFile2.d.ts"} +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./commonFile1.ts", + "./commonFile2.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./commonFile1.ts", + "./commonFile2.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile1.ts", + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile2.ts", + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./commonFile2.d.ts", + "size": 1316 +} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./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":"7148e8559d706b66aaba2a2423755c63-let z = 0;","signature":"879426698e1db06899fd57775c19b230-declare let z: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./other.d.ts"} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./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": "./other.ts", + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1105 +} +//// [/user/username/projects/project/project3.tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./other2.ts"]} +//// [/user/username/projects/project/project3.tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./other2.ts" + ], + "original": "./other2.ts" + } + ], + "size": 50 +} + +project1.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/commonFile1.ts +*refresh* /user/username/projects/project/commonFile2.ts +Signatures:: +(stored at emit) /user/username/projects/project/commonFile1.ts +(stored at emit) /user/username/projects/project/commonFile2.ts + +project2.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/other.ts +Signatures:: +(stored at emit) /user/username/projects/project/other.ts + +project3.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/other2.ts +Signatures:: + + +Edit [0]:: Modify alpha config +//// [/user/username/projects/project/alpha.tsconfig.json] *modified* +{ + "compilerOptions": { + "strict": true + } +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.tsconfig.json + +[HH:MM:SS AM] Project 'project1.tsconfig.json' is out of date because output 'project1.tsconfig.tsbuildinfo' is older than input 'alpha.tsconfig.json' + +[HH:MM:SS AM] Building project 'project1.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project1.tsconfig.json'... + +[HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'project2.tsconfig.tsbuildinfo' is older than input 'alpha.tsconfig.json' + +[HH:MM:SS AM] Building project 'project2.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... + +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *mTime changed* + +project1.tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +project2.tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: change bravo config +//// [/user/username/projects/project/bravo.tsconfig.json] *modified* +{ + "extends": "./alpha.tsconfig.json", + "compilerOptions": { "strict": false } +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.tsconfig.json + +[HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'project2.tsconfig.tsbuildinfo' is older than input 'bravo.tsconfig.json' + +[HH:MM:SS AM] Building project 'project2.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... + +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *mTime changed* + +project2.tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: project 2 extends alpha +//// [/user/username/projects/project/project2.tsconfig.json] *modified* +{ + "extends": "./alpha.tsconfig.json", +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.tsconfig.json + +[HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'other.js' is older than input 'project2.tsconfig.json' + +[HH:MM:SS AM] Building project 'project2.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... + +//// [/user/username/projects/project/commonFile1.js] *rewrite with same content* +//// [/user/username/projects/project/commonFile2.js] *rewrite with same content* +//// [/user/username/projects/project/other.js] *mTime changed* +//// [/user/username/projects/project/other2.js] *rewrite with same content* +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":["./commonFile1.ts","./commonFile2.ts","./other.ts","./other2.ts"]} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./commonFile1.ts" + ], + "original": "./commonFile1.ts" + }, + { + "files": [ + "./commonFile2.ts" + ], + "original": "./commonFile2.ts" + }, + { + "files": [ + "./other.ts" + ], + "original": "./other.ts" + }, + { + "files": [ + "./other2.ts" + ], + "original": "./other2.ts" + } + ], + "size": 101 +} + +project2.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/commonFile1.ts +*refresh* /user/username/projects/project/commonFile2.ts +*refresh* /user/username/projects/project/other2.ts +Signatures:: +(computed .d.ts) /user/username/projects/project/commonFile1.ts +(computed .d.ts) /user/username/projects/project/commonFile2.ts +(computed .d.ts) /user/username/projects/project/other2.ts + + +Edit [3]:: update aplha config +//// [/user/username/projects/project/alpha.tsconfig.json] *modified* +{} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.tsconfig.json + +[HH:MM:SS AM] Project 'project1.tsconfig.json' is out of date because output 'project1.tsconfig.tsbuildinfo' is older than input 'alpha.tsconfig.json' + +[HH:MM:SS AM] Building project 'project1.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project1.tsconfig.json'... + +[HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'project2.tsconfig.tsbuildinfo' is older than input 'alpha.tsconfig.json' + +[HH:MM:SS AM] Building project 'project2.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... + +//// [/user/username/projects/project/commonFile1.js] *mTime changed* +//// [/user/username/projects/project/commonFile2.js] *mTime changed* +//// [/user/username/projects/project/other.js] *mTime changed* +//// [/user/username/projects/project/other2.js] *mTime changed* +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *mTime changed* + +project1.tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +project2.tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: Modify extendsConfigFile2 +//// [/user/username/projects/project/extendsConfig2.tsconfig.json] *modified* +{ + "compilerOptions": { "strictNullChecks": true } +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.tsconfig.json + +[HH:MM:SS AM] Project 'project3.tsconfig.json' is out of date because output 'project3.tsconfig.tsbuildinfo' is older than input 'extendsConfig2.tsconfig.json' + +[HH:MM:SS AM] Building project 'project3.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project3.tsconfig.json'... + +//// [/user/username/projects/project/other2.js] *mTime changed* +//// [/user/username/projects/project/project3.tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/project/project3.tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project3.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/other2.ts +Signatures:: + + +Edit [5]:: Modify project 3 +//// [/user/username/projects/project/project3.tsconfig.json] *modified* +{ + "extends": ["./extendsConfig1.tsconfig.json", "./extendsConfig2.tsconfig.json"], + "compilerOptions": { "composite": false }, + "files": ["other2.ts"], +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.tsconfig.json + +[HH:MM:SS AM] Project 'project3.tsconfig.json' is out of date because output 'project3.tsconfig.tsbuildinfo' is older than input 'project3.tsconfig.json' + +[HH:MM:SS AM] Building project 'project3.tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'project3.tsconfig.json'... + +//// [/user/username/projects/project/other2.js] *mTime changed* +//// [/user/username/projects/project/project3.tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/project/project3.tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* + +project3.tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/other2.ts +Signatures:: + + +Edit [6]:: Delete extendedConfigFile2 and report error +//// [/user/username/projects/project/extendsConfig2.tsconfig.json] *deleted* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1.tsconfig.json + * project2.tsconfig.json + * project3.tsconfig.json + +[HH:MM:SS AM] Project 'project3.tsconfig.json' is up to date because newest input 'other2.ts' is older than output 'project3.tsconfig.tsbuildinfo' + +error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. +error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. + +Found 2 errors. + + + + +Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,4 +1,5 @@ + error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. ++error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. + +-Found 1 error. ++Found 2 errors. diff --git a/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js new file mode 100644 index 0000000000..0072889389 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js @@ -0,0 +1,677 @@ +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 + }, + "references": [ + { "path": "../tests", "circular": 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 -w 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"; + +//// [/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; + +//// [/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},"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 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1769 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1801 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "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": 1960 +} + +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 to new File and build core +//// [/user/username/projects/sample1/core/newfile.ts] *new* +export const newFileConst = 30; + + +Output:: +//// [/user/username/projects/sample1/core/newfile.d.ts] *new* +export declare const newFileConst = 30; + +//// [/user/username/projects/sample1/core/newfile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.newFileConst = void 0; +exports.newFileConst = 30; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./newfile.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":"046181f7f382942435700923f254abbd-export const newFileConst = 30;","signature":"a58a2a5c0f75f5061a8fd33d410e8e87-export declare const newFileConst = 30;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true},"latestChangedDtsFile":"./newfile.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./newfile.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./newfile.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": "./newfile.ts", + "version": "046181f7f382942435700923f254abbd-export const newFileConst = 30;", + "signature": "a58a2a5c0f75f5061a8fd33d410e8e87-export declare const newFileConst = 30;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "046181f7f382942435700923f254abbd-export const newFileConst = 30;", + "signature": "a58a2a5c0f75f5061a8fd33d410e8e87-export declare const newFileConst = 30;\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 + }, + "latestChangedDtsFile": "./newfile.d.ts", + "size": 1976 +} +//// [/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/newfile.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/newfile.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +tests/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Change to new File and build core +//// [/user/username/projects/sample1/core/newfile.ts] *modified* + +export class someClass2 { } + + +Output:: +//// [/user/username/projects/sample1/core/newfile.d.ts] *modified* +export declare class someClass2 { +} + +//// [/user/username/projects/sample1/core/newfile.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass2 = void 0; +class someClass2 { +} +exports.someClass2 = someClass2; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./newfile.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":"be01929bbca74e4343ac8d7aa9c08b55-\nexport class someClass2 { }","signature":"6235ba91ce253ead4599fe030935931e-export declare class someClass2 {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true},"latestChangedDtsFile":"./newfile.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./newfile.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./newfile.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": "./newfile.ts", + "version": "be01929bbca74e4343ac8d7aa9c08b55-\nexport class someClass2 { }", + "signature": "6235ba91ce253ead4599fe030935931e-export declare class someClass2 {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "be01929bbca74e4343ac8d7aa9c08b55-\nexport class someClass2 { }", + "signature": "6235ba91ce253ead4599fe030935931e-export declare class someClass2 {\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 + }, + "latestChangedDtsFile": "./newfile.d.ts", + "size": 1971 +} +//// [/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/newfile.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/newfile.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +tests/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js new file mode 100644 index 0000000000..0265e9fd38 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -0,0 +1,690 @@ +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 -w 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]:: Change to new File and build core +//// [/user/username/projects/sample1/core/newfile.ts] *new* +export const newFileConst = 30; + + +Output:: +//// [/user/username/projects/sample1/core/newfile.d.ts] *new* +export declare const newFileConst = 30; +//# sourceMappingURL=newfile.d.ts.map +//// [/user/username/projects/sample1/core/newfile.d.ts.map] *new* +{"version":3,"file":"newfile.d.ts","sourceRoot":"","sources":["newfile.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,KAAK,CAAC"} +//// [/user/username/projects/sample1/core/newfile.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.newFileConst = void 0; +exports.newFileConst = 30; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./newfile.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":"046181f7f382942435700923f254abbd-export const newFileConst = 30;","signature":"a58a2a5c0f75f5061a8fd33d410e8e87-export declare const newFileConst = 30;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./newfile.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./newfile.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./newfile.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": "./newfile.ts", + "version": "046181f7f382942435700923f254abbd-export const newFileConst = 30;", + "signature": "a58a2a5c0f75f5061a8fd33d410e8e87-export declare const newFileConst = 30;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "046181f7f382942435700923f254abbd-export const newFileConst = 30;", + "signature": "a58a2a5c0f75f5061a8fd33d410e8e87-export declare const newFileConst = 30;\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": "./newfile.d.ts", + "size": 2025 +} +//// [/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/newfile.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/newfile.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +tests/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: Change to new File and build core +//// [/user/username/projects/sample1/core/newfile.ts] *modified* + +export class someClass2 { } + + +Output:: +//// [/user/username/projects/sample1/core/newfile.d.ts] *modified* +export declare class someClass2 { +} +//# sourceMappingURL=newfile.d.ts.map +//// [/user/username/projects/sample1/core/newfile.d.ts.map] *modified* +{"version":3,"file":"newfile.d.ts","sourceRoot":"","sources":["newfile.ts"],"names":[],"mappings":"AACA,qBAAa,UAAU;CAAI"} +//// [/user/username/projects/sample1/core/newfile.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass2 = void 0; +class someClass2 { +} +exports.someClass2 = someClass2; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./anotherModule.ts","./index.ts","./newfile.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":"be01929bbca74e4343ac8d7aa9c08b55-\nexport class someClass2 { }","signature":"6235ba91ce253ead4599fe030935931e-export declare class someClass2 {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"latestChangedDtsFile":"./newfile.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./index.ts", + "./newfile.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./index.ts", + "./newfile.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": "./newfile.ts", + "version": "be01929bbca74e4343ac8d7aa9c08b55-\nexport class someClass2 { }", + "signature": "6235ba91ce253ead4599fe030935931e-export declare class someClass2 {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "be01929bbca74e4343ac8d7aa9c08b55-\nexport class someClass2 { }", + "signature": "6235ba91ce253ead4599fe030935931e-export declare class someClass2 {\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": "./newfile.d.ts", + "size": 2020 +} +//// [/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/newfile.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/newfile.ts + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +tests/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js new file mode 100644 index 0000000000..32a7831769 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js @@ -0,0 +1,1332 @@ +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 + }, + "references": [ + { "path": "../tests", "circular": 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 -w 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"; + +//// [/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; + +//// [/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},"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 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1769 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1801 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "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": 1960 +} + +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]:: Make change to core +//// [/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 { } + + +Output:: +//// [/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 { +} + +//// [/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},"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 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1834 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "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", + "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" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1838 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "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", + "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" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "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": 1997 +} + +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]:: Revert core file +//// [/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; } + + +Output:: +//// [/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/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},"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 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1769 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1801 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "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": 1960 +} + +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 [2]:: Make two 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 { } +export class someClass2 { } + + +Output:: +//// [/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 { +} +export declare class someClass2 { +} + +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass2 = 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 { +} +exports.someClass2 = 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":"3682101db2184c6bccaa98c1c1ac0791-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 { }\nexport class someClass2 { }","signature":"6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"declaration":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": "3682101db2184c6bccaa98c1c1ac0791-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 { }\nexport class someClass2 { }", + "signature": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3682101db2184c6bccaa98c1c1ac0791-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 { }\nexport class someClass2 { }", + "signature": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\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 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1901 +} +//// [/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},"6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n", + "signature": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1876 +} +//// [/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},"6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n", + "signature": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "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": 2035 +} + +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 diff --git a/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js new file mode 100644 index 0000000000..7dc59d26c4 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js @@ -0,0 +1,1349 @@ +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 -w 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]:: Make change to core +//// [/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 { } + + +Output:: +//// [/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]:: Revert core file +//// [/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; } + + +Output:: +//// [/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] *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"} +//// [/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.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] *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": "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.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 +} + +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 [2]:: Make two 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 { } +export class someClass2 { } + + +Output:: +//// [/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 { +} +export declare class someClass2 { +} +//# 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;AAC1B,qBAAa,UAAU;CAAI"} +//// [/user/username/projects/sample1/core/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.someClass2 = 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 { +} +exports.someClass2 = 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":"3682101db2184c6bccaa98c1c1ac0791-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 { }\nexport class someClass2 { }","signature":"6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\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": "3682101db2184c6bccaa98c1c1ac0791-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 { }\nexport class someClass2 { }", + "signature": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\n}\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3682101db2184c6bccaa98c1c1ac0791-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 { }\nexport class someClass2 { }", + "signature": "6b05b9011aa41b6b276b3708df078d1d-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}\nexport declare class someClass2 {\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": 1950 +} +//// [/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},"d4da7cae37db82b1a9affca237e15204-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}\nexport declare class someClass2 {\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": "d4da7cae37db82b1a9affca237e15204-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}\nexport declare class someClass2 {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "d4da7cae37db82b1a9affca237e15204-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}\nexport declare class someClass2 {\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": 1954 +} +//// [/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},"d4da7cae37db82b1a9affca237e15204-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}\nexport declare class someClass2 {\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": "d4da7cae37db82b1a9affca237e15204-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}\nexport declare class someClass2 {\n}\n//# sourceMappingURL=index.d.ts.map", + "signature": "d4da7cae37db82b1a9affca237e15204-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}\nexport declare class someClass2 {\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": 2113 +} + +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 diff --git a/testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js b/testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js new file mode 100644 index 0000000000..b030e007b6 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js @@ -0,0 +1,803 @@ +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 -w 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]:: Make non dts change +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +function someFn() { } + + +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output 'logic/tsconfig.tsbuildinfo' is older than input 'logic/index.ts' + +[HH:MM:SS AM] Building 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/logic/index.js] *modified* +"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; +function someFn() { } +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *modified* +{"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;AACrB,SAAS,MAAM,GAAG,EAAC,CAAE"} +//// [/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":"56bc284b087dd9cc90ffa4704740b86c-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;\nfunction someFn() { }","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": "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": "56bc284b087dd9cc90ffa4704740b86c-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;\nfunction someFn() { }", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "56bc284b087dd9cc90ffa4704740b86c-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;\nfunction someFn() { }", + "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": 1902 +} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + + +Edit [1]:: Make dts change +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +export function someFn() { } + + +Output:: +[HH:MM:SS AM] Projects in this build: + * core/tsconfig.json + * logic/tsconfig.json + * tests/tsconfig.json + +[HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output 'logic/tsconfig.tsbuildinfo' is older than input 'logic/index.ts' + +[HH:MM:SS AM] Building project 'logic/tsconfig.json'... + +[HH:MM:SS AM] Project 'tests/tsconfig.json' is out of date because output 'tests/index.js' is older than input 'logic/tsconfig.json' + +[HH:MM:SS AM] Building project 'tests/tsconfig.json'... + +//// [/user/username/projects/sample1/logic/index.d.ts] *modified* +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; +export declare function someFn(): void; + +//// [/user/username/projects/sample1/logic/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.getSecondsInDay = getSecondsInDay; +exports.someFn = someFn; +const c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +const mod = require("../core/anotherModule"); +exports.m = mod; +function someFn() { } +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *modified* +{"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;AACrB,kBAAyB,EAAC,CAAE"} +//// [/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":"d749596c6d4d5a27ed436fc0d564335c-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;\nexport function someFn() { }","signature":"2e576d48e524436cd9a1f5da08ccc740-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function someFn(): void;\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": "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": "d749596c6d4d5a27ed436fc0d564335c-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;\nexport function someFn() { }", + "signature": "2e576d48e524436cd9a1f5da08ccc740-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function someFn(): void;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "d749596c6d4d5a27ed436fc0d564335c-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;\nexport function someFn() { }", + "signature": "2e576d48e524436cd9a1f5da08ccc740-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function someFn(): void;\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": 1950 +} +//// [/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","2e576d48e524436cd9a1f5da08ccc740-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function someFn(): void;\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": "2e576d48e524436cd9a1f5da08ccc740-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function someFn(): void;\n", + "signature": "2e576d48e524436cd9a1f5da08ccc740-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function someFn(): void;\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": 2079 +} + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + +tests/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.d.ts +*refresh* /user/username/projects/sample1/tests/index.ts +Signatures:: +(used version) /user/username/projects/sample1/logic/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts diff --git a/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js new file mode 100644 index 0000000000..3b1d10a1a2 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js @@ -0,0 +1,532 @@ +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 + }, + "references": [ + { "path": "../tests", "circular": 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 -w 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"; + +//// [/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; + +//// [/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},"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 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1769 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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":"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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\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": "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": 1801 +} +//// [/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},"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","5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n","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": "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": "../core/anotherModule.d.ts", + "version": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "signature": "5aad0de3e7b08bb6e110c7b97361b89e-export declare const World = \"hello\";\n", + "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": 1960 +} + +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]:: Make local change to core +//// [/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; } +function foo() { } + + +Output:: +//// [/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; } +function foo() { } + +//// [/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":"2701734db0c9484494be1001fea37913-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; }\nfunction foo() { }","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},"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": "2701734db0c9484494be1001fea37913-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; }\nfunction foo() { }", + "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": "2701734db0c9484494be1001fea37913-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; }\nfunction foo() { }", + "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 + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1789 +} +//// [/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 diff --git a/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js new file mode 100644 index 0000000000..44204e8c93 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js @@ -0,0 +1,540 @@ +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 -w 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]:: Make local change to core +//// [/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; } +function foo() { } + + +Output:: +//// [/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; } +function foo() { } + +//// [/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":"2701734db0c9484494be1001fea37913-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; }\nfunction foo() { }","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": "2701734db0c9484494be1001fea37913-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; }\nfunction foo() { }", + "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": "2701734db0c9484494be1001fea37913-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; }\nfunction foo() { }", + "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": 1838 +} +//// [/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 diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js new file mode 100644 index 0000000000..ab0ccf36c5 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js @@ -0,0 +1,829 @@ +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 -w 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]:: change logic +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +let y: string = 10; + + +Output:: +logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +7 let y: string = 10; +   ~ + + +Found 1 error in logic/index.ts:7 + +//// [/user/username/projects/sample1/logic/index.js] *modified* +"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; +let y = 10; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *modified* +{"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;AACrB,IAAI,CAAC,GAAW,EAAE,CAAC"} +//// [/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":"3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;","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]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"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": "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": "3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;", + "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" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 177, + "end": 178, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 2046 +} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + + +Edit [1]:: change core +//// [/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; } +let x: string = 10; + + +Output:: +core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +4 let x: string = 10; +   ~ + +logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +7 let y: string = 10; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 core/index.ts:4 + 1 logic/index.ts:7 + +//// [/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; } +let x = 10; + +//// [/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":"bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;","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":182,"end":183,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"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": "bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;", + "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": "bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;", + "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": 182, + "end": 183, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1985 +} +//// [/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 + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: fix error in logic +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +Output:: +core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +4 let x: string = 10; +   ~ + + +Found 1 error in core/index.ts:4 + +//// [/user/username/projects/sample1/logic/index.js] *modified* +"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] *modified* +{"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] *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] *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": "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/tsconfig.tsbuildinfo] *mTime changed* + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/logic/index.ts diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js new file mode 100644 index 0000000000..0dd983a576 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js @@ -0,0 +1,829 @@ +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 -w tests --preserveWatchOutput +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]:: change logic +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +let y: string = 10; + + +Output:: +logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +7 let y: string = 10; +   ~ + + +Found 1 error in logic/index.ts:7 + +//// [/user/username/projects/sample1/logic/index.js] *modified* +"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; +let y = 10; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *modified* +{"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;AACrB,IAAI,CAAC,GAAW,EAAE,CAAC"} +//// [/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":"3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;","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]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"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": "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": "3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;", + "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" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 177, + "end": 178, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 2046 +} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] *mTime changed* + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + + +Edit [1]:: change core +//// [/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; } +let x: string = 10; + + +Output:: +core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +4 let x: string = 10; +   ~ + +logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +7 let y: string = 10; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 core/index.ts:4 + 1 logic/index.ts:7 + +//// [/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; } +let x = 10; + +//// [/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":"bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;","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":182,"end":183,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"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": "bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;", + "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": "bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;", + "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": 182, + "end": 183, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1985 +} +//// [/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 + +logic/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: fix error in logic +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +Output:: +core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +4 let x: string = 10; +   ~ + + +Found 1 error in core/index.ts:4 + +//// [/user/username/projects/sample1/logic/index.js] *modified* +"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] *modified* +{"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] *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] *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": "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/tsconfig.tsbuildinfo] *mTime changed* + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/logic/index.ts diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js new file mode 100644 index 0000000000..7e23d232ff --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js @@ -0,0 +1,748 @@ +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 -w tests --stopBuildOnErrors +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]:: change logic +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +let y: string = 10; + + +Output:: +logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +7 let y: string = 10; +   ~ + + +Found 1 error in logic/index.ts:7 + +//// [/user/username/projects/sample1/logic/index.js] *modified* +"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; +let y = 10; +//# sourceMappingURL=index.js.map +//// [/user/username/projects/sample1/logic/index.js.map] *modified* +{"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;AACrB,IAAI,CAAC,GAAW,EAAE,CAAC"} +//// [/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":"3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;","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]],"semanticDiagnosticsPerFile":[[4,[{"pos":177,"end":178,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"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": "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": "3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;", + "signature": "487f7216384ec40e22ff7dc40c01be4b-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "3abed61bf6897ffa70a069303f7ee37f-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;\nlet y: string = 10;", + "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" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./index.ts", + [ + { + "pos": 177, + "end": 178, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 2046 +} + +logic/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/logic/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/logic/index.ts + + +Edit [1]:: change core +//// [/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; } +let x: string = 10; + + +Output:: +core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +4 let x: string = 10; +   ~ + +logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +7 let y: string = 10; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 core/index.ts:4 + 1 logic/index.ts:7 + +//// [/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; } +let x = 10; + +//// [/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":"bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;","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":182,"end":183,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"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": "bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;", + "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": "bd46ecaf1bd821bbf62f3d94c22c2a57-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; }\nlet x: string = 10;", + "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": 182, + "end": 183, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 1985 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/index.ts + + +Diff:: Clean build will stop on error in core and will not report error in logic +Watch build will retain previous errors from logic and report it +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -3,6 +3,15 @@ + 4 let x: string = 10; +    ~ + +- +-Found 1 error in core/index.ts:4 ++logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. ++ ++7 let y: string = 10; ++   ~ ++ ++ ++Found 2 errors in 2 files. ++ ++Errors Files ++ 1 core/index.ts:4 ++ 1 logic/index.ts:7 + + +Edit [2]:: fix error in logic +//// [/user/username/projects/sample1/logic/index.ts] *modified* +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +Output:: +core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +4 let x: string = 10; +   ~ + + +Found 1 error in core/index.ts:4 + + diff --git a/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js new file mode 100644 index 0000000000..b274f041d0 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js @@ -0,0 +1,342 @@ +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, + "outDir": "outDir" + } +} +//// [/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 -w 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/outDir/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/outDir/anotherModule.d.ts] *new* +export declare const World = "hello"; + +//// [/user/username/projects/sample1/core/outDir/anotherModule.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + +//// [/user/username/projects/sample1/core/outDir/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/outDir/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/outDir/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,"outDir":"./"},"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/core/outDir/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, + "outDir": "./" + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1767 +} + +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 + + +Output:: + + + +Edit [1]:: Add new file +//// [/user/username/projects/sample1/core/file3.ts] *new* +export const y = 10; + + +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/outDir/tsconfig.tsbuildinfo' is older than input 'core/file3.ts' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +//// [/user/username/projects/sample1/core/outDir/file3.d.ts] *new* +export declare const y = 10; + +//// [/user/username/projects/sample1/core/outDir/file3.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = 10; + +//// [/user/username/projects/sample1/core/outDir/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","../anotherModule.ts","../file3.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":"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","signature":"7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\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,"outDir":"./"},"latestChangedDtsFile":"./file3.d.ts"} +//// [/user/username/projects/sample1/core/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../anotherModule.ts", + "../file3.ts", + "../index.ts", + "../some_decl.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../anotherModule.ts", + "../file3.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": "../file3.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\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, + "outDir": "./" + }, + "latestChangedDtsFile": "./file3.d.ts", + "size": 1949 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/file3.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/file3.ts + + +Edit [2]:: no change + + +Output:: + diff --git a/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js new file mode 100644 index 0000000000..f695341f33 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js @@ -0,0 +1,354 @@ +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 -w 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":[[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 +} + +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 + + +Output:: + + + +Edit [1]:: Add new file +//// [/user/username/projects/sample1/core/file3.ts] *new* +export const y = 10; + + +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/file3.ts' + +[HH:MM:SS AM] Building project 'core/tsconfig.json'... + +//// [/user/username/projects/sample1/core/file3.d.ts] *new* +export declare const y = 10; +//# sourceMappingURL=file3.d.ts.map +//// [/user/username/projects/sample1/core/file3.d.ts.map] *new* +{"version":3,"file":"file3.d.ts","sourceRoot":"","sources":["file3.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,CAAC,KAAK,CAAC"} +//// [/user/username/projects/sample1/core/file3.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.y = void 0; +exports.y = 10; + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./anotherModule.ts","./file3.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":"4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;","signature":"7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\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":"./file3.d.ts"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./anotherModule.ts", + "./file3.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "original": [ + 2, + 5 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./anotherModule.ts", + "./file3.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": "./file3.ts", + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4e905e76b648aae5f92e8bd5418e19b3-export const y = 10;", + "signature": "7ab1b6e8968172bdd365c972b27a69e2-export declare const y = 10;\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": "./file3.d.ts", + "size": 1999 +} + +core/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/sample1/core/file3.ts +Signatures:: +(computed .d.ts) /user/username/projects/sample1/core/file3.ts + + +Edit [2]:: no change + + +Output:: + diff --git a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/testdata/baselines/reference/tsbuildWatch/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..e4c1189d3d --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -0,0 +1,605 @@ +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 --watch +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]:: 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; } + + +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/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js new file mode 100644 index 0000000000..32891f0593 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -0,0 +1,606 @@ +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 --watch +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]:: 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; } + + +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/tsbuildWatch/sample/watches-config-files-that-are-not-present.js b/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js new file mode 100644 index 0000000000..d752b6949d --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js @@ -0,0 +1,575 @@ +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/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 -w tests +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +error TS6053: File '/user/username/projects/sample1/logic/tsconfig.json' not found. +tests/tsconfig.json:4:9 - error TS6053: File '/user/username/projects/sample1/logic' not found. + +4 { "path": "../logic" }, +   ~~~~~~~~~~~~~~~~~~~~~~ + + +Found 2 errors in the same file, starting at: tests/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; }; +//// [/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; + +//// [/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","errors":true,"root":[5],"fileNames":["lib.d.ts","../core/index.d.ts","../core/anotherModule.d.ts","../logic/index.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},{"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":[[2,3],[2,3,4]],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "errors": true, + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 5 + } + ], + "fileNames": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.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.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 + } + }, + { + "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/index.d.ts", + "../core/anotherModule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.ts" + ] + ], + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "../core/index.d.ts", + "../core/anotherModule.d.ts", + "../logic/index.ts", + "./index.ts" + ], + "latestChangedDtsFile": "./index.d.ts", + "size": 2352 +} + +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 + +tests/tsconfig.json:: +SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/sample1/core/index.d.ts +*not cached* /user/username/projects/sample1/core/anotherModule.d.ts +*not cached* /user/username/projects/sample1/logic/index.ts +*not cached* /user/username/projects/sample1/tests/index.ts +Signatures:: +(stored at emit) /user/username/projects/sample1/logic/index.ts +(stored at emit) /user/username/projects/sample1/tests/index.ts + + +Edit [0]:: Write logic +//// [/user/username/projects/sample1/logic/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "skipDefaultLibCheck": true, + }, + "references": [ + { "path": "../core" }, + ], +} + + +Output:: +//// [/user/username/projects/sample1/logic/index.d.ts] *rewrite with same content* +//// [/user/username/projects/sample1/logic/index.js] *modified* +"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.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 +} + +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:: +(used version) /user/username/projects/sample1/logic/index.d.ts +(computed .d.ts) /user/username/projects/sample1/tests/index.ts From 51aafa3a721b861749290bc833d07d283400224d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 29 Aug 2025 16:07:54 -0700 Subject: [PATCH 16/31] Fix strict value checking --- internal/checker/checker.go | 23 +- internal/compiler/program.go | 11 +- internal/core/compileroptions.go | 7 + internal/tsoptions/declscompiler.go | 10 +- .../works-with-extended-source-files.js | 289 ++++++++++++++++-- 5 files changed, 293 insertions(+), 47 deletions(-) diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 5db40b6f9f..969118b8cf 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -875,14 +875,14 @@ func NewChecker(program Program) *Checker { c.legacyDecorators = c.compilerOptions.ExperimentalDecorators == core.TSTrue c.emitStandardClassFields = !c.compilerOptions.UseDefineForClassFields.IsFalse() && c.compilerOptions.GetEmitScriptTarget() >= core.ScriptTargetES2022 c.allowSyntheticDefaultImports = c.compilerOptions.GetAllowSyntheticDefaultImports() - c.strictNullChecks = c.getStrictOptionValue(c.compilerOptions.StrictNullChecks) - c.strictFunctionTypes = c.getStrictOptionValue(c.compilerOptions.StrictFunctionTypes) - c.strictBindCallApply = c.getStrictOptionValue(c.compilerOptions.StrictBindCallApply) - c.strictPropertyInitialization = c.getStrictOptionValue(c.compilerOptions.StrictPropertyInitialization) - c.strictBuiltinIteratorReturn = c.getStrictOptionValue(c.compilerOptions.StrictBuiltinIteratorReturn) - c.noImplicitAny = c.getStrictOptionValue(c.compilerOptions.NoImplicitAny) - c.noImplicitThis = c.getStrictOptionValue(c.compilerOptions.NoImplicitThis) - c.useUnknownInCatchVariables = c.getStrictOptionValue(c.compilerOptions.UseUnknownInCatchVariables) + c.strictNullChecks = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.StrictNullChecks) + c.strictFunctionTypes = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.StrictFunctionTypes) + c.strictBindCallApply = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.StrictBindCallApply) + c.strictPropertyInitialization = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.StrictPropertyInitialization) + c.strictBuiltinIteratorReturn = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.StrictBuiltinIteratorReturn) + c.noImplicitAny = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.NoImplicitAny) + c.noImplicitThis = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.NoImplicitThis) + c.useUnknownInCatchVariables = c.compilerOptions.GetStrictOptionValue(c.compilerOptions.UseUnknownInCatchVariables) c.exactOptionalPropertyTypes = c.compilerOptions.ExactOptionalPropertyTypes == core.TSTrue c.canCollectSymbolAliasAccessibilityData = c.compilerOptions.VerbatimModuleSyntax.IsFalseOrUnknown() c.arrayVariances = []VarianceFlags{VarianceFlagsCovariant} @@ -1106,13 +1106,6 @@ func (c *Checker) reportUnmeasurableWorker(t *Type) *Type { return t } -func (c *Checker) getStrictOptionValue(value core.Tristate) bool { - if value != core.TSUnknown { - return value == core.TSTrue - } - return c.compilerOptions.Strict == core.TSTrue -} - // Resolve to the global class or interface by the given name and arity, or emptyObjectType/emptyGenericType otherwise func (c *Checker) getGlobalTypeResolver(name string, arity int, reportErrors bool) func() *Type { return core.Memoize(func() *Type { diff --git a/internal/compiler/program.go b/internal/compiler/program.go index a19e18b495..096b87f048 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -542,13 +542,6 @@ func (p *Program) verifyCompilerOptions() { } } - getStrictOptionValue := func(value core.Tristate) bool { - if value != core.TSUnknown { - return value == core.TSTrue - } - return options.Strict == core.TSTrue - } - // Removed in TS7 if options.BaseUrl != "" { @@ -586,10 +579,10 @@ func (p *Program) verifyCompilerOptions() { createRemovedOptionDiagnostic("module", "UMD", "") } - if options.StrictPropertyInitialization.IsTrue() && !getStrictOptionValue(options.StrictNullChecks) { + if options.StrictPropertyInitialization.IsTrue() && !options.GetStrictOptionValue(options.StrictNullChecks) { createDiagnosticForOptionName(diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks") } - if options.ExactOptionalPropertyTypes.IsTrue() && !getStrictOptionValue(options.StrictNullChecks) { + if options.ExactOptionalPropertyTypes.IsTrue() && !options.GetStrictOptionValue(options.StrictNullChecks) { createDiagnosticForOptionName(diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks") } diff --git a/internal/core/compileroptions.go b/internal/core/compileroptions.go index 7da3fba394..3252fa0d5d 100644 --- a/internal/core/compileroptions.go +++ b/internal/core/compileroptions.go @@ -292,6 +292,13 @@ func (options *CompilerOptions) GetJSXTransformEnabled() bool { return jsx == JsxEmitReact || jsx == JsxEmitReactJSX || jsx == JsxEmitReactJSXDev } +func (options *CompilerOptions) GetStrictOptionValue(value Tristate) bool { + if value != TSUnknown { + return value == TSTrue + } + return options.Strict == TSTrue +} + func (options *CompilerOptions) GetEffectiveTypeRoots(currentDirectory string) (result []string, fromConfig bool) { if options.TypeRoots != nil { return options.TypeRoots, true diff --git a/internal/tsoptions/declscompiler.go b/internal/tsoptions/declscompiler.go index 725b68dc3e..1223b52df5 100644 --- a/internal/tsoptions/declscompiler.go +++ b/internal/tsoptions/declscompiler.go @@ -1187,7 +1187,15 @@ func optionsHaveChanges(oldOptions *core.CompilerOptions, newOptions *core.Compi } oldOptionsValue := reflect.ValueOf(oldOptions).Elem() return ForEachCompilerOptionValue(newOptions, declFilter, func(option *CommandLineOption, value reflect.Value, i int) bool { - return !reflect.DeepEqual(value.Interface(), oldOptionsValue.Field(i).Interface()) + newValue := value.Interface() + oldValue := oldOptionsValue.Field(i).Interface() + if option.strictFlag { + return oldOptions.GetStrictOptionValue(oldValue.(core.Tristate)) != newOptions.GetStrictOptionValue(newValue.(core.Tristate)) + } + if option.allowJsFlag { + return oldOptions.GetAllowJS() != newOptions.GetAllowJS() + } + return !reflect.DeepEqual(newValue, oldValue) }) } diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js index 8155e6f7bb..22592e4dc2 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js @@ -302,23 +302,145 @@ Output:: [HH:MM:SS AM] Building project 'project1.tsconfig.json'... -[HH:MM:SS AM] Updating unchanged output timestamps of project 'project1.tsconfig.json'... - [HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'project2.tsconfig.tsbuildinfo' is older than input 'alpha.tsconfig.json' [HH:MM:SS AM] Building project 'project2.tsconfig.json'... -[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... - -//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *mTime changed* -//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/project/commonFile1.js] *rewrite with same content* +//// [/user/username/projects/project/commonFile2.js] *rewrite with same content* +//// [/user/username/projects/project/other.js] *rewrite with same content* +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./commonFile1.ts","./commonFile2.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1","signature":"0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"06ce815ba25b02847f0b8550f82f5a25-let y = 1","signature":"114cede92fdd1b7222858083021aeba2-declare let y: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"strict":true},"latestChangedDtsFile":"./commonFile2.d.ts"} +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./commonFile1.ts", + "./commonFile2.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./commonFile1.ts", + "./commonFile2.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile1.ts", + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile2.ts", + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "strict": true + }, + "latestChangedDtsFile": "./commonFile2.d.ts", + "size": 1330 +} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./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":"7148e8559d706b66aaba2a2423755c63-let z = 0;","signature":"879426698e1db06899fd57775c19b230-declare let z: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"strict":true},"latestChangedDtsFile":"./other.d.ts"} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./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": "./other.ts", + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "strict": true + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1119 +} project1.tsconfig.json:: SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/commonFile1.ts +*refresh* /user/username/projects/project/commonFile2.ts Signatures:: project2.tsconfig.json:: SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/other.ts Signatures:: @@ -340,12 +462,63 @@ Output:: [HH:MM:SS AM] Building project 'project2.tsconfig.json'... -[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... - -//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/project/other.js] *rewrite with same content* +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./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":"7148e8559d706b66aaba2a2423755c63-let z = 0;","signature":"879426698e1db06899fd57775c19b230-declare let z: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"strict":false},"latestChangedDtsFile":"./other.d.ts"} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./other.ts" + ], + "original": 2 + } + ], + "fileNames": [ + "lib.d.ts", + "./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": "./other.ts", + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7148e8559d706b66aaba2a2423755c63-let z = 0;", + "signature": "879426698e1db06899fd57775c19b230-declare let z: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true, + "strict": false + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1120 +} project2.tsconfig.json:: SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/other.ts Signatures:: @@ -362,15 +535,13 @@ Output:: * project2.tsconfig.json * project3.tsconfig.json -[HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'other.js' is older than input 'project2.tsconfig.json' +[HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'other2.js' is older than input 'project2.tsconfig.json' [HH:MM:SS AM] Building project 'project2.tsconfig.json'... -[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... - //// [/user/username/projects/project/commonFile1.js] *rewrite with same content* //// [/user/username/projects/project/commonFile2.js] *rewrite with same content* -//// [/user/username/projects/project/other.js] *mTime changed* +//// [/user/username/projects/project/other.js] *rewrite with same content* //// [/user/username/projects/project/other2.js] *rewrite with same content* //// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["./commonFile1.ts","./commonFile2.ts","./other.ts","./other2.ts"]} @@ -411,6 +582,7 @@ SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts *refresh* /user/username/projects/project/commonFile1.ts *refresh* /user/username/projects/project/commonFile2.ts +*refresh* /user/username/projects/project/other.ts *refresh* /user/username/projects/project/other2.ts Signatures:: (computed .d.ts) /user/username/projects/project/commonFile1.ts @@ -433,26 +605,99 @@ Output:: [HH:MM:SS AM] Building project 'project1.tsconfig.json'... -[HH:MM:SS AM] Updating unchanged output timestamps of project 'project1.tsconfig.json'... - [HH:MM:SS AM] Project 'project2.tsconfig.json' is out of date because output 'project2.tsconfig.tsbuildinfo' is older than input 'alpha.tsconfig.json' [HH:MM:SS AM] Building project 'project2.tsconfig.json'... -[HH:MM:SS AM] Updating unchanged output timestamps of project 'project2.tsconfig.json'... - -//// [/user/username/projects/project/commonFile1.js] *mTime changed* -//// [/user/username/projects/project/commonFile2.js] *mTime changed* -//// [/user/username/projects/project/other.js] *mTime changed* -//// [/user/username/projects/project/other2.js] *mTime changed* -//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *mTime changed* +//// [/user/username/projects/project/commonFile1.js] *rewrite with same content* +//// [/user/username/projects/project/commonFile2.js] *rewrite with same content* +//// [/user/username/projects/project/other.js] *rewrite with same content* +//// [/user/username/projects/project/other2.js] *rewrite with same content* +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./commonFile1.ts","./commonFile2.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1","signature":"0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"06ce815ba25b02847f0b8550f82f5a25-let y = 1","signature":"114cede92fdd1b7222858083021aeba2-declare let y: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./commonFile2.d.ts"} +//// [/user/username/projects/project/project1.tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./commonFile1.ts", + "./commonFile2.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./commonFile1.ts", + "./commonFile2.ts" + ], + "fileInfos": [ + { + "fileName": "lib.d.ts", + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "signature": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile1.ts", + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "4e1a8b13d3ccc04f0aaac579ade4a50b-let x = 1", + "signature": "0e529fdc590223d6038e844fdfd212cd-declare let x: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + }, + { + "fileName": "./commonFile2.ts", + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": "CommonJS", + "original": { + "version": "06ce815ba25b02847f0b8550f82f5a25-let y = 1", + "signature": "114cede92fdd1b7222858083021aeba2-declare let y: number;\n", + "affectsGlobalScope": true, + "impliedNodeFormat": 1 + } + } + ], + "options": { + "composite": true + }, + "latestChangedDtsFile": "./commonFile2.d.ts", + "size": 1316 +} +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/project/project2.tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* project1.tsconfig.json:: SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/commonFile1.ts +*refresh* /user/username/projects/project/commonFile2.ts Signatures:: project2.tsconfig.json:: SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/project/commonFile1.ts +*refresh* /user/username/projects/project/commonFile2.ts +*refresh* /user/username/projects/project/other.ts +*refresh* /user/username/projects/project/other2.ts Signatures:: From e9c4a24ec7dbf8f72b4b88c013f996a3e110662f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 29 Aug 2025 16:34:26 -0700 Subject: [PATCH 17/31] Fix duplicate error reporting --- internal/tsoptions/tsconfigparsing.go | 5 ----- .../works-with-extended-source-files.js | 14 +------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/internal/tsoptions/tsconfigparsing.go b/internal/tsoptions/tsconfigparsing.go index d81f75880a..f99f05e643 100644 --- a/internal/tsoptions/tsconfigparsing.go +++ b/internal/tsoptions/tsconfigparsing.go @@ -972,11 +972,6 @@ func getExtendedConfig( result.extendedSourceFiles.Add(extendedSourceFile) } } - - if len(cacheEntry.extendedResult.SourceFile.Diagnostics()) != 0 { - errors = append(errors, cacheEntry.extendedResult.SourceFile.Diagnostics()...) - return nil, errors - } } return cacheEntry.extendedConfig, errors } diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js index 22592e4dc2..3af1e50823 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js @@ -776,19 +776,7 @@ Output:: [HH:MM:SS AM] Project 'project3.tsconfig.json' is up to date because newest input 'other2.ts' is older than output 'project3.tsconfig.tsbuildinfo' error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. -error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. - -Found 2 errors. - - +Found 1 error. -Diff:: !!! Unexpected diff, please review and either fix or write explanation as expectedDiff !!! ---- nonIncremental.output.txt -+++ incremental.output.txt -@@ -1,4 +1,5 @@ - error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. -+error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. --Found 1 error. -+Found 2 errors. From f466e1faf6a1ec5fe535e44afb4a6ea95d16c4b4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 29 Aug 2025 16:35:01 -0700 Subject: [PATCH 18/31] Dirty automatically adds to pending update --- internal/execute/build/buildtask.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 10e0c6968f..07e642569b 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -740,7 +740,6 @@ func (t *buildTask) resetStatus() { func (t *buildTask) resetConfig(orchestrator *Orchestrator, path tspath.Path) { t.dirty = true orchestrator.host.resolvedReferences.Delete(path) - t.pending.Store(true) } func (t *buildTask) hasUpdate(orchestrator *Orchestrator, path tspath.Path) updateKind { From e058f9cc4e66dd7b6d57f059163920ae4f83ccef Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 29 Aug 2025 17:04:39 -0700 Subject: [PATCH 19/31] tsc -b -w noEmitOnError tests --- internal/execute/tsctests/sys.go | 22 +- internal/execute/tsctests/tsc_test.go | 64 ++ ...Error-with-declaration-with-incremental.js | 987 ++++++++++++++++++ .../noEmitOnError-with-declaration.js | 603 +++++++++++ .../noEmitOnError-with-incremental.js | 856 +++++++++++++++ .../noEmitOnError/noEmitOnError.js | 502 +++++++++ 6 files changed, 3021 insertions(+), 13 deletions(-) create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js diff --git a/internal/execute/tsctests/sys.go b/internal/execute/tsctests/sys.go index b7b462cb33..e6c7045f4e 100644 --- a/internal/execute/tsctests/sys.go +++ b/internal/execute/tsctests/sys.go @@ -542,36 +542,32 @@ func (s *testSys) removeNoError(path string) { } } -func (s *testSys) replaceFileText(path string, oldText string, newText string) { +func (s *testSys) readFileNoError(path string) string { content, ok := s.fsFromFileMap().ReadFile(path) if !ok { panic("File not found: " + path) } + return content +} + +func (s *testSys) replaceFileText(path string, oldText string, newText string) { + content := s.readFileNoError(path) content = strings.Replace(content, oldText, newText, 1) s.writeFileNoError(path, content, false) } func (s *testSys) replaceFileTextAll(path string, oldText string, newText string) { - content, ok := s.fsFromFileMap().ReadFile(path) - if !ok { - panic("File not found: " + path) - } + content := s.readFileNoError(path) content = strings.ReplaceAll(content, oldText, newText) s.writeFileNoError(path, content, false) } func (s *testSys) appendFile(path string, text string) { - content, ok := s.fsFromFileMap().ReadFile(path) - if !ok { - panic("File not found: " + path) - } + content := s.readFileNoError(path) s.writeFileNoError(path, content+text, false) } func (s *testSys) prependFile(path string, text string) { - content, ok := s.fsFromFileMap().ReadFile(path) - if !ok { - panic("File not found: " + path) - } + content := s.readFileNoError(path) s.writeFileNoError(path, text+content, false) } diff --git a/internal/execute/tsctests/tsc_test.go b/internal/execute/tsctests/tsc_test.go index 81eb372253..4ffb13fadc 100644 --- a/internal/execute/tsctests/tsc_test.go +++ b/internal/execute/tsctests/tsc_test.go @@ -2864,6 +2864,69 @@ func TestTscNoEmitOnError(t *testing.T) { } return testCases } + getTscWatchNoEmitOnErrorTestCases := func(scenarios []*tscNoEmitOnErrorScenario, commandLineArgs []string) []*tscInput { + var edits []*tscEdit + for _, scenario := range scenarios { + if edits != nil { + edits = append(edits, &tscEdit{ + caption: scenario.subScenario, + edit: func(sys *testSys) { + sys.writeFileNoError(`/user/username/projects/noEmitOnError/src/main.ts`, scenario.mainErrorContent, false) + }, + }) + } + edits = append(edits, + &tscEdit{ + caption: "No Change", + edit: func(sys *testSys) { + sys.writeFileNoError(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFileNoError(`/user/username/projects/noEmitOnError/src/main.ts`), false) + }, + }, + &tscEdit{ + caption: "Fix " + scenario.subScenario, + edit: func(sys *testSys) { + sys.writeFileNoError("/user/username/projects/noEmitOnError/src/main.ts", scenario.fixedErrorContent, false) + }, + }, + &tscEdit{ + caption: "No Change", + edit: func(sys *testSys) { + sys.writeFileNoError(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFileNoError(`/user/username/projects/noEmitOnError/src/main.ts`), false) + }, + }, + ) + } + return []*tscInput{ + { + subScenario: "noEmitOnError", + files: getTscNoEmitOnErrorFileMap(scenarios[0], false, false), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + { + subScenario: "noEmitOnError with declaration", + files: getTscNoEmitOnErrorFileMap(scenarios[0], true, false), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + { + subScenario: "noEmitOnError with incremental", + files: getTscNoEmitOnErrorFileMap(scenarios[0], false, true), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + { + subScenario: "noEmitOnError with declaration with incremental", + files: getTscNoEmitOnErrorFileMap(scenarios[0], true, true), + cwd: "/user/username/projects/noEmitOnError", + commandLineArgs: commandLineArgs, + edits: edits, + }, + } + } scenarios := []*tscNoEmitOnErrorScenario{ { subScenario: "syntax errors", @@ -2959,6 +3022,7 @@ func TestTscNoEmitOnError(t *testing.T) { }, }, }, + getTscWatchNoEmitOnErrorTestCases(scenarios, []string{"-b", "-w", "-v"}), ) for _, test := range testCases { diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js new file mode 100644 index 0000000000..57c7a371dc --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js @@ -0,0 +1,987 @@ +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 -w -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 +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 syntax errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +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 +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* + + + +Edit [3]:: semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = 10; + + +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'... + +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] *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":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","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]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[3]} +//// [/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": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "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" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 46, + "end": 47, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + "Js|Dts", + 3 + ] + ], + "size": 1755 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [4]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 [5]:: Fix semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +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/src/main.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/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:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [6]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* + + + +Edit [7]:: dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +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'... + +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] *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":"6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","signature":"86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.","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]],"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":[[3,17]]} +//// [/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": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "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" + ] + }, + "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": [ + [ + "../src/main.ts", + "Js|DtsEmit", + [ + 3, + 17 + ] + ] + ], + "size": 2150 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [8]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 [9]:: Fix dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + +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/src/main.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* +"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/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:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [10]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* + diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js new file mode 100644 index 0000000000..0f946cdd9c --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js @@ -0,0 +1,603 @@ +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 -w -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 +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 syntax errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +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 +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts +(stored at emit) /user/username/projects/noEmitOnError/src/other.ts + + +Edit [2]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = 10; + + +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'... + +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] *modified* +{"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] *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": 117, + "semanticErrors": true +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [4]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 [5]:: Fix semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/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* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [6]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +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'... + +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] *modified* +{"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] *modified* +{ + "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* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [8]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 [9]:: Fix dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *modified* +export declare const a: { + new (): { + p: number; + }; +}; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* +"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] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/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* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [10]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js new file mode 100644 index 0000000000..0e16f4237a --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js @@ -0,0 +1,856 @@ +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 -w -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 +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 syntax errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +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 +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* + + + +Edit [3]:: semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = 10; + + +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'... + +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] *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":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"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":[3]} +//// [/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": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;", + "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" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "pos": 46, + "end": 47, + "code": 2322, + "category": 1, + "message": "Type 'number' is not assignable to type 'string'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../src/main.ts", + "Js", + 3 + ] + ], + "size": 1536 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [4]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 [5]:: Fix semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +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/src/main.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/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 [6]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* + + + +Edit [7]:: dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +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] *modified* +"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/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":"6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","signature":"86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.","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": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };", + "signature": "86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.", + "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": 1605 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [8]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* + + + +Edit [9]:: Fix dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + +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 [10]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* + diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js new file mode 100644 index 0000000000..bf384c9e98 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js @@ -0,0 +1,502 @@ +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 -w -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 +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 syntax errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + +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:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [2]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = 10; + + +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'... + +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] *modified* +{"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] *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": 117, + "semanticErrors": true +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [4]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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 [5]:: Fix semantic errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +const a: string = "hello"; + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const a = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/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* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [6]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [7]:: dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* +"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] *mTime changed* +//// [/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* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [8]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [9]:: Fix dts errors +//// [/user/username/projects/noEmitOnError/src/main.ts] *modified* +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/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* /user/username/projects/noEmitOnError/src/main.ts +Signatures:: +(computed .d.ts) /user/username/projects/noEmitOnError/src/main.ts + + +Edit [10]:: No Change +//// [/user/username/projects/noEmitOnError/src/main.ts] *mTime changed* + + +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'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: From 74e01c99cba98dfb3d84b69dca2637850cc5bb1b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Sep 2025 12:24:43 -0700 Subject: [PATCH 20/31] Fix the timestamp update for buildInfo in nonIncremental mode --- internal/execute/build/buildtask.go | 5 ++--- ...ts-error-for-same-tsbuildinfo-file-without-incremental.js | 2 ++ .../noEmitOnError/noEmitOnError-with-declaration.js | 3 +++ .../reference/tsbuildWatch/noEmitOnError/noEmitOnError.js | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 07e642569b..192361b60f 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -673,13 +673,12 @@ func (t *buildTask) updateTimeStamps(orchestrator *Orchestrator, emittedFiles [] } } - if t.resolved.CompilerOptions().IsIncremental() { - updateTimeStamp(t.resolved.GetBuildInfoFileName()) - } else { + if !t.resolved.CompilerOptions().IsIncremental() { for outputFile := range t.resolved.GetOutputFileNames() { updateTimeStamp(outputFile) } } + updateTimeStamp(t.resolved.GetBuildInfoFileName()) } func (t *buildTask) cleanProject(orchestrator *Orchestrator, path tspath.Path) { 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 index 94b18a6cf3..fdab1fad98 100644 --- 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 @@ -51,6 +51,8 @@ Output:: 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 diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js index 0f946cdd9c..4d43453520 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js @@ -235,6 +235,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -406,6 +407,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -597,6 +599,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js index bf384c9e98..7b77478c11 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js @@ -219,6 +219,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -384,6 +385,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -444,6 +446,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -496,6 +499,7 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: From 2198655935214432e382b70d9044cc0576b76a93 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Sep 2025 12:40:03 -0700 Subject: [PATCH 21/31] Fix unnecessary tsbuildinfo emits when getting cached dts diagnostics --- .../execute/incremental/emitfileshandler.go | 29 ++++++++++++------- ...-dts-generation-errors-with-incremental.js | 3 -- .../noCheck/dts-errors-with-incremental.js | 4 --- .../dts-errors-with-incremental-as-modules.js | 4 --- .../noEmit/dts-errors-with-incremental.js | 4 --- ...rrors-with-declaration-with-incremental.js | 2 -- ...Error-with-declaration-with-incremental.js | 2 -- .../noEmitOnError-with-declaration.js | 2 -- ...-dts-generation-errors-with-incremental.js | 6 ---- ...ion-field-with-declaration-emit-enabled.js | 2 -- .../noCheck/dts-errors-with-incremental.js | 4 --- .../dts-errors-with-incremental-as-modules.js | 4 --- .../tsc/noEmit/dts-errors-with-incremental.js | 4 --- ...rrors-with-declaration-with-incremental.js | 2 -- 14 files changed, 18 insertions(+), 54 deletions(-) diff --git a/internal/execute/incremental/emitfileshandler.go b/internal/execute/incremental/emitfileshandler.go index 10129432b2..28239a6b19 100644 --- a/internal/execute/incremental/emitfileshandler.go +++ b/internal/execute/incremental/emitfileshandler.go @@ -12,8 +12,9 @@ import ( ) type emitUpdate struct { - pendingKind FileEmitKind - result *compiler.EmitResult + pendingKind FileEmitKind + result *compiler.EmitResult + dtsErrorsFromCache bool } type emitFilesHandler struct { @@ -107,10 +108,14 @@ func (h *emitFilesHandler) emitAllAffectedFiles(options compiler.EmitOptions) *c return true } pendingKind, _ := h.program.snapshot.affectedFilesPendingEmit.Load(path) - h.emitUpdates.Store(path, &emitUpdate{pendingKind: pendingKind, result: &compiler.EmitResult{ - EmitSkipped: true, - Diagnostics: diagnostics.getDiagnostics(h.program.program, affectedFile), - }}) + h.emitUpdates.Store(path, &emitUpdate{ + pendingKind: pendingKind, + result: &compiler.EmitResult{ + EmitSkipped: true, + Diagnostics: diagnostics.getDiagnostics(h.program.program, affectedFile), + }, + dtsErrorsFromCache: true, + }) } return true }) @@ -253,10 +258,13 @@ func (h *emitFilesHandler) updateSnapshot() []*compiler.EmitResult { h.program.snapshot.hasChangedDtsFile = true } 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.dtsErrorsFromCache { + if update.pendingKind == 0 { + h.program.snapshot.affectedFilesPendingEmit.Delete(file.Path()) + } else { + h.program.snapshot.affectedFilesPendingEmit.Store(file.Path(), update.pendingKind) + } + h.program.snapshot.buildInfoEmitPending.Store(true) } if update.result != nil { results = append(results, update.result) @@ -264,7 +272,6 @@ func (h *emitFilesHandler) updateSnapshot() []*compiler.EmitResult { h.program.snapshot.emitDiagnosticsPerFile.Store(file.Path(), &diagnosticsOrBuildInfoDiagnosticsWithFileName{diagnostics: update.result.Diagnostics}) } } - h.program.snapshot.buildInfoEmitPending.Store(true) } } return results 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 index 2af5eb59ab..a82f347c23 100644 --- 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 @@ -207,7 +207,6 @@ Output:: 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 @@ -219,8 +218,6 @@ index.ts 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:: diff --git a/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js index 0a85460c6f..92ec8ba77d 100644 --- a/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js @@ -210,8 +210,6 @@ Output:: 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:: @@ -610,8 +608,6 @@ Output:: 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:: 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 index fade69a22f..917f58c5d5 100644 --- 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 @@ -185,8 +185,6 @@ Output:: 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:: @@ -704,8 +702,6 @@ Output:: 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:: diff --git a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js index 6a76560995..660a979a45 100644 --- a/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js @@ -169,8 +169,6 @@ Output:: 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:: @@ -613,8 +611,6 @@ Output:: 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:: 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 index 17ecd83a5b..8cd1b339a5 100644 --- 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 @@ -222,8 +222,6 @@ Output:: 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:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js index 57c7a371dc..702cf5ed15 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js @@ -837,8 +837,6 @@ Output:: 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:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js index 4d43453520..524a5c3323 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js @@ -500,8 +500,6 @@ Output:: 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:: 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 index d7050ec3e8..4cd9f7b922 100644 --- 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 @@ -204,7 +204,6 @@ Output:: 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 @@ -216,8 +215,6 @@ index.ts 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:: @@ -241,7 +238,6 @@ Output:: 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 @@ -253,8 +249,6 @@ index.ts 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:: 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 302f4a812c..6733ef2ba7 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 @@ -360,8 +360,6 @@ Errors Files 1 MessageablePerson.ts:6 1 main.ts:3 -//// [/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:: diff --git a/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js b/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js index 459fb46b4b..31b85a5cb9 100644 --- a/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js @@ -196,8 +196,6 @@ Output:: 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:: @@ -565,8 +563,6 @@ Output:: 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:: 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 index 854835b970..0813159493 100644 --- 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 @@ -171,8 +171,6 @@ Output:: 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:: @@ -651,8 +649,6 @@ Output:: 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:: diff --git a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js index 0a87ea4533..21f7e2d3af 100644 --- a/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js @@ -155,8 +155,6 @@ Output:: 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:: @@ -560,8 +558,6 @@ Output:: 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:: 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 index d2ce772b4f..9ad5ae42c0 100644 --- 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 @@ -208,8 +208,6 @@ Output:: 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:: From c812ed4dd9259f8e9a7f28d2305038142ad776e4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Sep 2025 13:35:39 -0700 Subject: [PATCH 22/31] tsc -b -w noEmit testcases --- internal/execute/tsctests/tsc_test.go | 196 +++-- ...n-no-files-are-emitted-with-incremental.js | 227 ++++++ ...when-watching-when-no-files-are-emitted.js | 103 +++ .../dts-errors-with-incremental-as-modules.js | 692 ++++++++++++++++++ .../noEmit/dts-errors-with-incremental.js | 601 +++++++++++++++ ...dts-enabled-with-incremental-as-modules.js | 531 ++++++++++++++ ...rs-without-dts-enabled-with-incremental.js | 465 ++++++++++++ .../noEmit/dts-errors-without-dts-enabled.js | 223 ++++++ .../tsbuildWatch/noEmit/dts-errors.js | 309 ++++++++ ...ntic-errors-with-incremental-as-modules.js | 603 +++++++++++++++ .../semantic-errors-with-incremental.js | 535 ++++++++++++++ .../tsbuildWatch/noEmit/semantic-errors.js | 279 +++++++ ...ntax-errors-with-incremental-as-modules.js | 574 +++++++++++++++ .../noEmit/syntax-errors-with-incremental.js | 502 +++++++++++++ .../tsbuildWatch/noEmit/syntax-errors.js | 282 +++++++ 15 files changed, 6073 insertions(+), 49 deletions(-) create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js create mode 100644 testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js diff --git a/internal/execute/tsctests/tsc_test.go b/internal/execute/tsctests/tsc_test.go index 4ffb13fadc..17eb7ccc26 100644 --- a/internal/execute/tsctests/tsc_test.go +++ b/internal/execute/tsctests/tsc_test.go @@ -2441,7 +2441,7 @@ func TestTscNoEmit(t *testing.T) { aText: `const a = class { private p = 10; };`, }, } - getTscNoEmitAndErrorsFileMap := func(scenario *tscNoEmitScenario, incremental bool, asModules bool) FileMap { + getTscNoEmitAndErrorsFileMap := func(scenario *tscNoEmitScenario, incremental bool, asModules bool, modify func(FileMap)) 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(` @@ -2456,67 +2456,131 @@ func TestTscNoEmit(t *testing.T) { if asModules { files["/home/src/projects/project/b.ts"] = `export const b = 10;` } + if modify != nil { + modify(files) + } 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, + getTscNoEmitAndErrorsTestCasesWorker := func(commandLineArgs []string, addNoEmitOnCommandLine bool, modify func(FileMap), edits func(scenario *tscNoEmitScenario, commandLineArgs []string, asModules bool) []*tscEdit) []*tscInput { + testingCases := make([]*tscInput, 0, len(noEmitScenarios)*3) + commandLineArgsForInput := commandLineArgs + if addNoEmitOnCommandLine { + commandLineArgsForInput = slices.Concat(commandLineArgs, []string{"--noEmit"}) } - } - getTscNoEmitAndErrorsTestCases := func(scenarios []*tscNoEmitScenario, commandLineArgs []string) []*tscInput { - testingCases := make([]*tscInput, 0, len(scenarios)*3) - for _, scenario := range scenarios { + for _, scenario := range noEmitScenarios { testingCases = append( testingCases, &tscInput{ subScenario: scenario.subScenario, - commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), - files: getTscNoEmitAndErrorsFileMap(scenario, false, false), + commandLineArgs: commandLineArgsForInput, + files: getTscNoEmitAndErrorsFileMap(scenario, false, false, modify), cwd: "/home/src/projects/project", - edits: getTscNoEmitAndErrorsEdits(scenario, commandLineArgs, false), + edits: edits(scenario, commandLineArgs, false), }, &tscInput{ subScenario: scenario.subScenario + " with incremental", - commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), - files: getTscNoEmitAndErrorsFileMap(scenario, true, false), + commandLineArgs: commandLineArgsForInput, + files: getTscNoEmitAndErrorsFileMap(scenario, true, false, modify), cwd: "/home/src/projects/project", - edits: getTscNoEmitAndErrorsEdits(scenario, commandLineArgs, false), + edits: edits(scenario, commandLineArgs, false), }, &tscInput{ subScenario: scenario.subScenario + " with incremental as modules", - commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), - files: getTscNoEmitAndErrorsFileMap(scenario, true, true), + commandLineArgs: commandLineArgsForInput, + files: getTscNoEmitAndErrorsFileMap(scenario, true, true, modify), cwd: "/home/src/projects/project", - edits: getTscNoEmitAndErrorsEdits(scenario, commandLineArgs, true), + edits: edits(scenario, commandLineArgs, true), }, ) } return testingCases } + getTscNoEmitAndErrorsTestCases := func(commandLineArgs []string) []*tscInput { + return getTscNoEmitAndErrorsTestCasesWorker( + commandLineArgs, + true, + nil, + 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, + } + }, + ) + } + getTscNoEmitAndErrorsWatchTestCases := func(commandLineArgs []string) []*tscInput { + return getTscNoEmitAndErrorsTestCasesWorker( + commandLineArgs, + false, + func(files FileMap) { + files["/home/src/projects/project/tsconfig.json"] = strings.Replace(files["/home/src/projects/project/tsconfig.json"].(string), "}", `, "noEmit": true }`, 1) + }, + func(scenario *tscNoEmitScenario, commandLineArgs []string, asModules bool) []*tscEdit { + fixedATsContent := core.IfElse(asModules, "export ", "") + `const a = "hello";` + return []*tscEdit{ + { + caption: "Fix error", + edit: func(sys *testSys) { + sys.writeFileNoError("/home/src/projects/project/a.ts", fixedATsContent, false) + }, + }, + { + caption: "Emit after fixing error", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/projects/project/tsconfig.json", `"noEmit": true`, `"noEmit": false`) + }, + }, + { + caption: "no Emit run after fixing error", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/projects/project/tsconfig.json", `"noEmit": false`, `"noEmit": true`) + }, + }, + { + caption: "Introduce error", + edit: func(sys *testSys) { + sys.writeFileNoError("/home/src/projects/project/a.ts", scenario.aText, false) + }, + }, + { + caption: "Emit when error", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/projects/project/tsconfig.json", `"noEmit": true`, `"noEmit": false`) + }, + }, + { + caption: "no Emit run when error", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/projects/project/tsconfig.json", `"noEmit": false`, `"noEmit": true`) + }, + }, + } + }, + ) + } getTscNoEmitChangesFileMap := func(optionsStr string) FileMap { return FileMap{ "/home/src/workspaces/project/src/class.ts": stringtestutil.Dedent(` @@ -2566,7 +2630,7 @@ func TestTscNoEmit(t *testing.T) { optionsString: `"incremental": true`, }, } - getTscNoEmitChangesTestCases := func(scenarios []*tscNoEmitChangesScenario, commandLineArgs []string) []*tscInput { + getTscNoEmitChangesTestCases := func(commandLineArgs []string) []*tscInput { noChangeWithNoEmit := &tscEdit{ caption: "No Change run with noEmit", commandLineArgs: slices.Concat(commandLineArgs, []string{"--noEmit"}), @@ -2581,8 +2645,8 @@ func TestTscNoEmit(t *testing.T) { 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 := make([]*tscInput, 0, len(noEmitChangesScenarios)) + for _, scenario := range noEmitChangesScenarios { testCases = append( testCases, &tscInput{ @@ -2754,7 +2818,38 @@ func TestTscNoEmit(t *testing.T) { }, } } - + getTscNoEmitLoopTestCase := func(suffix string, commandLineArgs []string) *tscInput { + return &tscInput{ + subScenario: "does not go in loop when watching when no files are emitted" + suffix, + files: FileMap{ + "/user/username/projects/myproject/a.js": "", + "/user/username/projects/myproject/b.ts": "", + "/user/username/projects/myproject/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "allowJs": true, + "noEmit": true, + }, + }`), + }, + cwd: "/user/username/projects/myproject", + commandLineArgs: commandLineArgs, + edits: []*tscEdit{ + { + caption: "No change", + edit: func(sys *testSys) { + sys.writeFileNoError(`/user/username/projects/myproject/a.js`, sys.readFileNoError(`/user/username/projects/myproject/a.js`), false) + }, + }, + { + caption: "change", + edit: func(sys *testSys) { + sys.writeFileNoError(`/user/username/projects/myproject/a.js`, "const x = 10;", false) + }, + }, + }, + } + } testCases := slices.Concat( []*tscInput{ { @@ -2772,14 +2867,17 @@ func TestTscNoEmit(t *testing.T) { commandLineArgs: []string{"--noEmit"}, edits: noChangeOnlyEdit, }, + getTscNoEmitLoopTestCase("", []string{"-b", "-w", "-verbose"}), + getTscNoEmitLoopTestCase(" with incremental", []string{"-b", "-w", "-verbose", "--incremental"}), }, - getTscNoEmitAndErrorsTestCases(noEmitScenarios, []string{}), - getTscNoEmitAndErrorsTestCases(noEmitScenarios, []string{"-b", "-v"}), - getTscNoEmitChangesTestCases(noEmitChangesScenarios, []string{}), - getTscNoEmitChangesTestCases(noEmitChangesScenarios, []string{"-b", "-v"}), + getTscNoEmitAndErrorsTestCases([]string{}), + getTscNoEmitAndErrorsTestCases([]string{"-b", "-v"}), + getTscNoEmitChangesTestCases([]string{}), + getTscNoEmitChangesTestCases([]string{"-b", "-v"}), getTscNoEmitDtsChangesTestCases(), getTscNoEmitDtsChangesMultiFileErrorsTestCases([]string{}), getTscNoEmitDtsChangesMultiFileErrorsTestCases([]string{"-b", "-v"}), + getTscNoEmitAndErrorsWatchTestCases([]string{"-b", "-verbose", "-w"}), ) for _, test := range testCases { diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js new file mode 100644 index 0000000000..d124f95959 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js @@ -0,0 +1,227 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/a.js] *new* + +//// [/user/username/projects/myproject/b.ts] *new* + +//// [/user/username/projects/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "allowJs": true, + "noEmit": true, + }, +} + +tsgo -b -w -verbose --incremental +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; }; +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.js","./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},"99aa06d3014798d86001c324468d497f-","99aa06d3014798d86001c324468d497f-"],"options":{"allowJs":true},"affectedFilesPendingEmit":[2,3]} +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.js", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.js", + "./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.js", + "version": "99aa06d3014798d86001c324468d497f-", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b.ts", + "version": "99aa06d3014798d86001c324468d497f-", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "allowJs": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.js", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1001 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/a.js +*refresh* /user/username/projects/myproject/b.ts +Signatures:: + + +Edit [0]:: No change +//// [/user/username/projects/myproject/a.js] *mTime changed* + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + + + + +Edit [1]:: change +//// [/user/username/projects/myproject/a.js] *modified* +const x = 10; + + +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.js' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.js","./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},"99aa06d3014798d86001c324468d497f-"],"options":{"allowJs":true},"affectedFilesPendingEmit":[2,3]} +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.js", + "./b.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "./a.js", + "./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.js", + "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": "99aa06d3014798d86001c324468d497f-", + "signature": "99aa06d3014798d86001c324468d497f-", + "impliedNodeFormat": "CommonJS" + } + ], + "options": { + "allowJs": true + }, + "affectedFilesPendingEmit": [ + [ + "./a.js", + "Js", + 2 + ], + [ + "./b.ts", + "Js", + 3 + ] + ], + "size": 1145 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/a.js +Signatures:: +(computed .d.ts) /user/username/projects/myproject/a.js diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js new file mode 100644 index 0000000000..5d71a9b34b --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js @@ -0,0 +1,103 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/a.js] *new* + +//// [/user/username/projects/myproject/b.ts] *new* + +//// [/user/username/projects/myproject/tsconfig.json] *new* +{ + "compilerOptions": { + "allowJs": true, + "noEmit": true, + }, +} + +tsgo -b -w -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; }; +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":["./a.js","./b.ts"]} +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./a.js" + ], + "original": "./a.js" + }, + { + "files": [ + "./b.ts" + ], + "original": "./b.ts" + } + ], + "size": 54 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/a.js +*refresh* /user/username/projects/myproject/b.ts +Signatures:: + + +Edit [0]:: No change +//// [/user/username/projects/myproject/a.js] *mTime changed* + + +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.js' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: change +//// [/user/username/projects/myproject/a.js] *modified* +const x = 10; + + +Output:: + diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..87279d501f --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,692 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": true } +} + + +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 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js new file mode 100644 index 0000000000..fd20d19f51 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js @@ -0,0 +1,601 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": true + , "noEmit": true } +} + + +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 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000..f277ffd77f --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,531 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000..d8f5be346d --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,465 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000..8112f0492c --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js @@ -0,0 +1,223 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": false } +} + + +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:: +Signatures:: + + +Edit [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + + +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:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": false } +} + + +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:: +Signatures:: + + +Edit [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js new file mode 100644 index 0000000000..6ff1bb1607 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js @@ -0,0 +1,309 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": true + , "noEmit": false } +} + + +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:: +Signatures:: + + +Edit [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": true + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = class { private p = 10; }; + + +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:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": true + , "noEmit": false } +} + + +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:: +Signatures:: + + +Edit [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": true + , "noEmit": true } +} + + +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 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..39673fd40c --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,603 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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/tsbuildWatch/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js new file mode 100644 index 0000000000..2f38f56652 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js @@ -0,0 +1,535 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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/tsbuildWatch/noEmit/semantic-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js new file mode 100644 index 0000000000..74f167ec54 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js @@ -0,0 +1,279 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": false } +} + + +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:: +Signatures:: + + +Edit [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a: number = "hello" + + +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:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": false } +} + + +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:: +Signatures:: + + +Edit [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": true } +} + + +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/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000..c0f3f47a79 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,574 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +export const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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/tsbuildWatch/noEmit/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js new file mode 100644 index 0000000000..26eb3bea3d --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js @@ -0,0 +1,502 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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 [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + + +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 [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": false } +} + + +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 [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": true, + "declaration": false + , "noEmit": true } +} + + +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/tsbuildWatch/noEmit/syntax-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js new file mode 100644 index 0000000000..a053f59a11 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js @@ -0,0 +1,282 @@ +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 + , "noEmit": true } +} + +tsgo -b -verbose -w +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]:: Fix error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello"; + + +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:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [1]:: Emit after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": false } +} + + +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:: +Signatures:: + + +Edit [2]:: no Emit run after fixing error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": true } +} + + +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 'tsconfig.json' + +[HH:MM:SS AM] Building project 'tsconfig.json'... + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: Introduce error +//// [/home/src/projects/project/a.ts] *modified* +const a = "hello + + +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/projects/project/a.ts +Signatures:: + + +Edit [4]:: Emit when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": false } +} + + +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/projects/project/a.ts +Signatures:: +(computed .d.ts) /home/src/projects/project/a.ts + + +Edit [5]:: no Emit run when error +//// [/home/src/projects/project/tsconfig.json] *modified* +{ + "compilerOptions": { + "incremental": false, + "declaration": false + , "noEmit": true } +} + + +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:: From 8ca329d5708c8ef6d75c5644994768bf84a45000 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Sep 2025 14:06:06 -0700 Subject: [PATCH 23/31] Fix incorrectly storing timestamps of file where input and output names are same --- internal/execute/build/buildtask.go | 11 ++++++----- ...en-no-files-are-emitted-with-incremental.js | 3 +++ ...-when-watching-when-no-files-are-emitted.js | 18 ++++++++++++++++++ .../dts-errors-with-incremental-as-modules.js | 3 +++ .../noEmit/dts-errors-with-incremental.js | 3 +++ ...-dts-enabled-with-incremental-as-modules.js | 6 ++++++ ...ors-without-dts-enabled-with-incremental.js | 6 ++++++ .../noEmit/dts-errors-without-dts-enabled.js | 6 ++++++ .../tsbuildWatch/noEmit/dts-errors.js | 3 +++ ...antic-errors-with-incremental-as-modules.js | 3 +++ .../noEmit/semantic-errors-with-incremental.js | 3 +++ .../tsbuildWatch/noEmit/semantic-errors.js | 3 +++ ...yntax-errors-with-incremental-as-modules.js | 3 +++ .../noEmit/syntax-errors-with-incremental.js | 3 +++ .../tsbuildWatch/noEmit/syntax-errors.js | 3 +++ 15 files changed, 72 insertions(+), 5 deletions(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index 192361b60f..edb4809294 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -643,10 +643,11 @@ func (t *buildTask) reportUpToDateStatus(orchestrator *Orchestrator) { } } +func (t *buildTask) canUpdateJsDtsOutputTimestamps() bool { + return !t.resolved.CompilerOptions().NoEmit.IsTrue() && !t.resolved.CompilerOptions().IsIncremental() +} + 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 buildInfoName := t.resolved.GetBuildInfoFileName() @@ -673,7 +674,7 @@ func (t *buildTask) updateTimeStamps(orchestrator *Orchestrator, emittedFiles [] } } - if !t.resolved.CompilerOptions().IsIncremental() { + if t.canUpdateJsDtsOutputTimestamps() { for outputFile := range t.resolved.GetOutputFileNames() { updateTimeStamp(outputFile) } @@ -722,7 +723,7 @@ func (t *buildTask) updateWatch(orchestrator *Orchestrator, oldCache *collection t.inputFiles = core.Map(t.resolved.FileNames(), func(p string) time.Time { return orchestrator.host.loadOrStoreMTime(p, oldCache, false) }) - if !t.resolved.CompilerOptions().IsIncremental() { + if t.canUpdateJsDtsOutputTimestamps() { for outputFile := range t.resolved.GetOutputFileNames() { orchestrator.host.storeMTimeFromOldCache(outputFile, oldCache) } diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js index d124f95959..2833baedaf 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js @@ -130,6 +130,9 @@ Output:: [HH:MM:SS AM] Project '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 'tsconfig.json'... + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js index 5d71a9b34b..062cdb43b8 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js @@ -88,6 +88,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -100,4 +103,19 @@ const x = 10; 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.js' + +[HH:MM:SS AM] Building project 'tsconfig.json'... +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/myproject/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/myproject/a.js +Signatures:: +(computed .d.ts) /user/username/projects/myproject/a.js diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js index 87279d501f..483b8f7073 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js @@ -382,6 +382,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js index fd20d19f51..5f5c0fffde 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js @@ -323,6 +323,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js index f277ffd77f..82e8fb70bc 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -323,6 +323,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -525,6 +528,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js index d8f5be346d..7498e4096c 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -279,6 +279,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -459,6 +462,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js index 8112f0492c..465b0b0140 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js @@ -138,6 +138,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: @@ -217,6 +220,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js index 6ff1bb1607..0b427e8210 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js @@ -167,6 +167,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js index 39673fd40c..f71d54e003 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js @@ -345,6 +345,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js index 2f38f56652..244837ae34 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js @@ -301,6 +301,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js index 74f167ec54..5154ffebf3 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js @@ -160,6 +160,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js index c0f3f47a79..812e06bc72 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js @@ -339,6 +339,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js index 26eb3bea3d..18571fb41c 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js @@ -292,6 +292,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js index a053f59a11..5322dd9c89 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js @@ -160,6 +160,9 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: SemanticDiagnostics:: From 3284900138e94caa0d29094398a0777fd7571cf3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 4 Sep 2025 10:36:14 -0700 Subject: [PATCH 24/31] tsc -b -w module resolution tests --- internal/execute/tsctests/sys.go | 5 + internal/execute/tsctests/tsc_test.go | 175 ++++++ ...for-changes-to-package-json-main-fields.js | 311 +++++++++++ ...se-different-module-resolution-settings.js | 396 ++++++++++++++ ...t-correctly-with-cts-and-mts-extensions.js | 508 ++++++++++++++++++ 5 files changed, 1395 insertions(+) create mode 100644 testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js create mode 100644 testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js create mode 100644 testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js diff --git a/internal/execute/tsctests/sys.go b/internal/execute/tsctests/sys.go index e6c7045f4e..1a16285afc 100644 --- a/internal/execute/tsctests/sys.go +++ b/internal/execute/tsctests/sys.go @@ -550,6 +550,11 @@ func (s *testSys) readFileNoError(path string) string { return content } +func (s *testSys) renameFileNoError(oldPath string, newPath string) { + s.writeFileNoError(newPath, s.readFileNoError(oldPath), false) + s.removeNoError(oldPath) +} + func (s *testSys) replaceFileText(path string, oldText string, newText string) { content := s.readFileNoError(path) content = strings.Replace(content, oldText, newText, 1) diff --git a/internal/execute/tsctests/tsc_test.go b/internal/execute/tsctests/tsc_test.go index 17eb7ccc26..a28f9112bb 100644 --- a/internal/execute/tsctests/tsc_test.go +++ b/internal/execute/tsctests/tsc_test.go @@ -2325,6 +2325,181 @@ func TestTscModuleResolution(t *testing.T) { }, }, }, + { + subScenario: "handles the cache correctly when two projects use different module resolution settings", + files: FileMap{ + `/user/username/projects/myproject/project1/index.ts`: `import { foo } from "file";`, + `/user/username/projects/myproject/project1/node_modules/file/index.d.ts`: "export const foo = 10;", + `/user/username/projects/myproject/project1/tsconfig.json`: stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "types": ["foo", "bar"] + }, + "files": ["index.ts"], + }`), + `/user/username/projects/myproject/project2/index.ts`: `import { foo } from "file";`, + `/user/username/projects/myproject/project2/node_modules/file/index.d.ts`: "export const foo = 10;", + `/user/username/projects/myproject/project2/tsconfig.json`: stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "types": ["foo"], + "module": "nodenext", + "moduleResolution": "nodenext" + }, + "files": ["index.ts"], + }`), + `/user/username/projects/myproject/node_modules/@types/foo/index.d.ts`: "export const foo = 10;", + `/user/username/projects/myproject/node_modules/@types/bar/index.d.ts`: "export const bar = 10;", + `/user/username/projects/myproject/tsconfig.json`: stringtestutil.Dedent(` + { + "files": [], + "references": [ + { "path": "./project1" }, + { "path": "./project2" }, + ], + }`), + }, + cwd: "/user/username/projects/myproject", + commandLineArgs: []string{"--b", "-w", "-v"}, + edits: []*tscEdit{ + { + caption: "Append text", + edit: func(sys *testSys) { + sys.appendFile(`/user/username/projects/myproject/project1/index.ts`, "const bar = 10;") + }, + }, + }, + }, + { + // !!! sheetal package.json watches not yet implemented + subScenario: `resolves specifier in output declaration file from referenced project correctly with cts and mts extensions`, + files: FileMap{ + `/user/username/projects/myproject/packages/pkg1/package.json`: stringtestutil.Dedent(` + { + "name": "pkg1", + "version": "1.0.0", + "main": "build/index.js", + "type": "module" + }`), + `/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(` + { + "compilerOptions": { + "outDir": "build", + "module": "node16", + }, + "references": [{ "path": "../pkg2" }], + }`), + `/user/username/projects/myproject/packages/pkg2/const.cts`: `export type TheNum = 42;`, + `/user/username/projects/myproject/packages/pkg2/index.ts`: `export type { TheNum } from './const.cjs';`, + `/user/username/projects/myproject/packages/pkg2/tsconfig.json`: stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "build", + "module": "node16", + }, + }`), + `/user/username/projects/myproject/packages/pkg2/package.json`: stringtestutil.Dedent(` + { + "name": "pkg2", + "version": "1.0.0", + "main": "build/index.js", + "type": "module" + }`), + `/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", "-w", "--verbose", "--traceResolution"}, + edits: []*tscEdit{ + { + caption: "reports import errors after change to package file", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/myproject/packages/pkg1/package.json`, `"module"`, `"commonjs"`) + }, + expectedDiff: "Package.json watch pending, so no change detected yet", + }, + { + caption: "removes those errors when a package file is changed back", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/myproject/packages/pkg1/package.json`, `"commonjs"`, `"module"`) + }, + }, + { + caption: "reports import errors after change to package file", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/myproject/packages/pkg1/package.json`, `"module"`, `"commonjs"`) + }, + expectedDiff: "Package.json watch pending, so no change detected yet", + }, + { + caption: "removes those errors when a package file is changed to cjs extensions", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/myproject/packages/pkg2/package.json`, `"build/index.js"`, `"build/index.cjs"`) + sys.renameFileNoError(`/user/username/projects/myproject/packages/pkg2/index.ts`, `/user/username/projects/myproject/packages/pkg2/index.cts`) + }, + }, + }, + }, + { + subScenario: `build mode watches for changes to package-json main fields`, + files: FileMap{ + `/user/username/projects/myproject/packages/pkg1/package.json`: stringtestutil.Dedent(` + { + "name": "pkg1", + "version": "1.0.0", + "main": "build/index.js" + }`), + `/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(` + { + "compilerOptions": { + "outDir": "build", + }, + "references": [{ "path": "../pkg2" }], + }`), + `/user/username/projects/myproject/packages/pkg2/tsconfig.json`: stringtestutil.Dedent(` + { + "compilerOptions": { + "composite": true, + "outDir": "build", + }, + }`), + `/user/username/projects/myproject/packages/pkg2/const.ts`: `export type TheNum = 42;`, + `/user/username/projects/myproject/packages/pkg2/index.ts`: `export type { TheNum } from './const.js';`, + `/user/username/projects/myproject/packages/pkg2/other.ts`: `export type TheStr = string;`, + `/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", "-w", "--traceResolution"}, + edits: []*tscEdit{ + { + caption: "reports import errors after change to package file", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/myproject/packages/pkg2/package.json`, `index.js`, `other.js`) + }, + expectedDiff: "Package.json watch pending, so no change detected yet", + }, + { + caption: "removes those errors when a package file is changed back", + edit: func(sys *testSys) { + sys.replaceFileText(`/user/username/projects/myproject/packages/pkg2/package.json`, `other.js`, `index.js`) + }, + }, + }, + }, } for _, test := range testCases { diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js new file mode 100644 index 0000000000..cb05828298 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js @@ -0,0 +1,311 @@ +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/package.json] *new* +{ + "name": "pkg1", + "version": "1.0.0", + "main": "build/index.js" +} +//// [/user/username/projects/myproject/packages/pkg1/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "build", + }, + "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.js'; +//// [/user/username/projects/myproject/packages/pkg2/other.ts] *new* +export type TheStr = string; +//// [/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", + }, +} + +tsgo -b packages/pkg1 --verbose -w --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.js' 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'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/user/username/projects/myproject/packages/pkg2/const.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/const.ts' exists - use it as a name resolution result. +======== Module name './const.js' 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'. +Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. +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.js' 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'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.js', target file types: TypeScript, JavaScript, Declaration, JSON. +File name '/user/username/projects/myproject/packages/pkg2/const.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/const.ts' exists - use it as a name resolution result. +======== Module name './const.js' 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.js'; + +//// [/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/other.d.ts] *new* +export type TheStr = string; + +//// [/user/username/projects/myproject/packages/pkg2/build/other.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","../const.ts","../index.ts","../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":"be0f939ab1143e4064a3742586332724-export type TheNum = 42;","signature":"56e2d69d2edd1f0edd1a64ecfdf6de0d-export type TheNum = 42;\n","impliedNodeFormat":1},{"version":"c95c354b23966e289caeaece40bb8d0a-export type { TheNum } from './const.js';","signature":"f257912cfebb94a04c6ba4e8f754166a-export type { TheNum } from './const.js';\n","impliedNodeFormat":1},{"version":"dfadcd1940a5dc36721d3311ebd8eb8b-export type TheStr = string;","signature":"9551f60bc06319547b96535db4cb8520-export type TheStr = string;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./other.d.ts"} +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../const.ts", + "../index.ts", + "../other.ts" + ], + "original": [ + 2, + 4 + ] + } + ], + "fileNames": [ + "lib.d.ts", + "../const.ts", + "../index.ts", + "../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": "../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": "c95c354b23966e289caeaece40bb8d0a-export type { TheNum } from './const.js';", + "signature": "f257912cfebb94a04c6ba4e8f754166a-export type { TheNum } from './const.js';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "c95c354b23966e289caeaece40bb8d0a-export type { TheNum } from './const.js';", + "signature": "f257912cfebb94a04c6ba4e8f754166a-export type { TheNum } from './const.js';\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../other.ts", + "version": "dfadcd1940a5dc36721d3311ebd8eb8b-export type TheStr = string;", + "signature": "9551f60bc06319547b96535db4cb8520-export type TheStr = string;\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "dfadcd1940a5dc36721d3311ebd8eb8b-export type TheStr = string;", + "signature": "9551f60bc06319547b96535db4cb8520-export type TheStr = string;\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../const.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../index.ts": [ + "../const.ts" + ] + }, + "latestChangedDtsFile": "./other.d.ts", + "size": 1564 +} + +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 +*refresh* /user/username/projects/myproject/packages/pkg2/other.ts +Signatures:: +(stored at emit) /user/username/projects/myproject/packages/pkg2/const.ts +(stored at emit) /user/username/projects/myproject/packages/pkg2/index.ts +(stored at emit) /user/username/projects/myproject/packages/pkg2/other.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:: + + +Edit [0]:: reports import errors after change to package file +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg2/package.json] *modified* +{ + "name": "pkg2", + "version": "1.0.0", + "main": "build/other.js" +} + + +Output:: +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* + + + +Diff:: Package.json watch pending, so no change detected yet +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,8 +0,0 @@ +-packages/pkg1/index.ts:1:15 - error TS2305: Module '"pkg2"' has no exported member 'TheNum'. +- +-1 import type { TheNum } from 'pkg2' +-   ~~~~~~ +- +- +-Found 1 error in packages/pkg1/index.ts:1 +- + +Edit [1]:: removes those errors when a package file is changed back +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg2/package.json] *modified* +{ + "name": "pkg2", + "version": "1.0.0", + "main": "build/index.js" +} + + +Output:: +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* + diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js new file mode 100644 index 0000000000..a5c0c4577a --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js @@ -0,0 +1,396 @@ +currentDirectory::/user/username/projects/myproject +useCaseSensitiveFileNames::true +Input:: +//// [/user/username/projects/myproject/node_modules/@types/bar/index.d.ts] *new* +export const bar = 10; +//// [/user/username/projects/myproject/node_modules/@types/foo/index.d.ts] *new* +export const foo = 10; +//// [/user/username/projects/myproject/project1/index.ts] *new* +import { foo } from "file"; +//// [/user/username/projects/myproject/project1/node_modules/file/index.d.ts] *new* +export const foo = 10; +//// [/user/username/projects/myproject/project1/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "types": ["foo", "bar"] + }, + "files": ["index.ts"], +} +//// [/user/username/projects/myproject/project2/index.ts] *new* +import { foo } from "file"; +//// [/user/username/projects/myproject/project2/node_modules/file/index.d.ts] *new* +export const foo = 10; +//// [/user/username/projects/myproject/project2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "types": ["foo"], + "module": "nodenext", + "moduleResolution": "nodenext" + }, + "files": ["index.ts"], +} +//// [/user/username/projects/myproject/tsconfig.json] *new* +{ + "files": [], + "references": [ + { "path": "./project1" }, + { "path": "./project2" }, + ], +} + +tsgo --b -w -v +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/tsconfig.json + * project2/tsconfig.json + * 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'... + +[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'... + +//// [/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/myproject/project1/index.d.ts] *new* +export {}; + +//// [/user/username/projects/myproject/project1/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/project1/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","./node_modules/file/index.d.ts","./index.ts","../node_modules/@types/foo/index.d.ts","../node_modules/@types/bar/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},"bf6a9897955595825a99e7ef50878c55-export const foo = 10;",{"version":"7ae42cb6eee47288e3acb472bb3aad16-import { foo } from \"file\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"bf6a9897955595825a99e7ef50878c55-export const foo = 10;","a0d503557e945e94b2464694c91a48ba-export const bar = 10;"],"fileIdsList":[[2]],"options":{"composite":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/myproject/project1/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "./node_modules/file/index.d.ts", + "./index.ts", + "../node_modules/@types/foo/index.d.ts", + "../node_modules/@types/bar/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": "./node_modules/file/index.d.ts", + "version": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "signature": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7ae42cb6eee47288e3acb472bb3aad16-import { foo } from \"file\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7ae42cb6eee47288e3acb472bb3aad16-import { foo } from \"file\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@types/foo/index.d.ts", + "version": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "signature": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../node_modules/@types/bar/index.d.ts", + "version": "a0d503557e945e94b2464694c91a48ba-export const bar = 10;", + "signature": "a0d503557e945e94b2464694c91a48ba-export const bar = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "./node_modules/file/index.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./index.ts": [ + "./node_modules/file/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1417 +} +//// [/user/username/projects/myproject/project2/index.d.ts] *new* +export {}; + +//// [/user/username/projects/myproject/project2/index.js] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/project2/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.esnext.full.d.ts","./node_modules/file/index.d.ts","./index.ts","../node_modules/@types/foo/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},"bf6a9897955595825a99e7ef50878c55-export const foo = 10;",{"version":"7ae42cb6eee47288e3acb472bb3aad16-import { foo } from \"file\";","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"bf6a9897955595825a99e7ef50878c55-export const foo = 10;"],"fileIdsList":[[2]],"options":{"composite":true,"module":199},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/myproject/project2/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.esnext.full.d.ts", + "./node_modules/file/index.d.ts", + "./index.ts", + "../node_modules/@types/foo/index.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": "./node_modules/file/index.d.ts", + "version": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "signature": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "7ae42cb6eee47288e3acb472bb3aad16-import { foo } from \"file\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7ae42cb6eee47288e3acb472bb3aad16-import { foo } from \"file\";", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@types/foo/index.d.ts", + "version": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "signature": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "./node_modules/file/index.d.ts" + ] + ], + "options": { + "composite": true, + "module": 199 + }, + "referencedMap": { + "./index.ts": [ + "./node_modules/file/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1344 +} + +project1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/myproject/project1/node_modules/file/index.d.ts +*refresh* /user/username/projects/myproject/project1/index.ts +*refresh* /user/username/projects/myproject/node_modules/@types/foo/index.d.ts +*refresh* /user/username/projects/myproject/node_modules/@types/bar/index.d.ts +Signatures:: +(stored at emit) /user/username/projects/myproject/project1/index.ts + +project2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.esnext.full.d.ts +*refresh* /user/username/projects/myproject/project2/node_modules/file/index.d.ts +*refresh* /user/username/projects/myproject/project2/index.ts +*refresh* /user/username/projects/myproject/node_modules/@types/foo/index.d.ts +Signatures:: +(stored at emit) /user/username/projects/myproject/project2/index.ts + + +Edit [0]:: Append text +//// [/user/username/projects/myproject/project1/index.ts] *modified* +import { foo } from "file";const bar = 10; + + +Output:: +[HH:MM:SS AM] Projects in this build: + * project1/tsconfig.json + * project2/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'project1/tsconfig.json' is out of date because output 'project1/tsconfig.tsbuildinfo' is older than input 'project1/index.ts' + +[HH:MM:SS AM] Building project 'project1/tsconfig.json'... + +//// [/user/username/projects/myproject/project1/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const bar = 10; + +//// [/user/username/projects/myproject/project1/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[3],"fileNames":["lib.d.ts","./node_modules/file/index.d.ts","./index.ts","../node_modules/@types/foo/index.d.ts","../node_modules/@types/bar/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},"bf6a9897955595825a99e7ef50878c55-export const foo = 10;",{"version":"1ab147b130b9a5309305c28d6be6beb4-import { foo } from \"file\";const bar = 10;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"bf6a9897955595825a99e7ef50878c55-export const foo = 10;","a0d503557e945e94b2464694c91a48ba-export const bar = 10;"],"fileIdsList":[[2]],"options":{"composite":true},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.ts"} +//// [/user/username/projects/myproject/project1/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./index.ts" + ], + "original": 3 + } + ], + "fileNames": [ + "lib.d.ts", + "./node_modules/file/index.d.ts", + "./index.ts", + "../node_modules/@types/foo/index.d.ts", + "../node_modules/@types/bar/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": "./node_modules/file/index.d.ts", + "version": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "signature": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./index.ts", + "version": "1ab147b130b9a5309305c28d6be6beb4-import { foo } from \"file\";const bar = 10;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "1ab147b130b9a5309305c28d6be6beb4-import { foo } from \"file\";const bar = 10;", + "signature": "abe7d9981d6018efb6b2b794f40a1607-export {};\n", + "impliedNodeFormat": 1 + } + }, + { + "fileName": "../node_modules/@types/foo/index.d.ts", + "version": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "signature": "bf6a9897955595825a99e7ef50878c55-export const foo = 10;", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../node_modules/@types/bar/index.d.ts", + "version": "a0d503557e945e94b2464694c91a48ba-export const bar = 10;", + "signature": "a0d503557e945e94b2464694c91a48ba-export const bar = 10;", + "impliedNodeFormat": "CommonJS" + } + ], + "fileIdsList": [ + [ + "./node_modules/file/index.d.ts" + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./index.ts": [ + "./node_modules/file/index.d.ts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1432 +} + +project1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/myproject/project1/index.ts +Signatures:: +(computed .d.ts) /user/username/projects/myproject/project1/index.ts diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js new file mode 100644 index 0000000000..e9aa2fc045 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -0,0 +1,508 @@ +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/package.json] *new* +{ + "name": "pkg1", + "version": "1.0.0", + "main": "build/index.js", + "type": "module" +} +//// [/user/username/projects/myproject/packages/pkg1/tsconfig.json] *new* +{ + "compilerOptions": { + "outDir": "build", + "module": "node16", + }, + "references": [{ "path": "../pkg2" }], +} +//// [/user/username/projects/myproject/packages/pkg2/const.cts] *new* +export type TheNum = 42; +//// [/user/username/projects/myproject/packages/pkg2/index.ts] *new* +export type { TheNum } from './const.cjs'; +//// [/user/username/projects/myproject/packages/pkg2/package.json] *new* +{ + "name": "pkg2", + "version": "1.0.0", + "main": "build/index.js", + "type": "module" +} +//// [/user/username/projects/myproject/packages/pkg2/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "outDir": "build", + "module": "node16", + }, +} + +tsgo -b packages/pkg1 -w --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.cjs' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file types: TypeScript, JavaScript, Declaration. +File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/const.cts' exists - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== +[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 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +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'. +'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.cjs' 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 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file types: TypeScript, JavaScript, Declaration. +File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/const.cts' exists - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== +//// [/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/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg1/build/index.js] *new* +export const 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.cjs] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] *new* +export type TheNum = 42; + +//// [/user/username/projects/myproject/packages/pkg2/build/index.d.ts] *new* +export type { TheNum } from './const.cjs'; + +//// [/user/username/projects/myproject/packages/pkg2/build/index.js] *new* +export {}; + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.es2022.full.d.ts","../const.cts","../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":"7bb214373f4d1876e9a0040d287d1b6e-export type { TheNum } from './const.cjs';","signature":"2c7786a1f125eb57a4db00a4d58e384a-export type { TheNum } from './const.cjs';\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"module":100,"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.cts", + "../index.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "../const.cts", + "../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": "../const.cts", + "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": "7bb214373f4d1876e9a0040d287d1b6e-export type { TheNum } from './const.cjs';", + "signature": "2c7786a1f125eb57a4db00a4d58e384a-export type { TheNum } from './const.cjs';\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "7bb214373f4d1876e9a0040d287d1b6e-export type { TheNum } from './const.cjs';", + "signature": "2c7786a1f125eb57a4db00a4d58e384a-export type { TheNum } from './const.cjs';\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "../const.cts" + ] + ], + "options": { + "composite": true, + "module": 100, + "outDir": "./" + }, + "referencedMap": { + "../index.ts": [ + "../const.cts" + ] + }, + "latestChangedDtsFile": "./index.d.ts", + "size": 1403 +} + +packages/pkg2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /user/username/projects/myproject/packages/pkg2/const.cts +*refresh* /user/username/projects/myproject/packages/pkg2/index.ts +Signatures:: +(stored at emit) /user/username/projects/myproject/packages/pkg2/const.cts +(stored at emit) /user/username/projects/myproject/packages/pkg2/index.ts + +packages/pkg1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2022.full.d.ts +*refresh* /user/username/projects/myproject/packages/pkg2/build/const.d.cts +*refresh* /user/username/projects/myproject/packages/pkg2/build/index.d.ts +*refresh* /user/username/projects/myproject/packages/pkg1/index.ts +Signatures:: + + +Edit [0]:: reports import errors after change to package file +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg1/package.json] *modified* +{ + "name": "pkg1", + "version": "1.0.0", + "main": "build/index.js", + "type": "commonjs" +} + + +Output:: +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* + + + +Diff:: Package.json watch pending, so no change detected yet +--- nonIncremental /user/username/projects/myproject/packages/pkg1/build/index.js ++++ incremental /user/username/projects/myproject/packages/pkg1/build/index.js +@@ -1,4 +1,1 @@ +-"use strict"; +-Object.defineProperty(exports, "__esModule", { value: true }); +-exports.theNum = void 0; +-exports.theNum = 42; ++export const theNum = 42; +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,9 +0,0 @@ +-packages/pkg1/index.ts:1:29 - error TS1541: Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute. +- To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. +- +-1 import type { TheNum } from 'pkg2' +-   ~~~~~~ +- +- +-Found 1 error in packages/pkg1/index.ts:1 +- + +Edit [1]:: removes those errors when a package file is changed back +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg1/package.json] *modified* +{ + "name": "pkg1", + "version": "1.0.0", + "main": "build/index.js", + "type": "module" +} + + +Output:: +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* + + + +Edit [2]:: reports import errors after change to package file +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg1/package.json] *modified* +{ + "name": "pkg1", + "version": "1.0.0", + "main": "build/index.js", + "type": "commonjs" +} + + +Output:: +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* + + + +Diff:: Package.json watch pending, so no change detected yet +--- nonIncremental /user/username/projects/myproject/packages/pkg1/build/index.js ++++ incremental /user/username/projects/myproject/packages/pkg1/build/index.js +@@ -1,4 +1,1 @@ +-"use strict"; +-Object.defineProperty(exports, "__esModule", { value: true }); +-exports.theNum = void 0; +-exports.theNum = 42; ++export const theNum = 42; +--- nonIncremental.output.txt ++++ incremental.output.txt +@@ -1,9 +0,0 @@ +-packages/pkg1/index.ts:1:29 - error TS1541: Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute. +- To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. +- +-1 import type { TheNum } from 'pkg2' +-   ~~~~~~ +- +- +-Found 1 error in packages/pkg1/index.ts:1 +- + +Edit [3]:: removes those errors when a package file is changed to cjs extensions +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg2/index.cts] *new* +export type { TheNum } from './const.cjs'; +//// [/user/username/projects/myproject/packages/pkg2/index.ts] *deleted* +//// [/user/username/projects/myproject/packages/pkg2/package.json] *modified* +{ + "name": "pkg2", + "version": "1.0.0", + "main": "build/index.cjs", + "type": "module" +} + + +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 'packages/pkg2/build/tsconfig.tsbuildinfo' is older than input 'packages/pkg2/index.cts' + +[HH:MM:SS AM] Building project 'packages/pkg2/tsconfig.json'... + +======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.cts'. ======== +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 '/user/username/projects/myproject/packages/pkg2/const.cjs', target file types: TypeScript, JavaScript, Declaration. +File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/const.cts' exists - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== +[HH:MM:SS AM] Project 'packages/pkg1/tsconfig.json' is out of date because output 'packages/pkg1/build/index.js' is older than input 'packages/pkg2/tsconfig.json' + +[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 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +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.cjs' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs'. +File name '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.cts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.cts' 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.cts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.cts'. +======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.cts' with Package ID 'pkg2@1.0.0'. ======== +======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.cts'. ======== +Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. +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 '/user/username/projects/myproject/packages/pkg2/const.cjs', target file types: TypeScript, JavaScript, Declaration. +File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/const.cts' exists - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== +//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* +//// [/user/username/projects/myproject/packages/pkg1/build/index.js] *modified* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.theNum = void 0; +exports.theNum = 42; + +//// [/user/username/projects/myproject/packages/pkg1/build/tsconfig.tsbuildinfo] *rewrite with same content* +//// [/user/username/projects/myproject/packages/pkg1/build/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/user/username/projects/myproject/packages/pkg2/build/index.cjs] *new* +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + +//// [/user/username/projects/myproject/packages/pkg2/build/index.d.cts] *new* +export type { TheNum } from './const.cjs'; + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.es2022.full.d.ts","../const.cts","../index.cts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\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":"7bb214373f4d1876e9a0040d287d1b6e-export type { TheNum } from './const.cjs';","signature":"2c7786a1f125eb57a4db00a4d58e384a-export type { TheNum } from './const.cjs';\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"module":100,"outDir":"./"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./index.d.cts"} +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../const.cts", + "../index.cts" + ], + "original": [ + 2, + 3 + ] + } + ], + "fileNames": [ + "lib.es2022.full.d.ts", + "../const.cts", + "../index.cts" + ], + "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": "../const.cts", + "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.cts", + "version": "7bb214373f4d1876e9a0040d287d1b6e-export type { TheNum } from './const.cjs';", + "signature": "2c7786a1f125eb57a4db00a4d58e384a-export type { TheNum } from './const.cjs';\n", + "impliedNodeFormat": "CommonJS", + "original": { + "version": "7bb214373f4d1876e9a0040d287d1b6e-export type { TheNum } from './const.cjs';", + "signature": "2c7786a1f125eb57a4db00a4d58e384a-export type { TheNum } from './const.cjs';\n", + "impliedNodeFormat": 1 + } + } + ], + "fileIdsList": [ + [ + "../const.cts" + ] + ], + "options": { + "composite": true, + "module": 100, + "outDir": "./" + }, + "referencedMap": { + "../index.cts": [ + "../const.cts" + ] + }, + "latestChangedDtsFile": "./index.d.cts", + "size": 1404 +} + +packages/pkg2/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/myproject/packages/pkg2/index.cts +Signatures:: +(computed .d.ts) /user/username/projects/myproject/packages/pkg2/index.cts + +packages/pkg1/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /user/username/projects/myproject/packages/pkg2/build/index.d.cts +*refresh* /user/username/projects/myproject/packages/pkg1/index.ts +Signatures:: +(used version) /user/username/projects/myproject/packages/pkg2/build/index.d.cts +(computed .d.ts) /user/username/projects/myproject/packages/pkg1/index.ts From 25032de06f5fd01413f567e9f4febe4fbb5fad44 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 4 Sep 2025 10:36:20 -0700 Subject: [PATCH 25/31] Fix incorrect reporting of symlink delete --- internal/execute/tsctests/sys.go | 3 +-- internal/vfs/vfstest/vfstest.go | 9 +++++++++ .../tsbuild/extends/resolves-the-symlink-path.js | 1 - ...referenced-project-correctly-with-preserveSymlinks.js | 1 - ...declaration-file-from-referenced-project-correctly.js | 1 - .../shared-resolution-should-not-report-error.js | 1 - .../moduleResolution/when-resolution-is-not-shared.js | 3 --- ...odule-specifiers-across-projects-resolve-correctly.js | 2 -- ...de-watches-for-changes-to-package-json-main-fields.js | 5 ----- ...nced-project-correctly-with-cts-and-mts-extensions.js | 9 --------- ...eferences-sibling-package-through-indirect-symlink.js | 2 -- ...e-and-another-symlinked-package-with-indirect-link.js | 2 -- ...enced-through-source-and-another-symlinked-package.js | 1 - .../reference/tsc/extends/resolves-the-symlink-path.js | 1 - .../reference/tsc/moduleResolution/pnpm-style-layout.js | 7 ------- 15 files changed, 10 insertions(+), 38 deletions(-) diff --git a/internal/execute/tsctests/sys.go b/internal/execute/tsctests/sys.go index 1a16285afc..b74e89380e 100644 --- a/internal/execute/tsctests/sys.go +++ b/internal/execute/tsctests/sys.go @@ -473,8 +473,7 @@ func (s *testSys) baselineFSwithDiff(baseline io.Writer) { } if s.serializedDiff != nil { for path := range s.serializedDiff.snap { - _, ok := s.fsFromFileMap().ReadFile(path) - if !ok { + if fileInfo := s.mapFs().GetFileInfo(path); fileInfo == nil { // report deleted s.addFsEntryDiff(diffs, nil, path) } diff --git a/internal/vfs/vfstest/vfstest.go b/internal/vfs/vfstest/vfstest.go index d3c3d27efe..f056b1b59d 100644 --- a/internal/vfs/vfstest/vfstest.go +++ b/internal/vfs/vfstest/vfstest.go @@ -597,6 +597,15 @@ func (m *MapFS) Entries() iter.Seq2[string, *fstest.MapFile] { } } +func (m *MapFS) GetFileInfo(path string) *fstest.MapFile { + path, _ = strings.CutPrefix(path, "/") + m.mu.RLock() + defer m.mu.RUnlock() + canonical := m.getCanonicalPath(path) + canonicalString := string(canonical) + return m.m[canonicalString] +} + func must[T any](v T, err error) T { if err != nil { panic(err) diff --git a/testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js b/testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js index 4476b7d66e..be781f4bb3 100644 --- a/testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js +++ b/testdata/baselines/reference/tsbuild/extends/resolves-the-symlink-path.js @@ -47,7 +47,6 @@ 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; 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 index 1fb54008e0..45b4bc5898 100644 --- 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 @@ -122,7 +122,6 @@ 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 }); 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 index 99d21e5c9b..3744082d9d 100644 --- 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 @@ -123,7 +123,6 @@ 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 }); 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 index 2ab0a5931b..d66533dcd3 100644 --- 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 @@ -144,7 +144,6 @@ 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"; 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 index b1298953bb..6772e2211f 100644 --- a/testdata/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js +++ b/testdata/baselines/reference/tsbuild/moduleResolution/when-resolution-is-not-shared.js @@ -111,7 +111,6 @@ 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"; @@ -209,7 +208,6 @@ Signatures:: Edit [0]:: build b -//// [/home/src/workspaces/project/node_modules/a] *deleted* tsgo -b packages/b --verbose --traceResolution --explainFiles ExitStatus:: Success @@ -252,7 +250,6 @@ packages/a/types/index.d.ts 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* 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 index 03499ed04f..26f491e365 100644 --- 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 @@ -169,7 +169,6 @@ 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* @@ -354,7 +353,6 @@ 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* diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js index cb05828298..ea1581293d 100644 --- a/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js @@ -116,7 +116,6 @@ 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 }); @@ -269,7 +268,6 @@ Signatures:: Edit [0]:: reports import errors after change to package file -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* //// [/user/username/projects/myproject/packages/pkg2/package.json] *modified* { "name": "pkg2", @@ -279,7 +277,6 @@ Edit [0]:: reports import errors after change to package file Output:: -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* @@ -297,7 +294,6 @@ Diff:: Package.json watch pending, so no change detected yet - Edit [1]:: removes those errors when a package file is changed back -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* //// [/user/username/projects/myproject/packages/pkg2/package.json] *modified* { "name": "pkg2", @@ -307,5 +303,4 @@ Edit [1]:: removes those errors when a package file is changed back Output:: -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js index e9aa2fc045..d765c52b35 100644 --- a/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -115,7 +115,6 @@ 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* export const theNum = 42; @@ -243,7 +242,6 @@ Signatures:: Edit [0]:: reports import errors after change to package file -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* //// [/user/username/projects/myproject/packages/pkg1/package.json] *modified* { "name": "pkg1", @@ -254,7 +252,6 @@ Edit [0]:: reports import errors after change to package file Output:: -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* @@ -281,7 +278,6 @@ Diff:: Package.json watch pending, so no change detected yet - Edit [1]:: removes those errors when a package file is changed back -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* //// [/user/username/projects/myproject/packages/pkg1/package.json] *modified* { "name": "pkg1", @@ -292,12 +288,10 @@ Edit [1]:: removes those errors when a package file is changed back Output:: -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* Edit [2]:: reports import errors after change to package file -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* //// [/user/username/projects/myproject/packages/pkg1/package.json] *modified* { "name": "pkg1", @@ -308,7 +302,6 @@ Edit [2]:: reports import errors after change to package file Output:: -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* @@ -335,7 +328,6 @@ Diff:: Package.json watch pending, so no change detected yet - Edit [3]:: removes those errors when a package file is changed to cjs extensions -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* //// [/user/username/projects/myproject/packages/pkg2/index.cts] *new* export type { TheNum } from './const.cjs'; //// [/user/username/projects/myproject/packages/pkg2/index.ts] *deleted* @@ -400,7 +392,6 @@ Loading module as file / folder, candidate module location '/user/username/proje File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.cts' exists - use it as a name resolution result. ======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== -//// [/user/username/projects/myproject/node_modules/pkg2] *deleted* //// [/user/username/projects/myproject/packages/pkg1/build/index.js] *modified* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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 index 69a543c78f..75149f241c 100644 --- 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 @@ -96,7 +96,6 @@ 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'; @@ -130,5 +129,4 @@ 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 index 0d5bb3bf95..5cfa0d4d57 100644 --- 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 @@ -197,7 +197,6 @@ 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<{ @@ -214,5 +213,4 @@ 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 index 4cd10abfa2..83b1575d13 100644 --- 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 @@ -209,5 +209,4 @@ export {}; "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/extends/resolves-the-symlink-path.js b/testdata/baselines/reference/tsc/extends/resolves-the-symlink-path.js index 05d6d6bee7..05b91aca0f 100644 --- a/testdata/baselines/reference/tsc/extends/resolves-the-symlink-path.js +++ b/testdata/baselines/reference/tsc/extends/resolves-the-symlink-path.js @@ -47,7 +47,6 @@ 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; diff --git a/testdata/baselines/reference/tsc/moduleResolution/pnpm-style-layout.js b/testdata/baselines/reference/tsc/moduleResolution/pnpm-style-layout.js index a218d66471..15244da570 100644 --- a/testdata/baselines/reference/tsc/moduleResolution/pnpm-style-layout.js +++ b/testdata/baselines/reference/tsc/moduleResolution/pnpm-style-layout.js @@ -278,17 +278,10 @@ Resolving real path for '/home/src/projects/component-type-checker/node_modules/ 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 {} From efb53b3b8789e38a0f6bb0f9194f4a1e5737ffa6 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 4 Sep 2025 10:52:39 -0700 Subject: [PATCH 26/31] tsc -b -w libResolution tests --- internal/execute/tsctests/tsc_test.go | 1 + .../with-config-with-libReplacement.js | 926 ++++++++++++++++++ .../libraryResolution/with-config.js | 667 +++++++++++++ 3 files changed, 1594 insertions(+) create mode 100644 testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js create mode 100644 testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js diff --git a/internal/execute/tsctests/tsc_test.go b/internal/execute/tsctests/tsc_test.go index a28f9112bb..c88dce4dbb 100644 --- a/internal/execute/tsctests/tsc_test.go +++ b/internal/execute/tsctests/tsc_test.go @@ -1705,6 +1705,7 @@ func TestTscLibraryResolution(t *testing.T) { testCases := slices.Concat( getTscLibResolutionTestCases([]string{"-b", "project1", "project2", "project3", "project4", "--verbose", "--explainFiles"}), getTscLibResolutionTestCases([]string{"-p", "project1", "--explainFiles"}), + getTscLibResolutionTestCases([]string{"-b", "-w", "project1", "project2", "project3", "project4", "--verbose", "--explainFiles"}), []*tscInput{ { subScenario: "unknown lib", diff --git a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js new file mode 100644 index 0000000000..03cf3e6022 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/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 -w 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/tsbuildWatch/libraryResolution/with-config.js b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js new file mode 100644 index 0000000000..ad18eb26bc --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/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 -w 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 From fafb8d5a3d653e07946b61bb089c0c3c0587ded8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 4 Sep 2025 11:09:19 -0700 Subject: [PATCH 27/31] tsc -b -w extends test case --- internal/execute/tsctests/tsc_test.go | 31 ++- .../extends/configDir-template.js | 179 ++++++++++++++++++ 2 files changed, 205 insertions(+), 5 deletions(-) create mode 100644 testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js diff --git a/internal/execute/tsctests/tsc_test.go b/internal/execute/tsctests/tsc_test.go index c88dce4dbb..b9a88f6196 100644 --- a/internal/execute/tsctests/tsc_test.go +++ b/internal/execute/tsctests/tsc_test.go @@ -824,7 +824,7 @@ func TestTscExtends(t *testing.T) { commandLineArgs: []string{builtType, "src", "--extendedDiagnostics"}, } } - getTscExtendsConfigDirTestCase := func(subScenarioSufix string, commandLineArgs []string) *tscInput { + getTscExtendsConfigDirTestCase := func(subScenarioSufix string, commandLineArgs []string, edits []*tscEdit) *tscInput { return &tscInput{ subScenario: "configDir template" + subScenarioSufix, files: FileMap{ @@ -870,6 +870,7 @@ func TestTscExtends(t *testing.T) { }, cwd: "/home/src/projects/myproject", commandLineArgs: commandLineArgs, + edits: edits, } } testCases := []*tscInput{ @@ -887,10 +888,30 @@ func TestTscExtends(t *testing.T) { }, getTscExtendsWithSymlinkTestCase("-p"), getTscExtendsWithSymlinkTestCase("-b"), - getTscExtendsConfigDirTestCase("", []string{"--explainFiles"}), - getTscExtendsConfigDirTestCase(" showConfig", []string{"--showConfig"}), - getTscExtendsConfigDirTestCase(" with commandline", []string{"--explainFiles", "--outDir", "${configDir}/outDir"}), - getTscExtendsConfigDirTestCase("", []string{"--b", "--explainFiles", "--v"}), + getTscExtendsConfigDirTestCase("", []string{"--explainFiles"}, nil), + getTscExtendsConfigDirTestCase(" showConfig", []string{"--showConfig"}, nil), + getTscExtendsConfigDirTestCase(" with commandline", []string{"--explainFiles", "--outDir", "${configDir}/outDir"}, nil), + getTscExtendsConfigDirTestCase("", []string{"--b", "--explainFiles", "--v"}, nil), + getTscExtendsConfigDirTestCase("", []string{"--b", "-w", "--explainFiles", "--v"}, []*tscEdit{ + { + caption: "edit extended config file", + edit: func(sys *testSys) { + sys.writeFileNoError( + "/home/src/projects/configs/first/tsconfig.json", + stringtestutil.Dedent(` + { + "extends": "../second/tsconfig.json", + "include": ["${configDir}/src"], + "compilerOptions": { + "typeRoots": ["${configDir}/root2"], + "types": [], + }, + }`), + false, + ) + }, + }, + }), } for _, test := range testCases { diff --git a/testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js b/testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js new file mode 100644 index 0000000000..3ab285961c --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js @@ -0,0 +1,179 @@ +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 -w --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 + + +Edit [0]:: edit extended config file +//// [/home/src/projects/configs/first/tsconfig.json] *modified* +{ + "extends": "../second/tsconfig.json", + "include": ["${configDir}/src"], + "compilerOptions": { + "typeRoots": ["${configDir}/root2"], + "types": [], + }, +} + + +Output:: +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'outDir/tsconfig.tsbuildinfo' is older than input '../configs/first/tsconfig.json' + +[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 +[HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... + +//// [/home/src/projects/myproject/decls/main.d.ts] *mTime changed* +//// [/home/src/projects/myproject/outDir/main.js] *mTime changed* +//// [/home/src/projects/myproject/outDir/tsconfig.tsbuildinfo] *mTime changed* + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: From 9a1b6ce129c1a9068b4c93fc49a9c020a256be8e Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 4 Sep 2025 11:18:12 -0700 Subject: [PATCH 28/31] config file errors porting --- internal/execute/tsctests/tscbuild_test.go | 53 +++ .../reports-syntax-errors-in-config-file.js | 397 ++++++++++++++++++ 2 files changed, 450 insertions(+) create mode 100644 testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js diff --git a/internal/execute/tsctests/tscbuild_test.go b/internal/execute/tsctests/tscbuild_test.go index c41e730350..cde8d35442 100644 --- a/internal/execute/tsctests/tscbuild_test.go +++ b/internal/execute/tsctests/tscbuild_test.go @@ -390,6 +390,59 @@ func TestBuildConfigFileErrors(t *testing.T) { files: FileMap{}, commandLineArgs: []string{"--b", "bogus.json"}, }, + { + 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", "-w"}, + 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() { }") + }, + }, + { + caption: "reports error when there is no change to tsconfig file", + edit: func(sys *testSys) { + sys.replaceFileText("/home/src/workspaces/project/tsconfig.json", "", "") + }, + }, + { + 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) + }, + }, + }, + }, } for _, test := range testCases { diff --git a/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js b/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js new file mode 100644 index 0000000000..89d9631c61 --- /dev/null +++ b/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js @@ -0,0 +1,397 @@ +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 -w +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" + ] +} + + +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() { } + + +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]:: reports error when there is no change to tsconfig file +//// [/home/src/workspaces/project/tsconfig.json] *mTime changed* + + +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" + ] +} + + +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:: From 334b380a7dabc21adfcad2f8f529c602afd6cd76 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 5 Sep 2025 10:02:50 -0700 Subject: [PATCH 29/31] Fix race in source file caching --- internal/execute/build/buildtask.go | 4 +-- internal/execute/build/host.go | 9 ++---- internal/execute/build/orchestrator.go | 2 +- internal/execute/build/parseCache.go | 44 ++++++++------------------ 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/internal/execute/build/buildtask.go b/internal/execute/build/buildtask.go index edb4809294..5ee2c54593 100644 --- a/internal/execute/build/buildtask.go +++ b/internal/execute/build/buildtask.go @@ -739,7 +739,7 @@ func (t *buildTask) resetStatus() { func (t *buildTask) resetConfig(orchestrator *Orchestrator, path tspath.Path) { t.dirty = true - orchestrator.host.resolvedReferences.Delete(path) + orchestrator.host.resolvedReferences.delete(path) } func (t *buildTask) hasUpdate(orchestrator *Orchestrator, path tspath.Path) updateKind { @@ -770,7 +770,7 @@ func (t *buildTask) hasUpdate(orchestrator *Orchestrator, path tspath.Path) upda t.reportDone = make(chan struct{}) t.done = make(chan struct{}) if !slices.Equal(t.resolved.FileNames(), newConfig.FileNames()) { - orchestrator.host.resolvedReferences.Store(path, newConfig) + orchestrator.host.resolvedReferences.store(path, newConfig) orchestrator.host.configTimes.Store(path, configTime) t.resolved = newConfig t.resetStatus() diff --git a/internal/execute/build/host.go b/internal/execute/build/host.go index 48ce770ad8..91f50aa59c 100644 --- a/internal/execute/build/host.go +++ b/internal/execute/build/host.go @@ -51,22 +51,19 @@ func (h *host) Trace(msg string) { func (h *host) GetSourceFile(opts ast.SourceFileParseOptions) *ast.SourceFile { // Cache dts and json files as they will be reused - file, _ := h.sourceFiles.LoadOrStoreNewIf(opts, func() (*ast.SourceFile, bool) { - file := h.host.GetSourceFile(opts) - return file, file != nil && (tspath.IsDeclarationFileName(opts.FileName) || tspath.FileExtensionIs(opts.FileName, tspath.ExtensionJson)) + return h.sourceFiles.loadOrStoreNewIf(opts, h.host.GetSourceFile, func(value *ast.SourceFile) bool { + return value != nil && (tspath.IsDeclarationFileName(opts.FileName) || tspath.FileExtensionIs(opts.FileName, tspath.ExtensionJson)) }) - return file } func (h *host) GetResolvedProjectReference(fileName string, path tspath.Path) *tsoptions.ParsedCommandLine { - resolved, _ := h.resolvedReferences.LoadOrStoreNew(path, func() *tsoptions.ParsedCommandLine { + return h.resolvedReferences.loadOrStoreNew(path, func(path tspath.Path) *tsoptions.ParsedCommandLine { configStart := h.orchestrator.opts.Sys.Now() commandLine, _ := tsoptions.GetParsedCommandLineOfConfigFilePath(fileName, path, h.orchestrator.opts.Command.CompilerOptions, h, &h.extendedConfigCache) configTime := h.orchestrator.opts.Sys.Now().Sub(configStart) h.configTimes.Store(path, configTime) return commandLine }) - return resolved } func (h *host) ReadBuildInfo(config *tsoptions.ParsedCommandLine) *incremental.BuildInfo { diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index db4381abec..b600edcd03 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -251,7 +251,7 @@ func (o *Orchestrator) resetCaches() { cachesVfs := o.host.host.FS().(*cachedvfs.FS) cachesVfs.ClearCache() o.host.extendedConfigCache = tsc.ExtendedConfigCache{} - o.host.sourceFiles.Reset() + o.host.sourceFiles.reset() o.host.configTimes = collections.SyncMap[tspath.Path, time.Duration]{} } diff --git a/internal/execute/build/parseCache.go b/internal/execute/build/parseCache.go index a4e53f30f1..73bc263612 100644 --- a/internal/execute/build/parseCache.go +++ b/internal/execute/build/parseCache.go @@ -9,58 +9,40 @@ import ( type parseCacheEntry[V any] struct { value V mu sync.Mutex - dirty bool } type parseCache[K comparable, V any] struct { entries collections.SyncMap[K, *parseCacheEntry[V]] } -func (c *parseCache[K, V]) LoadOrStoreNew(key K, parse func() V) (V, bool) { - return c.LoadOrStoreNewIf(key, func() (V, bool) { - return parse(), true - }) +func (c *parseCache[K, V]) loadOrStoreNew(key K, parse func(K) V) V { + return c.loadOrStoreNewIf(key, parse, func(value V) bool { return true }) } -func (c *parseCache[K, V]) LoadOrStoreNewIf(key K, parse func() (V, bool)) (V, bool) { +func (c *parseCache[K, V]) loadOrStoreNewIf(key K, parse func(K) V, canCacheValue func(V) bool) V { newEntry := &parseCacheEntry[V]{} newEntry.mu.Lock() defer newEntry.mu.Unlock() - if entry, loaded := c.entries.LoadOrStore(key, newEntry); loaded && !entry.dirty { - // Ensure it was parsed before returning + if entry, loaded := c.entries.LoadOrStore(key, newEntry); loaded { entry.mu.Lock() defer entry.mu.Unlock() - return entry.value, true + if canCacheValue(entry.value) { + return entry.value + } + newEntry = entry } - value, ok := parse() - if ok { - newEntry.value = value - } else { - // Dont use the cache entry - newEntry.dirty = true - c.entries.Delete(key) - } - return value, false -} - -func (c *parseCache[K, V]) Load(key K) (V, bool) { - if entry, ok := c.entries.Load(key); ok && !entry.dirty { - entry.mu.Lock() - defer entry.mu.Unlock() - return entry.value, true - } - var zero V - return zero, false + newEntry.value = parse(key) + return newEntry.value } -func (c *parseCache[K, V]) Store(key K, value V) { +func (c *parseCache[K, V]) store(key K, value V) { c.entries.Store(key, &parseCacheEntry[V]{value: value}) } -func (c *parseCache[K, V]) Delete(key K) { +func (c *parseCache[K, V]) delete(key K) { c.entries.Delete(key) } -func (c *parseCache[K, V]) Reset() { +func (c *parseCache[K, V]) reset() { c.entries = collections.SyncMap[K, *parseCacheEntry[V]]{} } From ea637ee1d0e802a1526bae909e43507af016b58c Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 5 Sep 2025 10:16:54 -0700 Subject: [PATCH 30/31] Fix race in creating build task --- internal/execute/build/orchestrator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index b600edcd03..cf3aa5ffba 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -114,7 +114,6 @@ func (o *Orchestrator) createBuildTasks(oldTasks *collections.SyncMap[tspath.Pat if !existing.dirty { // Reuse existing task if config is same task = existing - task.upStream = nil } else { program = existing.program buildInfo = existing.buildInfoEntry @@ -131,6 +130,7 @@ func (o *Orchestrator) createBuildTasks(oldTasks *collections.SyncMap[tspath.Pat return } task.resolved = o.host.GetResolvedProjectReference(config, path) + task.upStream = nil if task.resolved != nil { o.createBuildTasks(oldTasks, task.resolved.ResolvedProjectReferencePaths(), wg) } From b4d1165138debf91ba0ec9966c7f52b338722443 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 8 Sep 2025 19:52:56 -0700 Subject: [PATCH 31/31] Add starting and waiting for changes status --- internal/diagnosticwriter/diagnosticwriter.go | 31 ++++++++--- internal/execute/build/orchestrator.go | 29 +++++++--- internal/execute/tsc/compile.go | 2 + internal/execute/tsc/diagnostics.go | 15 ++++++ internal/execute/tsctests/sys.go | 13 ++++- .../reports-syntax-errors-in-config-file.js | 24 ++++++--- .../demo/updates-with-bad-reference.js | 18 +++---- .../demo/updates-with-circular-reference.js | 9 +++- .../extends/configDir-template.js | 8 +++ .../with-config-with-libReplacement.js | 4 ++ .../libraryResolution/with-config.js | 4 ++ ...for-changes-to-package-json-main-fields.js | 9 ++-- ...se-different-module-resolution-settings.js | 8 +++ ...t-correctly-with-cts-and-mts-extensions.js | 18 ++++--- ...n-no-files-are-emitted-with-incremental.js | 12 +++++ ...when-watching-when-no-files-are-emitted.js | 12 +++++ .../dts-errors-with-incremental-as-modules.js | 32 ++++++++--- .../noEmit/dts-errors-with-incremental.js | 32 ++++++++--- ...dts-enabled-with-incremental-as-modules.js | 28 ++++++++++ ...rs-without-dts-enabled-with-incremental.js | 28 ++++++++++ .../noEmit/dts-errors-without-dts-enabled.js | 28 ++++++++++ .../tsbuildWatch/noEmit/dts-errors.js | 32 ++++++++--- ...ntic-errors-with-incremental-as-modules.js | 32 ++++++++--- .../semantic-errors-with-incremental.js | 32 ++++++++--- .../tsbuildWatch/noEmit/semantic-errors.js | 32 ++++++++--- ...ntax-errors-with-incremental-as-modules.js | 32 ++++++++--- .../noEmit/syntax-errors-with-incremental.js | 32 ++++++++--- .../tsbuildWatch/noEmit/syntax-errors.js | 32 ++++++++--- ...Error-with-declaration-with-incremental.js | 54 ++++++++++++++----- .../noEmitOnError-with-declaration.js | 54 ++++++++++++++----- .../noEmitOnError-with-incremental.js | 52 +++++++++++++++--- .../noEmitOnError/noEmitOnError.js | 52 +++++++++++++++--- ...ceError-when-file-with-no-error-changes.js | 14 +++-- ...ing-errors-only-changed-file-is-emitted.js | 13 ++++- ...tErrors-when-file-with-no-error-changes.js | 10 ++-- ...ixing-error-files-all-files-are-emitted.js | 9 +++- .../programUpdates/tsbuildinfo-has-error.js | 4 ++ ...e-down-stream-project-and-then-fixes-it.js | 13 ++++- ...project-with-extended-config-is-removed.js | 8 +++ ...hen-noUnusedParameters-changes-to-false.js | 9 +++- .../works-with-extended-source-files.js | 33 +++++++++++- .../reexport/Reports-errors-correctly.js | 13 ++++- ...-referenced-project-and-shared-is-first.js | 12 +++++ ...en-root-file-is-from-referenced-project.js | 12 +++++ ...equent-updates-with-circular-references.js | 12 +++++ ...le-is-added,-and-its-subsequent-updates.js | 12 +++++ ...errors-message-with-circular-references.js | 16 ++++++ ...hanges-and-reports-found-errors-message.js | 16 ++++++ .../incremental-updates-in-verbose-mode.js | 12 +++++ ...ncing-projects-with-circular-references.js | 8 +++ ...not-start-build-of-referencing-projects.js | 8 +++ ...rs-when-preserveWatchOutput-is-not-used.js | 23 ++++---- ...veWatchOutput-is-passed-on-command-line.js | 23 ++++---- ...BuildOnErrors-is-passed-on-command-line.js | 34 +++++------- ...e-of-program-emit-with-outDir-specified.js | 8 +++ ...r-recompilation-because-of-program-emit.js | 8 +++ ...rrors-when-test-does-not-reference-core.js | 9 +++- ...ects-have-errors-with-stopBuildOnErrors.js | 9 +++- ...tches-config-files-that-are-not-present.js | 9 +++- 59 files changed, 932 insertions(+), 225 deletions(-) diff --git a/internal/diagnosticwriter/diagnosticwriter.go b/internal/diagnosticwriter/diagnosticwriter.go index 520f769e8d4..b4d879d224 100644 --- a/internal/diagnosticwriter/diagnosticwriter.go +++ b/internal/diagnosticwriter/diagnosticwriter.go @@ -10,6 +10,7 @@ import ( "unicode" "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/diagnostics" "github.com/microsoft/typescript-go/internal/scanner" "github.com/microsoft/typescript-go/internal/tspath" @@ -139,7 +140,8 @@ func writeCodeSnippet(writer io.Writer, sourceFile *ast.SourceFile, start int, l fmt.Fprint(writer, resetEscapeSequence) fmt.Fprint(writer, gutterSeparator) fmt.Fprint(writer, squiggleColor) - if i == firstLine { + switch i { + case firstLine: // If we're on the last line, then limit it to the last character of the last line. // Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position. var lastCharForLine int @@ -153,10 +155,10 @@ func writeCodeSnippet(writer io.Writer, sourceFile *ast.SourceFile, start int, l // then squiggle the remainder of the line. fmt.Fprint(writer, strings.Repeat(" ", firstLineChar)) fmt.Fprint(writer, strings.Repeat("~", lastCharForLine-firstLineChar)) - } else if i == lastLine { + case lastLine: // Squiggle until the final character. fmt.Fprint(writer, strings.Repeat("~", lastLineChar)) - } else { + default: // Squiggle the entire line. fmt.Fprint(writer, strings.Repeat("~", len(lineContent))) } @@ -263,13 +265,14 @@ func WriteErrorSummaryText(output io.Writer, allDiagnostics []*ast.Diagnostic, f message = diagnostics.Found_1_error_in_0.Format(firstFileName) } } else { - if numErroringFiles == 0 { + switch numErroringFiles { + case 0: // No file-specific errors. message = diagnostics.Found_0_errors.Format(totalErrorCount) - } else if numErroringFiles == 1 { + case 1: // One file with errors. message = diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1.Format(totalErrorCount, firstFileName) - } else { + default: // Multiple files with errors. message = diagnostics.Found_0_errors_in_1_files.Format(totalErrorCount, numErroringFiles) } @@ -397,3 +400,19 @@ func FormatDiagnosticsStatusAndTime(output io.Writer, time string, diag *ast.Dia fmt.Fprint(output, time, " - ") WriteFlattenedDiagnosticMessage(output, diag, formatOpts.NewLine) } + +var ScreenStartingCodes = []int32{ + diagnostics.Starting_compilation_in_watch_mode.Code(), + diagnostics.File_change_detected_Starting_incremental_compilation.Code(), +} + +func TryClearScreen(output io.Writer, diag *ast.Diagnostic, options *core.CompilerOptions) bool { + if !options.PreserveWatchOutput.IsTrue() && + !options.ExtendedDiagnostics.IsTrue() && + !options.Diagnostics.IsTrue() && + slices.Contains(ScreenStartingCodes, diag.Code()) { + fmt.Fprint(output, "\x1B[2J\x1B[3J\x1B[H") // Clear screen and move cursor to home position + return true + } + return false +} diff --git a/internal/execute/build/orchestrator.go b/internal/execute/build/orchestrator.go index cf3aa5ffba..a047973194 100644 --- a/internal/execute/build/orchestrator.go +++ b/internal/execute/build/orchestrator.go @@ -32,10 +32,14 @@ type orchestratorResult struct { filesToDelete []string } -func (b *orchestratorResult) report(s *Orchestrator) { - tsc.CreateReportErrorSummary(s.opts.Sys, s.opts.Command.CompilerOptions)(b.errors) +func (b *orchestratorResult) report(o *Orchestrator) { + if o.opts.Command.CompilerOptions.Watch.IsTrue() { + o.watchStatusReporter(ast.NewCompilerDiagnostic(core.IfElse(len(b.errors) == 1, diagnostics.Found_1_error_Watching_for_file_changes, diagnostics.Found_0_errors_Watching_for_file_changes), len(b.errors))) + } else { + o.errorSummaryReporter(b.errors) + } if b.filesToDelete != nil { - s.createBuilderStatusReporter(nil)( + o.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 { @@ -46,11 +50,11 @@ func (b *orchestratorResult) report(s *Orchestrator) { if len(b.programStats) == 0 { return } - if !s.opts.Command.CompilerOptions.Diagnostics.IsTrue() && !s.opts.Command.CompilerOptions.ExtendedDiagnostics.IsTrue() { + if !o.opts.Command.CompilerOptions.Diagnostics.IsTrue() && !o.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) + b.statistics.Aggregate(b.programStats, o.opts.Sys.SinceStart()) + b.statistics.Report(o.opts.Sys.Writer(), o.opts.Testing) } type Orchestrator struct { @@ -62,6 +66,9 @@ type Orchestrator struct { tasks *collections.SyncMap[tspath.Path, *buildTask] order []string errors []*ast.Diagnostic + + errorSummaryReporter tsc.DiagnosticsReporter + watchStatusReporter tsc.DiagnosticReporter } var _ tsc.Watcher = (*Orchestrator)(nil) @@ -209,6 +216,9 @@ func (o *Orchestrator) GenerateGraph(oldTasks *collections.SyncMap[tspath.Path, } func (o *Orchestrator) Start() tsc.CommandLineResult { + if o.opts.Command.CompilerOptions.Watch.IsTrue() { + o.watchStatusReporter(ast.NewCompilerDiagnostic(diagnostics.Starting_compilation_in_watch_mode)) + } o.GenerateGraph(nil) result := o.buildOrClean() if o.opts.Command.CompilerOptions.Watch.IsTrue() { @@ -280,10 +290,12 @@ func (o *Orchestrator) DoCycle() { return } + o.watchStatusReporter(ast.NewCompilerDiagnostic(diagnostics.File_change_detected_Starting_incremental_compilation)) if needsConfigUpdate.Load() { // Generate new tasks o.GenerateGraphReusingOldTasks() } + o.buildOrClean() o.updateWatch() o.resetCaches() @@ -364,5 +376,10 @@ func NewOrchestrator(opts Options) *Orchestrator { ), mTimes: &collections.SyncMap[tspath.Path, time.Time]{}, } + if opts.Command.CompilerOptions.Watch.IsTrue() { + orchestrator.watchStatusReporter = tsc.CreateWatchStatusReporter(opts.Sys, opts.Command.CompilerOptions, opts.Testing) + } else { + orchestrator.errorSummaryReporter = tsc.CreateReportErrorSummary(opts.Sys, opts.Command.CompilerOptions) + } return orchestrator } diff --git a/internal/execute/tsc/compile.go b/internal/execute/tsc/compile.go index b624d07e73..4adc1df9e9 100644 --- a/internal/execute/tsc/compile.go +++ b/internal/execute/tsc/compile.go @@ -54,6 +54,8 @@ type CommandLineTesting interface { OnStatisticsEnd(w io.Writer) OnBuildStatusReportStart(w io.Writer) OnBuildStatusReportEnd(w io.Writer) + OnWatchStatusReportStart() + OnWatchStatusReportEnd() GetTrace(w io.Writer) func(msg string) OnProgram(program *incremental.Program) } diff --git a/internal/execute/tsc/diagnostics.go b/internal/execute/tsc/diagnostics.go index cb6154d562..abd3bf887f 100644 --- a/internal/execute/tsc/diagnostics.go +++ b/internal/execute/tsc/diagnostics.go @@ -145,3 +145,18 @@ func CreateBuilderStatusReporter(sys System, w io.Writer, options *core.Compiler fmt.Fprint(w, formatOpts.NewLine, formatOpts.NewLine) } } + +func CreateWatchStatusReporter(sys System, options *core.CompilerOptions, testing CommandLineTesting) DiagnosticReporter { + formatOpts := getFormatOptsOfSys(sys) + writeStatus := core.IfElse(shouldBePretty(sys, options), diagnosticwriter.FormatDiagnosticsStatusWithColorAndTime, diagnosticwriter.FormatDiagnosticsStatusAndTime) + return func(diagnostic *ast.Diagnostic) { + writer := sys.Writer() + if testing != nil { + testing.OnWatchStatusReportStart() + defer testing.OnWatchStatusReportEnd() + } + diagnosticwriter.TryClearScreen(writer, diagnostic, options) + writeStatus(writer, sys.Now().Format("03:04:05 PM"), diagnostic, formatOpts) + fmt.Fprint(writer, formatOpts.NewLine, formatOpts.NewLine) + } +} diff --git a/internal/execute/tsctests/sys.go b/internal/execute/tsctests/sys.go index b74e89380e..9cf4b1ed99 100644 --- a/internal/execute/tsctests/sys.go +++ b/internal/execute/tsctests/sys.go @@ -269,6 +269,14 @@ func (s *testSys) OnBuildStatusReportEnd(w io.Writer) { fmt.Fprintln(w, buildStatusReportEnd) } +func (s *testSys) OnWatchStatusReportStart() { + fmt.Fprintln(s.Writer(), watchStatusReportStart) +} + +func (s *testSys) OnWatchStatusReportEnd() { + fmt.Fprintln(s.Writer(), watchStatusReportEnd) +} + func (s *testSys) GetTrace(w io.Writer) func(str string) { return func(str string) { fmt.Fprintln(w, traceStart) @@ -346,6 +354,8 @@ var ( statisticsEnd = "!!! Statistics end" buildStatusReportStart = "!!! Build Status Report Start" buildStatusReportEnd = "!!! Build Status Report End" + watchStatusReportStart = "!!! Watch Status Report Start" + watchStatusReportEnd = "!!! Watch Status Report End" traceStart = "!!! Trace start" traceEnd = "!!! Trace end" ) @@ -400,7 +410,8 @@ func (o *outputSanitizer) transformLines() string { 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.addOrSkipLinesForComparing(buildStatusReportStart, buildStatusReportEnd, false, o.sanitizeBuildStatusTimeStamp) && + !o.addOrSkipLinesForComparing(watchStatusReportStart, watchStatusReportEnd, false, o.sanitizeBuildStatusTimeStamp) { o.addOutputLine(line) } } diff --git a/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js b/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js index 89d9631c61..1ae2b8dea6 100644 --- a/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js +++ b/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js @@ -19,13 +19,14 @@ export function bar() { } tsgo --b -w ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + tsconfig.json:7:9 - error TS1005: ',' expected. 7 "b.ts"    ~~~~~~ - -Found 1 error in tsconfig.json:7 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -163,13 +164,14 @@ Edit [0]:: reports syntax errors after change to config file Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + tsconfig.json:7:9 - error TS1005: ',' expected. 7 "b.ts"    ~~~~~~ - -Found 1 error in tsconfig.json:7 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -186,13 +188,14 @@ export function foo() { }export function fooBar() { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + tsconfig.json:7:9 - error TS1005: ',' expected. 7 "b.ts"    ~~~~~~ - -Found 1 error in tsconfig.json:7 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/workspaces/project/a.d.ts] *modified* export declare function foo(): void; @@ -292,13 +295,14 @@ Edit [2]:: reports error when there is no change to tsconfig file Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + tsconfig.json:7:9 - error TS1005: ',' expected. 7 "b.ts"    ~~~~~~ - -Found 1 error in tsconfig.json:7 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -323,6 +327,10 @@ Edit [3]:: builds after fixing config file errors Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* diff --git a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js index 2c6174ccea..3fdefa6ac5 100644 --- a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js +++ b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js @@ -113,6 +113,8 @@ export function createZoo(): Array { tsgo --b -w --verbose ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * animals/tsconfig.json @@ -158,12 +160,7 @@ Output:: [HH:MM:SS AM] Building project 'zoo/tsconfig.json'... - -Found 4 errors in 2 files. - -Errors Files - 2 animals/index.ts:1 - 2 core/utilities.ts:1 +[HH:MM:SS AM] Found 4 errors. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -720,6 +717,8 @@ export function lastElementOf(arr: T[]): T | undefined { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * animals/tsconfig.json @@ -761,12 +760,7 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'animals/tsconfig.json'... - -Found 4 errors in 2 files. - -Errors Files - 2 animals/index.ts:1 - 2 core/utilities.ts:2 +[HH:MM:SS AM] Found 4 errors. Watching for file changes. //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] *mTime changed* //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] *modified* diff --git a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js index 2e43c0bb8e..ea64adfac5 100644 --- a/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js +++ b/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js @@ -117,6 +117,8 @@ export function createZoo(): Array { tsgo --b -w --verbose ExitStatus:: ProjectReferenceCycle_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * animals/tsconfig.json * zoo/tsconfig.json @@ -127,8 +129,7 @@ Output:: /user/username/projects/demo/core/tsconfig.json /user/username/projects/demo/zoo/tsconfig.json /user/username/projects/demo/animals/tsconfig.json - -Found 1 error. +[HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -145,6 +146,8 @@ Edit [0]:: Fix error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * animals/tsconfig.json @@ -163,6 +166,8 @@ Output:: [HH:MM:SS AM] Building project 'zoo/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} diff --git a/testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js b/testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js index 3ab285961c..b67178786b 100644 --- a/testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js +++ b/testdata/baselines/reference/tsbuildWatch/extends/configDir-template.js @@ -42,6 +42,8 @@ export const x = 10; tsgo --b -w --explainFiles --v ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -64,6 +66,8 @@ types/sometype.ts Imported via "@myscope/sometype" from file 'main.ts' main.ts Part of 'files' list in tsconfig.json +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/myproject/decls/main.d.ts] *new* // some comment export declare const y = 10; @@ -146,6 +150,8 @@ Edit [0]:: edit extended config file Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -170,6 +176,8 @@ main.ts Part of 'files' list in tsconfig.json [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/myproject/decls/main.d.ts] *mTime changed* //// [/home/src/projects/myproject/outDir/main.js] *mTime changed* //// [/home/src/projects/myproject/outDir/tsconfig.tsbuildinfo] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js index 03cf3e6022..1bc6e8b2bf 100644 --- a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js +++ b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js @@ -128,6 +128,8 @@ export const y = 10; tsgo -b -w project1 project2 project3 project4 --verbose --explainFiles ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * project1/tsconfig.json * project2/tsconfig.json @@ -458,6 +460,8 @@ project4/index.ts Matched by default include pattern '**/*' project4/utils.d.ts Matched by default include pattern '**/*' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/workspace/projects/project1/file.d.ts] *new* export declare const file = 10; diff --git a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js index ad18eb26bc..a3fec6415c 100644 --- a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js +++ b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js @@ -76,6 +76,8 @@ export const y = 10; tsgo -b -w project1 project2 project3 project4 --verbose --explainFiles ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * project1/tsconfig.json * project2/tsconfig.json @@ -153,6 +155,8 @@ project4/index.ts Matched by default include pattern '**/*' project4/utils.d.ts Matched by default include pattern '**/*' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.es5.d.ts] *Lib* /// interface Boolean {} diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js index ea1581293d..e9cdbb7c50 100644 --- a/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js @@ -41,6 +41,8 @@ export type TheStr = string; tsgo -b packages/pkg1 --verbose -w --traceResolution ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * packages/pkg2/tsconfig.json * packages/pkg1/tsconfig.json @@ -93,6 +95,8 @@ Loading module as file / folder, candidate module location '/user/username/proje File name '/user/username/projects/myproject/packages/pkg2/const.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.ts' exists - use it as a name resolution result. ======== Module name './const.js' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -283,15 +287,12 @@ Output:: Diff:: Package.json watch pending, so no change detected yet --- nonIncremental.output.txt +++ incremental.output.txt -@@ -1,8 +0,0 @@ +@@ -1,5 +0,0 @@ -packages/pkg1/index.ts:1:15 - error TS2305: Module '"pkg2"' has no exported member 'TheNum'. - -1 import type { TheNum } from 'pkg2' -   ~~~~~~ - -- --Found 1 error in packages/pkg1/index.ts:1 -- Edit [1]:: removes those errors when a package file is changed back //// [/user/username/projects/myproject/packages/pkg2/package.json] *modified* diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js index a5c0c4577a..a5f58bb728 100644 --- a/testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js @@ -43,6 +43,8 @@ export const foo = 10; tsgo --b -w -v ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * project1/tsconfig.json * project2/tsconfig.json @@ -56,6 +58,8 @@ Output:: [HH:MM:SS AM] Building project 'project2/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -295,6 +299,8 @@ import { foo } from "file";const bar = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1/tsconfig.json * project2/tsconfig.json @@ -304,6 +310,8 @@ Output:: [HH:MM:SS AM] Building project 'project1/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/myproject/project1/index.js] *modified* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js index d765c52b35..f91d8d9568 100644 --- a/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js +++ b/testdata/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -43,6 +43,8 @@ export type { TheNum } from './const.cjs'; tsgo -b packages/pkg1 -w --verbose --traceResolution ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * packages/pkg2/tsconfig.json * packages/pkg1/tsconfig.json @@ -92,6 +94,8 @@ Loading module as file / folder, candidate module location '/user/username/proje File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.cts' exists - use it as a name resolution result. ======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.es2022.full.d.ts] *Lib* /// interface Boolean {} @@ -266,16 +270,13 @@ Diff:: Package.json watch pending, so no change detected yet +export const theNum = 42; --- nonIncremental.output.txt +++ incremental.output.txt -@@ -1,9 +0,0 @@ +@@ -1,6 +0,0 @@ -packages/pkg1/index.ts:1:29 - error TS1541: Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute. - To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. - -1 import type { TheNum } from 'pkg2' -   ~~~~~~ - -- --Found 1 error in packages/pkg1/index.ts:1 -- Edit [1]:: removes those errors when a package file is changed back //// [/user/username/projects/myproject/packages/pkg1/package.json] *modified* @@ -316,16 +317,13 @@ Diff:: Package.json watch pending, so no change detected yet +export const theNum = 42; --- nonIncremental.output.txt +++ incremental.output.txt -@@ -1,9 +0,0 @@ +@@ -1,6 +0,0 @@ -packages/pkg1/index.ts:1:29 - error TS1541: Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute. - To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ "type": "module" }`. - -1 import type { TheNum } from 'pkg2' -   ~~~~~~ - -- --Found 1 error in packages/pkg1/index.ts:1 -- Edit [3]:: removes those errors when a package file is changed to cjs extensions //// [/user/username/projects/myproject/packages/pkg2/index.cts] *new* @@ -341,6 +339,8 @@ export type { TheNum } from './const.cjs'; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * packages/pkg2/tsconfig.json * packages/pkg1/tsconfig.json @@ -392,6 +392,8 @@ Loading module as file / folder, candidate module location '/user/username/proje File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.cts' exists - use it as a name resolution result. ======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/myproject/packages/pkg1/build/index.js] *modified* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js index 2833baedaf..995b3e1d9a 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js @@ -16,6 +16,8 @@ Input:: tsgo -b -w -verbose --incremental ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -23,6 +25,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -125,6 +129,8 @@ Edit [0]:: No change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -132,6 +138,8 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *mTime changed* @@ -142,6 +150,8 @@ const x = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -149,6 +159,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./a.js","./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},"99aa06d3014798d86001c324468d497f-"],"options":{"allowJs":true},"affectedFilesPendingEmit":[2,3]} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js index 062cdb43b8..8ee92c09ce 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted.js @@ -16,6 +16,8 @@ Input:: tsgo -b -w -verbose ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -23,6 +25,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -81,6 +85,8 @@ Edit [0]:: No change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -90,6 +96,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -103,6 +111,8 @@ const x = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -110,6 +120,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *rewrite with same content* //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js index 483b8f7073..2f795e410b 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js @@ -16,6 +16,8 @@ export const b = 10; tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -32,8 +34,7 @@ Output:: 1 export const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]]} @@ -167,6 +168,8 @@ export const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -174,6 +177,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -269,6 +274,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -276,6 +283,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.d.ts] *new* export declare const a = "hello"; @@ -375,6 +384,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -384,6 +395,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -397,6 +410,8 @@ const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -413,8 +428,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]]} @@ -534,6 +548,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -550,8 +566,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.d.ts] *modified* declare const a: { @@ -670,6 +685,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -686,8 +703,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js index 5f5c0fffde..516fd9568c 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js @@ -14,6 +14,8 @@ const a = class { private p = 10; }; tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -30,8 +32,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]]} @@ -151,6 +152,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -158,6 +161,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -237,6 +242,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -244,6 +251,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.d.ts] *new* declare const a = "hello"; @@ -316,6 +325,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -325,6 +336,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -338,6 +351,8 @@ const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -354,8 +369,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]]} @@ -459,6 +473,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -475,8 +491,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.d.ts] *modified* declare const a: { @@ -579,6 +594,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -595,8 +612,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js index 82e8fb70bc..89195e93aa 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -16,6 +16,8 @@ export const b = 10; tsgo -b -verbose -w ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -23,6 +25,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -126,6 +130,8 @@ export const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -133,6 +139,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -222,6 +230,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -229,6 +239,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -316,6 +328,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -325,6 +339,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -338,6 +354,8 @@ const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -345,6 +363,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -432,6 +452,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -439,6 +461,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *modified* const a = class { p = 10; @@ -521,6 +545,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -530,6 +556,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js index 7498e4096c..48624d3c0d 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled-with-incremental.js @@ -14,6 +14,8 @@ const a = class { private p = 10; }; tsgo -b -verbose -w ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -21,6 +23,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -113,6 +117,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -120,6 +126,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -196,6 +204,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -203,6 +213,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* const a = "hello"; @@ -272,6 +284,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -281,6 +295,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -294,6 +310,8 @@ const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -301,6 +319,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -377,6 +397,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -384,6 +406,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *modified* const a = class { p = 10; @@ -455,6 +479,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -464,6 +490,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js index 465b0b0140..45a16017cd 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-without-dts-enabled.js @@ -14,6 +14,8 @@ const a = class { private p = 10; }; tsgo -b -verbose -w ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -21,6 +23,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* {"version":"FakeTSVersion","root":["./a.ts"]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* @@ -73,6 +77,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -80,6 +86,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* @@ -102,6 +110,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -109,6 +119,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* const a = "hello"; @@ -131,6 +143,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -140,6 +154,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -153,6 +169,8 @@ const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -160,6 +178,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* @@ -182,6 +202,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -189,6 +211,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *modified* const a = class { p = 10; @@ -213,6 +237,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -222,6 +248,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js index 0b427e8210..6b224e4d9a 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js @@ -14,6 +14,8 @@ const a = class { private p = 10; }; tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -30,8 +32,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* {"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} @@ -86,6 +87,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -93,6 +96,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["./a.ts"]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* @@ -128,6 +133,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -135,6 +142,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.d.ts] *new* declare const a = "hello"; @@ -160,6 +169,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -169,6 +180,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -182,6 +195,8 @@ const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -198,8 +213,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} @@ -237,6 +251,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -253,8 +269,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.d.ts] *modified* declare const a: { @@ -287,6 +302,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -303,8 +320,7 @@ Output:: 1 const a = class { private p = 10; };    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js index f71d54e003..24ed893968 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js @@ -16,6 +16,8 @@ export const b = 10; tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -28,8 +30,7 @@ Output:: 1 export const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -148,6 +149,8 @@ export const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -155,6 +158,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -244,6 +249,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -251,6 +258,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -338,6 +347,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -347,6 +358,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -360,6 +373,8 @@ const a: number = "hello" Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -372,8 +387,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -476,6 +490,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -488,8 +504,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.js] *modified* const a = "hello"; @@ -585,6 +600,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -597,8 +614,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js index 244837ae34..1fbba049e3 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js @@ -14,6 +14,8 @@ const a: number = "hello" tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -26,8 +28,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -135,6 +136,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -142,6 +145,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -218,6 +223,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -225,6 +232,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* const a = "hello"; @@ -294,6 +303,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -303,6 +314,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -316,6 +329,8 @@ const a: number = "hello" Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -328,8 +343,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -421,6 +435,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -433,8 +449,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.js] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* @@ -517,6 +532,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -529,8 +546,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js index 5154ffebf3..9d815e6d83 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js @@ -14,6 +14,8 @@ const a: number = "hello" tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -26,8 +28,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* {"version":"FakeTSVersion","root":["./a.ts"],"semanticErrors":true} @@ -82,6 +83,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -89,6 +92,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["./a.ts"]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* @@ -124,6 +129,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -131,6 +138,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* const a = "hello"; @@ -153,6 +162,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -162,6 +173,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -175,6 +188,8 @@ const a: number = "hello" Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -187,8 +202,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["./a.ts"],"semanticErrors":true} @@ -226,6 +240,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -238,8 +254,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.js] *rewrite with same content* //// [/home/src/projects/project/tsconfig.tsbuildinfo] *rewrite with same content* @@ -261,6 +276,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -273,8 +290,7 @@ Output:: 1 const a: number = "hello"    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js index 812e06bc72..737de58a96 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js @@ -16,6 +16,8 @@ export const b = 10; tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -28,8 +30,7 @@ Output:: 1 export const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -140,6 +141,8 @@ export const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -147,6 +150,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -238,6 +243,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -245,6 +252,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -332,6 +341,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -341,6 +352,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -354,6 +367,8 @@ const a = "hello Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -366,8 +381,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -451,6 +465,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -463,8 +479,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.js] *modified* const a = "hello; @@ -554,6 +569,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -566,8 +583,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js index 18571fb41c..e9407f92c2 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js @@ -14,6 +14,8 @@ const a = "hello tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -26,8 +28,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -126,6 +127,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -133,6 +136,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -209,6 +214,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -216,6 +223,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* const a = "hello"; @@ -285,6 +294,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -294,6 +305,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -307,6 +320,8 @@ const a = "hello Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -319,8 +334,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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]} @@ -393,6 +407,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -405,8 +421,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.js] *modified* const a = "hello; @@ -483,6 +498,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -495,8 +512,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js index 5322dd9c89..ce2247dff8 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js @@ -14,6 +14,8 @@ const a = "hello tsgo -b -verbose -w ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -26,8 +28,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *new* {"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} @@ -82,6 +83,8 @@ const a = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -89,6 +92,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["./a.ts"]} //// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* @@ -124,6 +129,8 @@ Edit [1]:: Emit after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -131,6 +138,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/a.js] *new* const a = "hello"; @@ -153,6 +162,8 @@ Edit [2]:: no Emit run after fixing error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -162,6 +173,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/projects/project/tsconfig.tsbuildinfo] *mTime changed* tsconfig.json:: @@ -175,6 +188,8 @@ const a = "hello Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -187,8 +202,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","errors":true,"root":["./a.ts"]} @@ -224,6 +238,8 @@ Edit [4]:: Emit when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -236,8 +252,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/projects/project/a.js] *modified* const a = "hello; @@ -263,6 +278,8 @@ Edit [5]:: no Emit run when error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -275,8 +292,7 @@ Output:: 1 const a = "hello    ~ - -Found 1 error in a.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js index 702cf5ed15..11b28b91d7 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js @@ -26,6 +26,8 @@ export { } tsgo -b -w -v ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -38,8 +40,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -176,6 +177,8 @@ Edit [0]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -188,8 +191,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -210,6 +212,8 @@ const a = { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -217,6 +221,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* export interface A { name: string; @@ -350,6 +356,8 @@ Edit [2]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -357,6 +365,8 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* @@ -368,6 +378,8 @@ const a: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -380,8 +392,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","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]],"semanticDiagnosticsPerFile":[[3,[{"pos":46,"end":47,"code":2322,"category":1,"message":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[3]} @@ -505,6 +516,8 @@ Edit [4]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -517,8 +530,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -533,6 +545,8 @@ const a: string = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -540,6 +554,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *rewrite with same content* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* "use strict"; @@ -647,6 +663,8 @@ Edit [6]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -654,6 +672,8 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* @@ -665,6 +685,8 @@ export const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -681,8 +703,7 @@ Output:: 2 export const a = class { private p = 10; };    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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":"6cc24027429965f7fa7493c1b9efd532-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };","signature":"86ced526ce468674cf13e9bae78ff450-export declare const a: {\n new (): {\n p: number;\n };\n};\n\n(53,1): error4094: Property 'p' of exported anonymous class type may not be private or protected.\n(53,1): error9027: Add a type annotation to the variable a.","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]],"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":[[3,17]]} @@ -818,6 +839,8 @@ Edit [8]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -834,8 +857,7 @@ Output:: 2 export const a = class { private p = 10; };    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -850,6 +872,8 @@ export const a = class { p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -857,6 +881,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *modified* export declare const a: { new (): { @@ -974,6 +1000,8 @@ Edit [10]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -981,5 +1009,7 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js index 524a5c3323..180edba04d 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js @@ -26,6 +26,8 @@ export { } tsgo -b -w -v ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -38,8 +40,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -107,6 +108,8 @@ Edit [0]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -119,8 +122,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -141,6 +143,8 @@ const a = { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -148,6 +152,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *new* export interface A { name: string; @@ -220,6 +226,8 @@ Edit [2]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -229,6 +237,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *mTime changed* @@ -249,6 +259,8 @@ const a: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -261,8 +273,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"semanticErrors":true} @@ -305,6 +316,8 @@ Edit [4]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -317,8 +330,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -333,6 +345,8 @@ const a: string = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -342,6 +356,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *rewrite with same content* @@ -392,6 +408,8 @@ Edit [6]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -401,6 +419,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *mTime changed* @@ -421,6 +441,8 @@ export const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -437,8 +459,7 @@ Output:: 2 export const a = class { private p = 10; };    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","errors":true,"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"]} @@ -481,6 +502,8 @@ Edit [8]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -497,8 +520,7 @@ Output:: 2 export const a = class { private p = 10; };    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -513,6 +535,8 @@ export const a = class { p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -522,6 +546,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *modified* @@ -582,6 +608,8 @@ Edit [10]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -591,6 +619,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js index 0e16f4237a..2e165e22e4 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-incremental.js @@ -26,6 +26,8 @@ export { } tsgo -b -w -v ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -38,8 +40,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -176,6 +177,8 @@ Edit [0]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -188,8 +191,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -210,6 +212,8 @@ const a = { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -217,6 +221,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -327,6 +333,8 @@ Edit [2]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -334,6 +342,8 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* @@ -345,6 +355,8 @@ const a: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -357,8 +369,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/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":"21728e732a07c83043db4a93ca54350c-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1},"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":[3]} @@ -472,6 +483,8 @@ Edit [4]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -484,8 +497,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -500,6 +512,8 @@ const a: string = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -507,6 +521,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -603,6 +619,8 @@ Edit [6]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -610,6 +628,8 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* @@ -621,6 +641,8 @@ export const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -628,6 +650,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -728,6 +752,8 @@ Edit [8]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -735,6 +761,8 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* @@ -746,6 +774,8 @@ export const a = class { p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -753,6 +783,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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]]} @@ -845,6 +877,8 @@ Edit [10]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -852,5 +886,7 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js index 7b77478c11..3908cd7669 100644 --- a/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js +++ b/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError.js @@ -26,6 +26,8 @@ export { } tsgo -b -w -v ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -38,8 +40,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -107,6 +108,8 @@ Edit [0]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -119,8 +122,7 @@ Output:: 4 ;   ~ - -Found 1 error in src/main.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -141,6 +143,8 @@ const a = { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -148,6 +152,8 @@ Output:: [HH:MM:SS AM] Building project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *new* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -207,6 +213,8 @@ Edit [2]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -216,6 +224,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* @@ -233,6 +243,8 @@ const a: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -245,8 +257,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"semanticErrors":true} @@ -289,6 +300,8 @@ Edit [4]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -301,8 +314,7 @@ Output:: 2 const a: string = 10;    ~ - -Found 1 error in src/main.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. tsconfig.json:: @@ -317,6 +329,8 @@ const a: string = "hello"; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -326,6 +340,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* "use strict"; @@ -373,6 +389,8 @@ Edit [6]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -382,6 +400,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* @@ -399,6 +419,8 @@ export const a = class { private p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -408,6 +430,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *modified* "use strict"; @@ -434,6 +458,8 @@ Edit [8]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -443,6 +469,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* @@ -460,6 +488,8 @@ export const a = class { p = 10; }; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -469,6 +499,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *rewrite with same content* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* @@ -487,6 +519,8 @@ Edit [10]:: No Change Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * tsconfig.json @@ -496,6 +530,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] *mTime changed* //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] *mTime changed* diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js index b60aa0a999..100bdbf0cb 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js @@ -18,6 +18,10 @@ export class myClass { } tsgo -b -w app ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -153,6 +157,8 @@ export var myClassWithError = class { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export var myClassWithError = class { @@ -162,8 +168,7 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - -Found 1 error in app/fileWithError.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* export declare var myClassWithError: { @@ -294,6 +299,8 @@ export class myClass2 { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export var myClassWithError = class { @@ -303,8 +310,7 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - -Found 1 error in app/fileWithError.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/solution/app/fileWithoutError.d.ts] *modified* export declare class myClass2 { diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js index 1391768a9f..a1c5d40a3f 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js @@ -18,6 +18,10 @@ export class myClass { } tsgo -b -w app ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -153,6 +157,8 @@ export var myClassWithError = class { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export var myClassWithError = class { @@ -162,8 +168,7 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - -Found 1 error in app/fileWithError.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* export declare var myClassWithError: { @@ -297,6 +302,10 @@ export var myClassWithError = class { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* export declare var myClassWithError: { new (): { diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js index a8f4dc1be1..238dfdebf7 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js @@ -18,6 +18,8 @@ export class myClass { } tsgo -b -w app ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export var myClassWithError = class { @@ -27,8 +29,7 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - -Found 1 error in app/fileWithError.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -197,6 +198,8 @@ export class myClass2 { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export var myClassWithError = class { @@ -206,8 +209,7 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - -Found 1 error in app/fileWithError.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/solution/app/fileWithoutError.d.ts] *modified* export declare class myClass2 { diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js index 5bb8b80896..14e00b8d9a 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js @@ -18,6 +18,8 @@ export class myClass { } tsgo -b -w app ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + app/fileWithError.ts:1:12 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export var myClassWithError = class { @@ -27,8 +29,7 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - -Found 1 error in app/fileWithError.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -200,6 +201,10 @@ export var myClassWithError = class { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/solution/app/fileWithError.d.ts] *modified* export declare var myClassWithError: { new (): { diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js index 98e4f9cd42..1aad07451f 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/tsbuildinfo-has-error.js @@ -11,6 +11,10 @@ Some random string tsgo --b -i -w ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js index d36fb6b4f6..fc0920fe88 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js @@ -30,6 +30,10 @@ export function createSomeObject(): SomeObject tsgo -b -w App ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -171,6 +175,8 @@ export function createSomeObject(): SomeObject Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + App/app.ts:2:20 - error TS2551: Property 'message' does not exist on type 'SomeObject'. Did you mean 'message2'? 2 createSomeObject().message; @@ -180,8 +186,7 @@ Output:: 2 message2: string;    ~~~~~~~~ - -Found 1 error in App/app.ts:2 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/sample1/App/app.js] *rewrite with same content* //// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo] *modified* @@ -297,6 +302,10 @@ export function createSomeObject(): SomeObject Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/App/app.js] *rewrite with same content* //// [/user/username/projects/sample1/App/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["./app.ts"]} diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js index a2f4c792ec..26d41d3ab1 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js @@ -51,6 +51,8 @@ let z = 0; tsgo -b -w -v ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -64,6 +66,8 @@ Output:: [HH:MM:SS AM] Building project 'project2.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -256,8 +260,12 @@ Edit [0]:: Remove project2 from base config Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * tsconfig.json +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js index c7b8ea79c1..1b377d6a30 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js @@ -13,13 +13,14 @@ const fn = (a: string, b: string) => b; tsgo -b -w ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + index.ts:1:13 - error TS6133: 'a' is declared but its value is never read. 1 const fn = (a: string, b: string) => b;    ~ - -Found 1 error in index.ts:1 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -81,6 +82,10 @@ Edit [0]:: Change tsconfig to set noUnusedParameters to false Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/myproject/index.js] *mTime changed* //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["./index.ts"]} diff --git a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js index 3af1e50823..7d01cdb130 100644 --- a/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js +++ b/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js @@ -65,6 +65,8 @@ let k = 0; tsgo -b -w -v project1.tsconfig.json project2.tsconfig.json project3.tsconfig.json ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -82,6 +84,8 @@ Output:: [HH:MM:SS AM] Building project 'project3.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -293,6 +297,8 @@ Edit [0]:: Modify alpha config Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -306,6 +312,8 @@ Output:: [HH:MM:SS AM] Building project 'project2.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/project/commonFile1.js] *rewrite with same content* //// [/user/username/projects/project/commonFile2.js] *rewrite with same content* //// [/user/username/projects/project/other.js] *rewrite with same content* @@ -453,6 +461,8 @@ Edit [1]:: change bravo config Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -462,6 +472,8 @@ Output:: [HH:MM:SS AM] Building project 'project2.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/project/other.js] *rewrite with same content* //// [/user/username/projects/project/project2.tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./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":"7148e8559d706b66aaba2a2423755c63-let z = 0;","signature":"879426698e1db06899fd57775c19b230-declare let z: number;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true,"strict":false},"latestChangedDtsFile":"./other.d.ts"} @@ -530,6 +542,8 @@ Edit [2]:: project 2 extends alpha Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -539,6 +553,8 @@ Output:: [HH:MM:SS AM] Building project 'project2.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/project/commonFile1.js] *rewrite with same content* //// [/user/username/projects/project/commonFile2.js] *rewrite with same content* //// [/user/username/projects/project/other.js] *rewrite with same content* @@ -596,6 +612,8 @@ Edit [3]:: update aplha config Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -609,6 +627,8 @@ Output:: [HH:MM:SS AM] Building project 'project2.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/project/commonFile1.js] *rewrite with same content* //// [/user/username/projects/project/commonFile2.js] *rewrite with same content* //// [/user/username/projects/project/other.js] *rewrite with same content* @@ -709,6 +729,8 @@ Edit [4]:: Modify extendsConfigFile2 Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -720,6 +742,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'project3.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/project/other2.js] *mTime changed* //// [/user/username/projects/project/project3.tsconfig.tsbuildinfo] *rewrite with same content* //// [/user/username/projects/project/project3.tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* @@ -741,6 +765,8 @@ Edit [5]:: Modify project 3 Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -752,6 +778,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'project3.tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/project/other2.js] *mTime changed* //// [/user/username/projects/project/project3.tsconfig.tsbuildinfo] *rewrite with same content* //// [/user/username/projects/project/project3.tsconfig.tsbuildinfo.readable.baseline.txt] *rewrite with same content* @@ -768,6 +796,8 @@ Edit [6]:: Delete extendedConfigFile2 and report error Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * project1.tsconfig.json * project2.tsconfig.json @@ -776,7 +806,6 @@ Output:: [HH:MM:SS AM] Project 'project3.tsconfig.json' is up to date because newest input 'other2.ts' is older than output 'project3.tsconfig.tsbuildinfo' error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. - -Found 1 error. +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js b/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js index 620b00b4df..b5d91adde7 100644 --- a/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js +++ b/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js @@ -42,6 +42,8 @@ export interface Session { tsgo -b -w -verbose src ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * src/pure/tsconfig.json * src/main/tsconfig.json @@ -55,6 +57,8 @@ Output:: [HH:MM:SS AM] Building project 'src/main/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -236,6 +240,8 @@ export interface Session { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * src/pure/tsconfig.json * src/main/tsconfig.json @@ -260,8 +266,7 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'src/main/tsconfig.json'... - -Found 1 error in src/main/index.ts:3 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/reexport/out/main/index.js] *mTime changed* //// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo] *modified* @@ -393,6 +398,8 @@ export interface Session { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * src/pure/tsconfig.json * src/main/tsconfig.json @@ -408,6 +415,8 @@ Output:: [HH:MM:SS AM] Updating unchanged output timestamps of project 'src/main/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/reexport/out/main/index.js] *mTime changed* //// [/user/username/projects/reexport/out/main/tsconfig.tsbuildinfo] *modified* {"version":"FakeTSVersion","root":["../../src/main/index.ts"]} diff --git a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js index 69c40a1c66..3c26c1fb21 100644 --- a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js +++ b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project-and-shared-is-first.js @@ -51,6 +51,8 @@ export function randomFn(str: string) { tsgo --b -w projects/server -v --traceResolution --explainFiles ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * projects/shared/tsconfig.json * projects/server/tsconfig.json @@ -94,6 +96,8 @@ projects/shared/dist/src/random.d.ts 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' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -379,6 +383,8 @@ export function log(str: string) { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * projects/shared/tsconfig.json * projects/server/tsconfig.json @@ -422,6 +428,8 @@ projects/shared/dist/src/random.d.ts 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' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -644,6 +652,8 @@ Edit [3]:: delete random file Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * projects/shared/tsconfig.json * projects/server/tsconfig.json @@ -682,6 +692,8 @@ projects/shared/dist/src/myClass.d.ts 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' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* diff --git a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js index 84642fd28a..22b038f81c 100644 --- a/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js +++ b/testdata/baselines/reference/tsbuildWatch/roots/when-root-file-is-from-referenced-project.js @@ -51,6 +51,8 @@ export function randomFn(str: string) { tsgo --b -w projects/server -v --traceResolution --explainFiles ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * projects/shared/tsconfig.json * projects/server/tsconfig.json @@ -94,6 +96,8 @@ projects/shared/dist/src/logging.d.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' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -379,6 +383,8 @@ export function log(str: string) { Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * projects/shared/tsconfig.json * projects/server/tsconfig.json @@ -422,6 +428,8 @@ projects/shared/dist/src/logging.d.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' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* @@ -644,6 +652,8 @@ Edit [3]:: delete random file Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * projects/shared/tsconfig.json * projects/server/tsconfig.json @@ -682,6 +692,8 @@ projects/server/src/server.ts 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' +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/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* diff --git a/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js index 0072889389..4ecab36d83 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates-with-circular-references.js @@ -64,6 +64,10 @@ export const m = mod; tsgo --b -w tests ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -429,6 +433,10 @@ export const newFileConst = 30; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/newfile.d.ts] *new* export declare const newFileConst = 30; @@ -555,6 +563,10 @@ export class someClass2 { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/newfile.d.ts] *modified* export declare class someClass2 { } diff --git a/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js index 0265e9fd38..16f7da7a0d 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -63,6 +63,10 @@ export const m = mod; tsgo --b -w tests ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -434,6 +438,10 @@ export const newFileConst = 30; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/newfile.d.ts] *new* export declare const newFileConst = 30; //# sourceMappingURL=newfile.d.ts.map @@ -564,6 +572,10 @@ export class someClass2 { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/newfile.d.ts] *modified* export declare class someClass2 { } diff --git a/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js index 32a7831769..c3368f7f8f 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message-with-circular-references.js @@ -64,6 +64,10 @@ export const m = mod; tsgo --b -w tests ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -432,6 +436,10 @@ export class someClass { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts] *modified* export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -734,6 +742,10 @@ export function multiply(a: number, b: number) { return a * b; } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts] *modified* export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -1033,6 +1045,10 @@ export class someClass2 { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts] *modified* export declare const someString: string; export declare function leftPad(s: string, n: number): string; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js index 7dc59d26c4..ef0e973e10 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/change-builds-changes-and-reports-found-errors-message.js @@ -63,6 +63,10 @@ export const m = mod; tsgo --b -w tests ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -437,6 +441,10 @@ export class someClass { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts] *modified* export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -743,6 +751,10 @@ export function multiply(a: number, b: number) { return a * b; } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts] *modified* export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -1046,6 +1058,10 @@ export class someClass2 { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts] *modified* export declare const someString: string; export declare function leftPad(s: string, n: number): string; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js b/testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js index b030e007b6..9eb820ff03 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/incremental-updates-in-verbose-mode.js @@ -63,6 +63,8 @@ export const m = mod; tsgo --b -w tests --verbose ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -80,6 +82,8 @@ Output:: [HH:MM:SS AM] Building project 'tests/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -457,6 +461,8 @@ function someFn() { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -470,6 +476,8 @@ Output:: [HH:MM:SS AM] Updating output timestamps of project 'tests/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/logic/index.js] *modified* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -583,6 +591,8 @@ export function someFn() { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -596,6 +606,8 @@ Output:: [HH:MM:SS AM] Building project 'tests/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/logic/index.d.ts] *modified* export declare function getSecondsInDay(): number; import * as mod from '../core/anotherModule'; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js index 3b1d10a1a2..5c7569ea6b 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects-with-circular-references.js @@ -64,6 +64,10 @@ export const m = mod; tsgo --b -w tests ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -432,6 +436,10 @@ function foo() { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.js] *modified* "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js index 44204e8c93..89d76bca33 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/non-local-change-does-not-start-build-of-referencing-projects.js @@ -63,6 +63,10 @@ export const m = mod; tsgo --b -w tests ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -437,6 +441,10 @@ function foo() { } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* //// [/user/username/projects/sample1/core/index.js] *modified* "use strict"; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js index ab0ccf36c5..1597a6769e 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-not-used.js @@ -63,6 +63,10 @@ export const m = mod; tsgo -b -w tests ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -440,13 +444,14 @@ let y: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. 7 let y: string = 10;    ~ - -Found 1 error in logic/index.ts:7 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/sample1/logic/index.js] *modified* "use strict"; @@ -572,6 +577,8 @@ let x: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. 4 let x: string = 10; @@ -582,12 +589,7 @@ Output:: 7 let y: string = 10;    ~ - -Found 2 errors in 2 files. - -Errors Files - 1 core/index.ts:4 - 1 logic/index.ts:7 +[HH:MM:SS AM] Found 2 errors. Watching for file changes. //// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* //// [/user/username/projects/sample1/core/index.js] *modified* @@ -721,13 +723,14 @@ export const m = mod; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. 4 let x: string = 10;    ~ - -Found 1 error in core/index.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/sample1/logic/index.js] *modified* "use strict"; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js index 0dd983a576..7f1d0027b3 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-preserveWatchOutput-is-passed-on-command-line.js @@ -63,6 +63,10 @@ export const m = mod; tsgo -b -w tests --preserveWatchOutput ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -440,13 +444,14 @@ let y: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. 7 let y: string = 10;    ~ - -Found 1 error in logic/index.ts:7 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/sample1/logic/index.js] *modified* "use strict"; @@ -572,6 +577,8 @@ let x: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. 4 let x: string = 10; @@ -582,12 +589,7 @@ Output:: 7 let y: string = 10;    ~ - -Found 2 errors in 2 files. - -Errors Files - 1 core/index.ts:4 - 1 logic/index.ts:7 +[HH:MM:SS AM] Found 2 errors. Watching for file changes. //// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* //// [/user/username/projects/sample1/core/index.js] *modified* @@ -721,13 +723,14 @@ export const m = mod; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. 4 let x: string = 10;    ~ - -Found 1 error in core/index.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/sample1/logic/index.js] *modified* "use strict"; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js index 7e23d232ff..bb6fe8e3ae 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/reportErrors-when-stopBuildOnErrors-is-passed-on-command-line.js @@ -63,6 +63,10 @@ export const m = mod; tsgo -b -w tests --stopBuildOnErrors ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -440,13 +444,14 @@ let y: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. 7 let y: string = 10;    ~ - -Found 1 error in logic/index.ts:7 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/user/username/projects/sample1/logic/index.js] *modified* "use strict"; @@ -571,6 +576,8 @@ let x: string = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. 4 let x: string = 10; @@ -581,12 +588,7 @@ Output:: 7 let y: string = 10;    ~ - -Found 2 errors in 2 files. - -Errors Files - 1 core/index.ts:4 - 1 logic/index.ts:7 +[HH:MM:SS AM] Found 2 errors. Watching for file changes. //// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* //// [/user/username/projects/sample1/core/index.js] *modified* @@ -707,24 +709,15 @@ Diff:: Clean build will stop on error in core and will not report error in logic Watch build will retain previous errors from logic and report it --- nonIncremental.output.txt +++ incremental.output.txt -@@ -3,6 +3,15 @@ +@@ -3,3 +3,8 @@ 4 let x: string = 10;    ~ -- --Found 1 error in core/index.ts:4 +logic/index.ts:7:5 - error TS2322: Type 'number' is not assignable to type 'string'. + +7 let y: string = 10; +   ~ + -+ -+Found 2 errors in 2 files. -+ -+Errors Files -+ 1 core/index.ts:4 -+ 1 logic/index.ts:7 - Edit [2]:: fix error in logic //// [/user/username/projects/sample1/logic/index.ts] *modified* @@ -737,12 +730,13 @@ export const m = mod; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + core/index.ts:4:5 - error TS2322: Type 'number' is not assignable to type 'string'. 4 let x: string = 10;    ~ - -Found 1 error in core/index.ts:4 +[HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js index b274f041d0..bf6b1a70c2 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js @@ -61,6 +61,8 @@ export const m = mod; tsgo --b -w core --verbose ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json @@ -68,6 +70,8 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -219,6 +223,8 @@ export const y = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json @@ -226,6 +232,8 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/outDir/file3.d.ts] *new* export declare const y = 10; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js index f695341f33..c7580e8511 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/should-not-trigger-recompilation-because-of-program-emit.js @@ -63,6 +63,8 @@ export const m = mod; tsgo --b -w core --verbose ExitStatus:: Success Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json @@ -70,6 +72,8 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -227,6 +231,8 @@ export const y = 10; Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json @@ -234,6 +240,8 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/file3.d.ts] *new* export declare const y = 10; //# sourceMappingURL=file3.d.ts.map diff --git a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index e4c1189d3d..080b2d9e4e 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -62,6 +62,8 @@ export const m = mod; tsgo --b tests --verbose --stopBuildOnErrors --watch ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -88,8 +90,7 @@ Output:: [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 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -267,6 +268,8 @@ export function multiply(a: number, b: number) { return a * b; } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -284,6 +287,8 @@ Output:: [HH:MM:SS AM] Building project 'tests/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* //// [/user/username/projects/sample1/core/index.js] *modified* "use strict"; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 32891f0593..b9b4ba3e5e 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -63,6 +63,8 @@ export const m = mod; tsgo --b tests --verbose --stopBuildOnErrors --watch ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -89,8 +91,7 @@ Output:: [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 +[HH:MM:SS AM] Found 1 error. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -268,6 +269,8 @@ export function multiply(a: number, b: number) { return a * b; } Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + [HH:MM:SS AM] Projects in this build: * core/tsconfig.json * logic/tsconfig.json @@ -285,6 +288,8 @@ Output:: [HH:MM:SS AM] Building project 'tests/tsconfig.json'... +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/core/index.d.ts.map] *rewrite with same content* //// [/user/username/projects/sample1/core/index.js] *modified* "use strict"; diff --git a/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js b/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js index d752b6949d..d33181dc37 100644 --- a/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js +++ b/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js @@ -51,14 +51,15 @@ export const m = mod; tsgo --b -w tests ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: +[HH:MM:SS AM] Starting compilation in watch mode... + error TS6053: File '/user/username/projects/sample1/logic/tsconfig.json' not found. tests/tsconfig.json:4:9 - error TS6053: File '/user/username/projects/sample1/logic' not found. 4 { "path": "../logic" },    ~~~~~~~~~~~~~~~~~~~~~~ - -Found 2 errors in the same file, starting at: tests/tsconfig.json:4 +[HH:MM:SS AM] Found 2 errors. Watching for file changes. //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -369,6 +370,10 @@ Edit [0]:: Write logic Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + //// [/user/username/projects/sample1/logic/index.d.ts] *rewrite with same content* //// [/user/username/projects/sample1/logic/index.js] *modified* "use strict";