diff --git a/tsc/internal/execute/incremental/buildInfo.go b/tsc/internal/execute/incremental/buildInfo.go index 4e248c77a64b7..0f6789d216b55 100644 --- a/tsc/internal/execute/incremental/buildInfo.go +++ b/tsc/internal/execute/incremental/buildInfo.go @@ -493,6 +493,7 @@ type BuildInfo struct { AffectedFilesPendingEmit []*BuildInfoFilePendingEmit `json:"affectedFilesPendingEmit,omitzero"` LatestChangedDtsFile BuildInfoPath `json:"latestChangedDtsFile,omitzero"` // Because this is only output file in the program, we dont need fileId to deduplicate name EmitSignatures []*BuildInfoEmitSignature `json:"emitSignatures,omitzero"` + LinkedPackagesSignature string `json:"linkedPackagesSignature,omitzero"` ResolvedRoot []*BuildInfoResolvedRoot `json:"resolvedRoot,omitzero"` // NonIncrementalProgram info diff --git a/tsc/internal/execute/incremental/buildinfotosnapshot.go b/tsc/internal/execute/incremental/buildinfotosnapshot.go index 25f6ac97aa798..2c164e66b50b2 100644 --- a/tsc/internal/execute/incremental/buildinfotosnapshot.go +++ b/tsc/internal/execute/incremental/buildinfotosnapshot.go @@ -36,6 +36,7 @@ func buildInfoToSnapshot(buildInfo *BuildInfo, config *tsoptions.ParsedCommandLi if buildInfo.LatestChangedDtsFile != "" { to.snapshot.latestChangedDtsFile = to.toAbsoluteFileName(buildInfo.LatestChangedDtsFile) } + to.snapshot.linkedPackagesSignature = buildInfo.LinkedPackagesSignature to.snapshot.hasErrors = core.IfElse(buildInfo.Errors, core.TSTrue, core.TSFalse) to.snapshot.hasSemanticErrors = buildInfo.SemanticErrors to.snapshot.checkPending = buildInfo.CheckPending diff --git a/tsc/internal/execute/incremental/programtosnapshot.go b/tsc/internal/execute/incremental/programtosnapshot.go index b817bc44d5b76..22ac07c5808bd 100644 --- a/tsc/internal/execute/incremental/programtosnapshot.go +++ b/tsc/internal/execute/incremental/programtosnapshot.go @@ -2,6 +2,9 @@ package incremental import ( "context" + "fmt" + "slices" + "strings" "github.com/microsoft/TypeScript/tsc/internal/ast" "github.com/microsoft/TypeScript/tsc/internal/binder" @@ -9,6 +12,10 @@ import ( "github.com/microsoft/TypeScript/tsc/internal/collections" "github.com/microsoft/TypeScript/tsc/internal/compiler" "github.com/microsoft/TypeScript/tsc/internal/core" + "github.com/microsoft/TypeScript/tsc/internal/json" + "github.com/microsoft/TypeScript/tsc/internal/outputpaths" + "github.com/microsoft/TypeScript/tsc/internal/packagejson" + "github.com/microsoft/TypeScript/tsc/internal/symlinks" "github.com/microsoft/TypeScript/tsc/internal/tsoptions" "github.com/microsoft/TypeScript/tsc/internal/tspath" ) @@ -33,6 +40,7 @@ func programToSnapshot(program *compiler.Program, oldProgram *Program, hashWithT to.computeProgramFileChanges() to.handleFileDelete() to.handleGlobalScopeChange() + to.computeLinkedPackagesSignature() to.handlePendingEmit() to.handlePendingCheck() } @@ -211,6 +219,9 @@ func (t *toProgramSnapshot) handlePendingEmit() { } else { pendingEmitKind = getPendingEmitKindWithOptions(t.snapshot.options, t.oldProgram.snapshot.options) } + if t.snapshot.linkedPackagesSignature != t.oldProgram.snapshot.linkedPackagesSignature { + pendingEmitKind |= GetFileEmitKind(t.snapshot.options) & FileEmitKindAllDts + } if pendingEmitKind != FileEmitKindNone { // Add all files to affectedFilesPendingEmit since emit changed for _, file := range t.program.GetSourceFiles() { @@ -224,6 +235,68 @@ func (t *toProgramSnapshot) handlePendingEmit() { } } +func (t *toProgramSnapshot) computeLinkedPackagesSignature() { + if !t.snapshot.options.GetEmitDeclarations() { + return + } + caseSensitivity := t.program.CaseSensitivity() + var baseDirectory string + if buildInfoFileName := outputpaths.GetBuildInfoFileName(t.snapshot.options, caseSensitivity); buildInfoFileName != "" { + baseDirectory = buildInfoFileName.Directory().AsString() + } + toSignaturePath := func(path tspath.PathKey) string { + if baseDirectory == "" { + return path.AsString() + } + return tspath.GetRelativePathFromDirectory(baseDirectory, path.AsString(), caseSensitivity) + } + var links []string + t.program.GetSymlinkCache().Directories().Range(func(symlinkPath tspath.PathKey, link *symlinks.KnownDirectoryLink) bool { + if link == nil { + return true + } + entry := toSignaturePath(symlinkPath) + " -> " + toSignaturePath(link.RealPath) + if info := t.program.GetPackageJsonInfo(link.Real.ResolveFile("package.json")); info != nil { + entry += " " + getPackageEntryFields(info.GetContents()) + } + links = append(links, entry) + return true + }) + if len(links) == 0 { + return + } + slices.Sort(links) + t.snapshot.linkedPackagesSignature = t.snapshot.computeHash(strings.Join(links, "\n")) +} + +func getPackageEntryFields(contents *packagejson.PackageJson) string { + validValue := func(field packagejson.Expected[string]) *string { + if value, ok := field.GetValue(); ok { + return &value + } + return nil + } + fields, err := json.Marshal(struct { + Type string `json:"type,omitzero"` + Main *string `json:"main,omitzero"` + Types *string `json:"types,omitzero"` + Typings *string `json:"typings,omitzero"` + TypesVersions packagejson.JSONValue `json:"typesVersions,omitzero"` + Exports packagejson.ExportsOrImports `json:"exports,omitzero"` + }{ + Type: contents.Type.Value, + Main: validValue(contents.Main), + Types: validValue(contents.Types), + Typings: validValue(contents.Typings), + TypesVersions: contents.TypesVersions, + Exports: contents.Exports, + }) + if err != nil { + panic(fmt.Sprintf("Failed to marshal package.json fields: %v", err)) + } + return string(fields) +} + func (t *toProgramSnapshot) handlePendingCheck() { if t.oldProgram != nil && t.snapshot.semanticDiagnosticsPerFile.Size() != len(t.program.GetSourceFiles()) && diff --git a/tsc/internal/execute/incremental/snapshot.go b/tsc/internal/execute/incremental/snapshot.go index b4ed4a0ba0021..783d1c259ff91 100644 --- a/tsc/internal/execute/incremental/snapshot.go +++ b/tsc/internal/execute/incremental/snapshot.go @@ -330,8 +330,9 @@ type snapshot struct { // If semantic diagnostic check is pending checkPending bool // Looked up package.json files from - packageJsons []tspath.RootedFilePath - missingPackageJsons []tspath.RootedFilePath + packageJsons []tspath.RootedFilePath + missingPackageJsons []tspath.RootedFilePath + linkedPackagesSignature string // Additional fields that are not serialized but needed to track state diff --git a/tsc/internal/execute/incremental/snapshottobuildinfo.go b/tsc/internal/execute/incremental/snapshottobuildinfo.go index ee592a5ee505b..2ab96e999caf7 100644 --- a/tsc/internal/execute/incremental/snapshottobuildinfo.go +++ b/tsc/internal/execute/incremental/snapshottobuildinfo.go @@ -47,6 +47,7 @@ func snapshotToBuildInfo(snapshot *snapshot, program *compiler.Program, buildInf if snapshot.latestChangedDtsFile != "" { buildInfo.LatestChangedDtsFile = to.fileNameRelativeToBuildInfo(snapshot.latestChangedDtsFile) } + buildInfo.LinkedPackagesSignature = snapshot.linkedPackagesSignature } else { to.setRootOfNonIncrementalProgram() } diff --git a/tsc/internal/execute/tsctests/readablebuildinfo.go b/tsc/internal/execute/tsctests/readablebuildinfo.go index ad0cbd75eb762..fa8735bf4e5b1 100644 --- a/tsc/internal/execute/tsctests/readablebuildinfo.go +++ b/tsc/internal/execute/tsctests/readablebuildinfo.go @@ -35,6 +35,7 @@ type readableBuildInfo struct { AffectedFilesPendingEmit []*readableBuildInfoFilePendingEmit `json:"affectedFilesPendingEmit,omitzero"` LatestChangedDtsFile string `json:"latestChangedDtsFile,omitzero"` // Because this is only output file in the program, we dont need fileId to deduplicate name EmitSignatures []*readableBuildInfoEmitSignature `json:"emitSignatures,omitzero"` + LinkedPackagesSignature string `json:"linkedPackagesSignature,omitzero"` ResolvedRoot []*readableBuildInfoResolvedRoot `json:"resolvedRoot,omitzero"` Size int `json:"size,omitzero"` // Size of the build info file @@ -217,17 +218,18 @@ func (b *readableBuildInfoResolvedRoot) UnmarshalJSON(data []byte) error { func toReadableBuildInfo(buildInfo *incremental.BuildInfo, buildInfoText string) string { readable := readableBuildInfo{ - buildInfo: buildInfo, - Version: buildInfo.Version, - Errors: buildInfo.Errors, - CheckPending: buildInfo.CheckPending, - FileNames: buildInfoPathsAsStrings(buildInfo.FileNames), - Options: buildInfo.Options, - LatestChangedDtsFile: buildInfo.LatestChangedDtsFile.AsString(), - SemanticErrors: buildInfo.SemanticErrors, - PackageJsons: buildInfoPathsAsStrings(buildInfo.PackageJsons), - MissingPackageJsons: buildInfoPathsAsStrings(buildInfo.MissingPackageJsons), - Size: len(buildInfoText), + buildInfo: buildInfo, + Version: buildInfo.Version, + Errors: buildInfo.Errors, + CheckPending: buildInfo.CheckPending, + FileNames: buildInfoPathsAsStrings(buildInfo.FileNames), + Options: buildInfo.Options, + LatestChangedDtsFile: buildInfo.LatestChangedDtsFile.AsString(), + LinkedPackagesSignature: buildInfo.LinkedPackagesSignature, + SemanticErrors: buildInfo.SemanticErrors, + PackageJsons: buildInfoPathsAsStrings(buildInfo.PackageJsons), + MissingPackageJsons: buildInfoPathsAsStrings(buildInfo.MissingPackageJsons), + Size: len(buildInfoText), } readable.setFileInfos() readable.setRoot() diff --git a/tsc/internal/execute/tsctests/sys.go b/tsc/internal/execute/tsctests/sys.go index 555377a2aed31..21dbcff674f58 100644 --- a/tsc/internal/execute/tsctests/sys.go +++ b/tsc/internal/execute/tsctests/sys.go @@ -594,6 +594,10 @@ func (s *TestSys) removeNoError(path string) { } } +func (s *TestSys) addSymlink(path string, target string) { + s.mapFs().AddSymlink(strings.TrimPrefix(path, "/"), strings.TrimPrefix(target, "/")) +} + func (s *TestSys) readFileNoError(path string) string { content, ok := s.fsFromFileMap().ReadFile(tspath.ToRootedFilePath(path, s.GetCurrentDirectory())) if !ok { diff --git a/tsc/internal/execute/tsctests/tsc_test.go b/tsc/internal/execute/tsctests/tsc_test.go index f1c8a890e877c..66ddf5d6f8083 100644 --- a/tsc/internal/execute/tsctests/tsc_test.go +++ b/tsc/internal/execute/tsctests/tsc_test.go @@ -2564,11 +2564,76 @@ func TestTscIncremental(t *testing.T) { }, } + testCases = append(testCases, linkedPackageDeclarationEmitTestInput( + "updates declaration emit when linked dependency is removed and added", + nil, + )) + for _, test := range testCases { test.run(t, "incremental") } } +func linkedPackageDeclarationEmitTestInput(subScenario string, commandLineArgs []string) *tscInput { + writeManifestOfA := func(sys *TestSys, dependencies string) { + sys.writeFileNoError("/home/src/workspaces/project/a/package.json", fmt.Sprintf(`{"name":"a","version":"1.0.0","type":"module","dependencies":{%s}}`, dependencies)) + } + return &tscInput{ + subScenario: subScenario, + files: FileMap{ + "/home/src/workspaces/project/a/package.json": `{"name":"a","version":"1.0.0","type":"module","dependencies":{"b":"1.0.0","c":"1.0.0"}}`, + "/home/src/workspaces/project/a/tsconfig.json": stringtestutil.Dedent(` + { + "compilerOptions": { + "incremental": true, + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"] + }`), + "/home/src/workspaces/project/a/src/index.ts": stringtestutil.Dedent(` + import { currentStage } from "b"; + export const stage = currentStage(); + `), + "/home/src/workspaces/project/a/node_modules/b": vfstest.Symlink("/home/src/workspaces/project/b"), + "/home/src/workspaces/project/a/node_modules/c": vfstest.Symlink("/home/src/workspaces/project/c"), + "/home/src/workspaces/project/b/package.json": `{"name":"b","version":"1.0.0","type":"module","types":"./index.d.ts","dependencies":{"c":"1.0.0"}}`, + "/home/src/workspaces/project/b/index.d.ts": `export declare const currentStage: () => import("c").Current;`, + "/home/src/workspaces/project/b/node_modules/c": vfstest.Symlink("/home/src/workspaces/project/c"), + "/home/src/workspaces/project/c/package.json": `{"name":"c","version":"1.0.0","type":"module","types":"./index.d.ts"}`, + "/home/src/workspaces/project/c/index.d.ts": stringtestutil.Dedent(` + export interface Current { readonly stage: string } + export declare const current: Current; + `), + }, + cwd: "/home/src/workspaces/project/a", + commandLineArgs: commandLineArgs, + edits: []*tscEdit{ + { + caption: "remove c from dependencies and unlink it", + edit: func(sys *TestSys) { + writeManifestOfA(sys, `"b":"1.0.0"`) + sys.removeNoError("/home/src/workspaces/project/a/node_modules/c") + }, + }, + noChange, + { + caption: "add c to dependencies and link it", + edit: func(sys *TestSys) { + writeManifestOfA(sys, `"b":"1.0.0","c":"1.0.0"`) + sys.addSymlink("/home/src/workspaces/project/a/node_modules/c", "/home/src/workspaces/project/c") + }, + }, + noChange, + }, + } +} + func TestTscLibraryResolution(t *testing.T) { t.Parallel() getTscLibraryResolutionFileMap := func(libReplacement bool) FileMap { diff --git a/tsc/internal/execute/tsctests/tscbuild_test.go b/tsc/internal/execute/tsctests/tscbuild_test.go index 1e6c958bd396f..1035f460e64aa 100644 --- a/tsc/internal/execute/tsctests/tscbuild_test.go +++ b/tsc/internal/execute/tsctests/tscbuild_test.go @@ -1139,6 +1139,55 @@ func TestBuildDependencyUpdate(t *testing.T) { updateDepAWithBreakingTypeChange := func(sys *TestSys) { sys.writeFileNoError("/home/src/workspaces/project/node_modules/dep-a/index.d.ts", `export type Kind = "a" | "b" | "c";`) } + linkedPackageConfig := func(name string, references string) string { + return stringtestutil.Dedent(fmt.Sprintf(` + { + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/%s", + "tsBuildInfoFile": "../dist/%s.tsbuildinfo" + }, + "include": ["src"], + "references": %s + }`, name, name, references)) + } + linkedPackageManifest := func(name string, dependencies string) string { + return fmt.Sprintf(`{"name":"%s","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{%s}}`, name, dependencies) + } + getLinkedPackageFiles := func(aDependencies string) FileMap { + return FileMap{ + "/home/src/workspaces/solution/tsconfig.json": `{"files":[],"references":[{"path":"./a"}]}`, + "/home/src/workspaces/solution/a/package.json": linkedPackageManifest("a", aDependencies), + "/home/src/workspaces/solution/a/tsconfig.json": linkedPackageConfig("a", `[{"path":"../b"}]`), + "/home/src/workspaces/solution/a/src/index.ts": stringtestutil.Dedent(` + import { currentStage } from "b"; + export const stage = currentStage(); + `), + "/home/src/workspaces/solution/a/node_modules/b": vfstest.Symlink("/home/src/workspaces/solution/b"), + "/home/src/workspaces/solution/b/package.json": linkedPackageManifest("b", `"c":"1.0.0"`), + "/home/src/workspaces/solution/b/tsconfig.json": linkedPackageConfig("b", `[{"path":"../c"}]`), + "/home/src/workspaces/solution/b/src/index.ts": stringtestutil.Dedent(` + import { current } from "c"; + export const currentStage = () => current; + `), + "/home/src/workspaces/solution/b/node_modules/c": vfstest.Symlink("/home/src/workspaces/solution/c"), + "/home/src/workspaces/solution/c/package.json": linkedPackageManifest("c", ""), + "/home/src/workspaces/solution/c/tsconfig.json": linkedPackageConfig("c", "[]"), + "/home/src/workspaces/solution/c/src/index.ts": stringtestutil.Dedent(` + export interface Current { readonly stage: string } + export const current: Current = { stage: "test" }; + `), + } + } + writeLinkedPackageManifestOfA := func(sys *TestSys, dependencies string) { + sys.writeFileNoError("/home/src/workspaces/solution/a/package.json", linkedPackageManifest("a", dependencies)) + } testCases := []*tscInput{ { // https://github.com/microsoft/TypeScript/tsc/issues/2666 @@ -1419,6 +1468,95 @@ func TestBuildDependencyUpdate(t *testing.T) { }, }, }, + { + subScenario: "updates declaration emit when linked dependency is added and removed", + files: getLinkedPackageFiles(`"b":"1.0.0"`), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "--verbose"}, + edits: []*tscEdit{ + { + caption: "add c to dependencies of a and link it", + edit: func(sys *TestSys) { + writeLinkedPackageManifestOfA(sys, `"b":"1.0.0","c":"1.0.0"`) + sys.addSymlink("/home/src/workspaces/solution/a/node_modules/c", "/home/src/workspaces/solution/c") + }, + }, + noChange, + { + caption: "force build with c linked", + commandLineArgs: []string{"--b", "--verbose", "--force"}, + }, + { + caption: "remove c from dependencies of a and unlink it", + edit: func(sys *TestSys) { + writeLinkedPackageManifestOfA(sys, `"b":"1.0.0"`) + sys.removeNoError("/home/src/workspaces/solution/a/node_modules/c") + }, + }, + noChange, + }, + }, + { + subScenario: "updates declaration emit when dependency on linked package is added and removed", + files: func() FileMap { + files := getLinkedPackageFiles(`"b":"1.0.0"`) + files["/home/src/workspaces/solution/a/node_modules/c"] = vfstest.Symlink("/home/src/workspaces/solution/c") + return files + }(), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "--verbose"}, + edits: []*tscEdit{ + { + caption: "add c to dependencies of a", + edit: func(sys *TestSys) { + writeLinkedPackageManifestOfA(sys, `"b":"1.0.0","c":"1.0.0"`) + }, + }, + noChange, + { + caption: "force build with c as dependency", + commandLineArgs: []string{"--b", "--verbose", "--force"}, + }, + { + caption: "remove c from dependencies of a", + edit: func(sys *TestSys) { + writeLinkedPackageManifestOfA(sys, `"b":"1.0.0"`) + }, + }, + noChange, + }, + }, + { + subScenario: "updates declaration emit when types entry of linked package changes", + files: func() FileMap { + files := getLinkedPackageFiles(`"b":"1.0.0","c":"1.0.0"`) + files["/home/src/workspaces/solution/a/node_modules/c"] = vfstest.Symlink("/home/src/workspaces/solution/c") + files["/home/src/workspaces/solution/b/src/index.ts"] = stringtestutil.Dedent(` + import { current } from "c/src/index.js"; + export const currentStage = () => current; + `) + files["/home/src/workspaces/solution/c/src/main.ts"] = `export const version = "1.0.0";` + return files + }(), + cwd: "/home/src/workspaces/solution", + commandLineArgs: []string{"--b", "--verbose"}, + edits: []*tscEdit{ + { + caption: "point types of c to another entry", + edit: func(sys *TestSys) { + sys.replaceFileText("/home/src/workspaces/solution/c/package.json", "./src/index.ts", "./src/main.ts") + }, + }, + noChange, + { + caption: "point types of c back to index", + edit: func(sys *TestSys) { + sys.replaceFileText("/home/src/workspaces/solution/c/package.json", "./src/main.ts", "./src/index.ts") + }, + }, + noChange, + }, + }, } for _, test := range testCases { diff --git a/tsc/internal/execute/tsctests/tscwatch_test.go b/tsc/internal/execute/tsctests/tscwatch_test.go index 16a26026f3326..a10d9ff1f3352 100644 --- a/tsc/internal/execute/tsctests/tscwatch_test.go +++ b/tsc/internal/execute/tsctests/tscwatch_test.go @@ -2,6 +2,7 @@ package tsctests import ( "fmt" + "slices" "strings" "testing" @@ -598,6 +599,14 @@ func TestWatch(t *testing.T) { }), }, }, + func() *tscInput { + input := linkedPackageDeclarationEmitTestInput( + "watch updates declaration emit when linked dependency is removed and added", + []string{"--watch", "--incremental", "false"}, + ) + input.edits = slices.DeleteFunc(input.edits, func(edit *tscEdit) bool { return edit == noChange }) + return input + }(), } for _, test := range testCases { diff --git a/tsc/internal/packagejson/jsonvalue.go b/tsc/internal/packagejson/jsonvalue.go index ef88e9b07c426..4d2096bb92504 100644 --- a/tsc/internal/packagejson/jsonvalue.go +++ b/tsc/internal/packagejson/jsonvalue.go @@ -83,6 +83,12 @@ func (v JSONValue) AsString() string { return v.Value.(string) } +var _ json.MarshalerTo = JSONValue{} + +func (v JSONValue) MarshalJSONTo(enc *json.Encoder) error { + return json.MarshalEncode(enc, v.Value) +} + var _ json.UnmarshalerFrom = (*JSONValue)(nil) func (v *JSONValue) UnmarshalJSONFrom(dec *json.Decoder) error { diff --git a/tsc/internal/packagejson/jsonvalue_test.go b/tsc/internal/packagejson/jsonvalue_test.go index 81897f868a871..6e2c9c0eeb6c1 100644 --- a/tsc/internal/packagejson/jsonvalue_test.go +++ b/tsc/internal/packagejson/jsonvalue_test.go @@ -15,6 +15,23 @@ func TestJSONValue(t *testing.T) { t.Parallel() testJSONValue(t, func(in []byte, out any) error { return json.Unmarshal(in, out) }) }) + + t.Run("MarshalJSONV2", func(t *testing.T) { + t.Parallel() + type packageJson struct { + Private packagejson.JSONValue `json:"private,omitzero"` + Version packagejson.JSONValue `json:"version,omitzero"` + Exports packagejson.ExportsOrImports `json:"exports,omitzero"` + Imports packagejson.ExportsOrImports `json:"imports,omitzero"` + NotPresent packagejson.JSONValue `json:"notPresent,omitzero"` + } + jsonString := `{"private":true,"version":2,"exports":{".":{"import":"./test.ts","default":"./test.ts"},"./test":["./test1.ts",null],"./null":null},"imports":null}` + var p packageJson + assert.NilError(t, json.Unmarshal([]byte(jsonString), &p)) + out, err := json.Marshal(p) + assert.NilError(t, err) + assert.Equal(t, string(out), jsonString) + }) } func testJSONValue(t *testing.T, unmarshal func([]byte, any) error) { diff --git a/tsc/testdata/baselines/reference/tsbuild/declarationEmitForReferencedProjectTypesSubpath/declaration-emit-names-referenced-project-type-via-types-subpath.js b/tsc/testdata/baselines/reference/tsbuild/declarationEmitForReferencedProjectTypesSubpath/declaration-emit-names-referenced-project-type-via-types-subpath.js index 62bdde37b2ff8..0570fc4692c37 100644 --- a/tsc/testdata/baselines/reference/tsbuild/declarationEmitForReferencedProjectTypesSubpath/declaration-emit-names-referenced-project-type-via-types-subpath.js +++ b/tsc/testdata/baselines/reference/tsbuild/declarationEmitForReferencedProjectTypesSubpath/declaration-emit-names-referenced-project-type-via-types-subpath.js @@ -107,7 +107,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/home/src/workspaces/solution/packages/consumer/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[5],"packageJsons":["./package.json","../dep/package.json"],"fileNames":["lib.es2026.full.d.ts","../dep/types/themes/componentTypes/formFieldLayout.d.ts","../dep/types/themes/componentTypes/index.d.ts","../dep/types/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"2265bb6aae4ea44359eda1a1333669d7-export type FormFieldLayout = {\n textColor: string;\n fontSize: string;\n};\nexport default FormFieldLayout;\n","262c77b15a9433c1a517a42af08dabc4-import type FormFieldLayout from \"./formFieldLayout.js\";\nexport type ComponentTypes = {\n formFieldLayout: () => FormFieldLayout;\n};\n","8c960f82affa27b6eaa999ea3cdac3e7-import type { ComponentTypes as NewComponentTypes } from \"./themes/componentTypes/index.js\";\nexport type { NewComponentTypes };\n",{"version":"0eb11471bc41fb5a80fd0098368e8295-import type { NewComponentTypes } from \"@scope/dep\"\ndeclare const c: NewComponentTypes\nexport const style = c.formFieldLayout()","signature":"9cca47ad36e3ee3df7f98a27c15d37b0-export declare const style: import(\"@scope/dep/types/themes/componentTypes/formFieldLayout.js\").FormFieldLayout;\n","impliedNodeFormat":1}],"fileIdsList":[[4],[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationDir":"./types","module":99,"outDir":"./types","rootDir":"./src","strict":true},"referencedMap":[[5,1],[4,2],[3,3]],"latestChangedDtsFile":"./types/index.d.ts"} +{"version":"FakeTSVersion","root":[5],"packageJsons":["./package.json","../dep/package.json"],"fileNames":["lib.es2026.full.d.ts","../dep/types/themes/componentTypes/formFieldLayout.d.ts","../dep/types/themes/componentTypes/index.d.ts","../dep/types/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"2265bb6aae4ea44359eda1a1333669d7-export type FormFieldLayout = {\n textColor: string;\n fontSize: string;\n};\nexport default FormFieldLayout;\n","262c77b15a9433c1a517a42af08dabc4-import type FormFieldLayout from \"./formFieldLayout.js\";\nexport type ComponentTypes = {\n formFieldLayout: () => FormFieldLayout;\n};\n","8c960f82affa27b6eaa999ea3cdac3e7-import type { ComponentTypes as NewComponentTypes } from \"./themes/componentTypes/index.js\";\nexport type { NewComponentTypes };\n",{"version":"0eb11471bc41fb5a80fd0098368e8295-import type { NewComponentTypes } from \"@scope/dep\"\ndeclare const c: NewComponentTypes\nexport const style = c.formFieldLayout()","signature":"9cca47ad36e3ee3df7f98a27c15d37b0-export declare const style: import(\"@scope/dep/types/themes/componentTypes/formFieldLayout.js\").FormFieldLayout;\n","impliedNodeFormat":1}],"fileIdsList":[[4],[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationDir":"./types","module":99,"outDir":"./types","rootDir":"./src","strict":true},"referencedMap":[[5,1],[4,2],[3,3]],"latestChangedDtsFile":"./types/index.d.ts","linkedPackagesSignature":"b1872c05dc141ab4eda198827d4e0c5e-../../node_modules/@scope/dep -> ../dep {\"exports\":{\"./src/*\":\"./src/*\",\"./types/*\":\"./types/*\",\".\":{\"types\":\"./types/index.d.ts\",\"default\":\"./src/index.ts\"}}}"} //// [/home/src/workspaces/solution/packages/consumer/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -206,7 +206,8 @@ declare const console: { log(msg: any): void; }; ] }, "latestChangedDtsFile": "./types/index.d.ts", - "size": 2200 + "linkedPackagesSignature": "b1872c05dc141ab4eda198827d4e0c5e-../../node_modules/@scope/dep -> ../dep {\"exports\":{\"./src/*\":\"./src/*\",\"./types/*\":\"./types/*\",\".\":{\"types\":\"./types/index.d.ts\",\"default\":\"./src/index.ts\"}}}", + "size": 2441 } //// [/home/src/workspaces/solution/packages/consumer/types/index.d.ts] *new* export declare const style: import("@scope/dep/types/themes/componentTypes/formFieldLayout.js").FormFieldLayout; diff --git a/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-dependency-on-linked-package-is-added-and-removed.js b/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-dependency-on-linked-package-is-added-and-removed.js new file mode 100644 index 0000000000000..3f6df0c9f6391 --- /dev/null +++ b/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-dependency-on-linked-package-is-added-and-removed.js @@ -0,0 +1,803 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/a/node_modules/b] -> /home/src/workspaces/solution/b *new* +//// [/home/src/workspaces/solution/a/node_modules/c] -> /home/src/workspaces/solution/c *new* +//// [/home/src/workspaces/solution/a/package.json] *new* +{"name":"a","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"b":"1.0.0"}} +//// [/home/src/workspaces/solution/a/src/index.ts] *new* +import { currentStage } from "b"; +export const stage = currentStage(); +//// [/home/src/workspaces/solution/a/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/a", + "tsBuildInfoFile": "../dist/a.tsbuildinfo" + }, + "include": ["src"], + "references": [{"path":"../b"}] +} +//// [/home/src/workspaces/solution/b/node_modules/c] -> /home/src/workspaces/solution/c *new* +//// [/home/src/workspaces/solution/b/package.json] *new* +{"name":"b","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"c":"1.0.0"}} +//// [/home/src/workspaces/solution/b/src/index.ts] *new* +import { current } from "c"; +export const currentStage = () => current; +//// [/home/src/workspaces/solution/b/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/b", + "tsBuildInfoFile": "../dist/b.tsbuildinfo" + }, + "include": ["src"], + "references": [{"path":"../c"}] +} +//// [/home/src/workspaces/solution/c/package.json] *new* +{"name":"c","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{}} +//// [/home/src/workspaces/solution/c/src/index.ts] *new* +export interface Current { readonly stage: string } +export const current: Current = { stage: "test" }; +//// [/home/src/workspaces/solution/c/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/c", + "tsBuildInfoFile": "../dist/c.tsbuildinfo" + }, + "include": ["src"], + "references": [] +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{"files":[],"references":[{"path":"./a"}]} + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is out of date because output file 'dist/c.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'c/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output file 'dist/b.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output file 'dist/a.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +a/src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/src/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in a/src/index.ts:2 + +//// [/home/src/tslibs/TS/Lib/lib.es2026.full.d.ts] *Lib* +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +interface SymbolConstructor { + (desc?: string | number): symbol; + for(name: string): symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} +declare const console: { log(msg: any): void; }; +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"emitDiagnosticsPerFile":[[4,[{"pos":47,"end":52,"code":2883,"category":1,"messageKey":"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883","messageArgs":["stage","../../b/node_modules/c/src/index.js","Current"]}]]],"affectedFilesPendingEmit":[[4,16]],"emitSignatures":[4],"linkedPackagesSignature":"04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../a/src/index.ts", + [ + { + "pos": 47, + "end": 52, + "code": 2883, + "category": 1, + "messageKey": "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883", + "messageArgs": [ + "stage", + "../../b/node_modules/c/src/index.js", + "Current" + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../a/src/index.ts", + "DtsEmit", + [ + 4, + 16 + ] + ] + ], + "emitSignatures": [ + { + "file": "../a/src/index.ts", + "original": 4 + } + ], + "linkedPackagesSignature": "04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2149 +} +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"packageJsons":["../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","../b/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n",{"version":"b8f420826cc95086ac9bf1d196006850-import { current } from \"c\";\nexport const currentStage = () => current;","signature":"40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./b","rootDir":"../b/src","strict":true,"tsBuildInfoFile":"./b.tsbuildinfo"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./b/index.d.ts","linkedPackagesSignature":"4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b/src/index.ts" + ], + "original": 3 + } + ], + "packageJsons": [ + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "../b/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../b/src/index.ts", + "version": "b8f420826cc95086ac9bf1d196006850-import { current } from \"c\";\nexport const currentStage = () => current;", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "b8f420826cc95086ac9bf1d196006850-import { current } from \"c\";\nexport const currentStage = () => current;", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./b", + "rootDir": "../b/src", + "strict": true, + "tsBuildInfoFile": "./b.tsbuildinfo" + }, + "referencedMap": { + "../b/src/index.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./b/index.d.ts", + "linkedPackagesSignature": "4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 1747 +} +//// [/home/src/workspaces/solution/dist/b/index.d.ts] *new* +export declare const currentStage: () => import("c").Current; + +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"packageJsons":["../c/package.json"],"fileNames":["lib.es2026.full.d.ts","../c/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };","signature":"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","impliedNodeFormat":99}],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./c","rootDir":"../c/src","strict":true,"tsBuildInfoFile":"./c.tsbuildinfo"},"latestChangedDtsFile":"./c/index.d.ts"} +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../c/src/index.ts" + ], + "original": 2 + } + ], + "packageJsons": [ + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "../c/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "../c/src/index.ts", + "version": "24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./c", + "rootDir": "../c/src", + "strict": true, + "tsBuildInfoFile": "./c.tsbuildinfo" + }, + "latestChangedDtsFile": "./c/index.d.ts", + "size": 1456 +} +//// [/home/src/workspaces/solution/dist/c/index.d.ts] *new* +export interface Current { + readonly stage: string; +} +export declare const current: Current; + + +c/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/c/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/c/src/index.ts + +b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/b/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/b/src/index.ts + +a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/dist/b/index.d.ts +*refresh* /home/src/workspaces/solution/a/src/index.ts +Signatures:: + + +Edit [0]:: add c to dependencies of a +//// [/home/src/workspaces/solution/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"b":"1.0.0","c":"1.0.0"}} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because buildinfo file 'dist/a.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./a/index.d.ts","linkedPackagesSignature":"4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./a/index.d.ts", + "linkedPackagesSignature": "4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2041 +} +//// [/home/src/workspaces/solution/dist/a/index.d.ts] *new* +export declare const stage: import("c").Current; + + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/solution/a/src/index.ts + + +Edit [1]:: no change + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is up to date because newest input 'a/src/index.ts' is older than output 'dist/a.tsbuildinfo' + + + + +Edit [2]:: force build with c as dependency + +tsgo --b --verbose --force +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'c/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/a/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/c/index.d.ts] *rewrite with same content* + +c/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/c/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/c/src/index.ts + +b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/b/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/b/src/index.ts + +a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/dist/b/index.d.ts +*refresh* /home/src/workspaces/solution/a/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/a/src/index.ts + + +Edit [3]:: remove c from dependencies of a +//// [/home/src/workspaces/solution/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"b":"1.0.0"}} + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output 'dist/a.tsbuildinfo' is older than input 'a/package.json' + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +a/src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/src/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in a/src/index.ts:2 + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"emitDiagnosticsPerFile":[[4,[{"pos":47,"end":52,"code":2883,"category":1,"messageKey":"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883","messageArgs":["stage","../../b/node_modules/c/src/index.js","Current"]}]]],"affectedFilesPendingEmit":[[4,16]],"latestChangedDtsFile":"./a/index.d.ts","linkedPackagesSignature":"04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../a/src/index.ts", + [ + { + "pos": 47, + "end": 52, + "code": 2883, + "category": 1, + "messageKey": "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883", + "messageArgs": [ + "stage", + "../../b/node_modules/c/src/index.js", + "Current" + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../a/src/index.ts", + "DtsEmit", + [ + 4, + 16 + ] + ] + ], + "latestChangedDtsFile": "./a/index.d.ts", + "linkedPackagesSignature": "04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2268 +} + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because buildinfo file 'dist/a.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +a/src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/src/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in a/src/index.ts:2 + + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-linked-dependency-is-added-and-removed.js b/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-linked-dependency-is-added-and-removed.js new file mode 100644 index 0000000000000..6d9014a17aee9 --- /dev/null +++ b/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-linked-dependency-is-added-and-removed.js @@ -0,0 +1,804 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/a/node_modules/b] -> /home/src/workspaces/solution/b *new* +//// [/home/src/workspaces/solution/a/package.json] *new* +{"name":"a","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"b":"1.0.0"}} +//// [/home/src/workspaces/solution/a/src/index.ts] *new* +import { currentStage } from "b"; +export const stage = currentStage(); +//// [/home/src/workspaces/solution/a/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/a", + "tsBuildInfoFile": "../dist/a.tsbuildinfo" + }, + "include": ["src"], + "references": [{"path":"../b"}] +} +//// [/home/src/workspaces/solution/b/node_modules/c] -> /home/src/workspaces/solution/c *new* +//// [/home/src/workspaces/solution/b/package.json] *new* +{"name":"b","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"c":"1.0.0"}} +//// [/home/src/workspaces/solution/b/src/index.ts] *new* +import { current } from "c"; +export const currentStage = () => current; +//// [/home/src/workspaces/solution/b/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/b", + "tsBuildInfoFile": "../dist/b.tsbuildinfo" + }, + "include": ["src"], + "references": [{"path":"../c"}] +} +//// [/home/src/workspaces/solution/c/package.json] *new* +{"name":"c","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{}} +//// [/home/src/workspaces/solution/c/src/index.ts] *new* +export interface Current { readonly stage: string } +export const current: Current = { stage: "test" }; +//// [/home/src/workspaces/solution/c/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/c", + "tsBuildInfoFile": "../dist/c.tsbuildinfo" + }, + "include": ["src"], + "references": [] +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{"files":[],"references":[{"path":"./a"}]} + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is out of date because output file 'dist/c.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'c/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output file 'dist/b.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output file 'dist/a.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +a/src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/src/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in a/src/index.ts:2 + +//// [/home/src/tslibs/TS/Lib/lib.es2026.full.d.ts] *Lib* +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +interface SymbolConstructor { + (desc?: string | number): symbol; + for(name: string): symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} +declare const console: { log(msg: any): void; }; +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"emitDiagnosticsPerFile":[[4,[{"pos":47,"end":52,"code":2883,"category":1,"messageKey":"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883","messageArgs":["stage","../../b/node_modules/c/src/index.js","Current"]}]]],"affectedFilesPendingEmit":[[4,16]],"emitSignatures":[4],"linkedPackagesSignature":"04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../a/src/index.ts", + [ + { + "pos": 47, + "end": 52, + "code": 2883, + "category": 1, + "messageKey": "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883", + "messageArgs": [ + "stage", + "../../b/node_modules/c/src/index.js", + "Current" + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../a/src/index.ts", + "DtsEmit", + [ + 4, + 16 + ] + ] + ], + "emitSignatures": [ + { + "file": "../a/src/index.ts", + "original": 4 + } + ], + "linkedPackagesSignature": "04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2149 +} +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"packageJsons":["../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","../b/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n",{"version":"b8f420826cc95086ac9bf1d196006850-import { current } from \"c\";\nexport const currentStage = () => current;","signature":"40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./b","rootDir":"../b/src","strict":true,"tsBuildInfoFile":"./b.tsbuildinfo"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./b/index.d.ts","linkedPackagesSignature":"4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b/src/index.ts" + ], + "original": 3 + } + ], + "packageJsons": [ + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "../b/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../b/src/index.ts", + "version": "b8f420826cc95086ac9bf1d196006850-import { current } from \"c\";\nexport const currentStage = () => current;", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "b8f420826cc95086ac9bf1d196006850-import { current } from \"c\";\nexport const currentStage = () => current;", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./b", + "rootDir": "../b/src", + "strict": true, + "tsBuildInfoFile": "./b.tsbuildinfo" + }, + "referencedMap": { + "../b/src/index.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./b/index.d.ts", + "linkedPackagesSignature": "4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 1747 +} +//// [/home/src/workspaces/solution/dist/b/index.d.ts] *new* +export declare const currentStage: () => import("c").Current; + +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[2],"packageJsons":["../c/package.json"],"fileNames":["lib.es2026.full.d.ts","../c/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };","signature":"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","impliedNodeFormat":99}],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./c","rootDir":"../c/src","strict":true,"tsBuildInfoFile":"./c.tsbuildinfo"},"latestChangedDtsFile":"./c/index.d.ts"} +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../c/src/index.ts" + ], + "original": 2 + } + ], + "packageJsons": [ + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "../c/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "../c/src/index.ts", + "version": "24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./c", + "rootDir": "../c/src", + "strict": true, + "tsBuildInfoFile": "./c.tsbuildinfo" + }, + "latestChangedDtsFile": "./c/index.d.ts", + "size": 1456 +} +//// [/home/src/workspaces/solution/dist/c/index.d.ts] *new* +export interface Current { + readonly stage: string; +} +export declare const current: Current; + + +c/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/c/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/c/src/index.ts + +b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/b/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/b/src/index.ts + +a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/dist/b/index.d.ts +*refresh* /home/src/workspaces/solution/a/src/index.ts +Signatures:: + + +Edit [0]:: add c to dependencies of a and link it +//// [/home/src/workspaces/solution/a/node_modules/c] -> /home/src/workspaces/solution/c *new* +//// [/home/src/workspaces/solution/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"b":"1.0.0","c":"1.0.0"}} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because buildinfo file 'dist/a.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./a/index.d.ts","linkedPackagesSignature":"4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./a/index.d.ts", + "linkedPackagesSignature": "4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2041 +} +//// [/home/src/workspaces/solution/dist/a/index.d.ts] *new* +export declare const stage: import("c").Current; + + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: +(stored at emit) /home/src/workspaces/solution/a/src/index.ts + + +Edit [1]:: no change + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is up to date because newest input 'a/src/index.ts' is older than output 'dist/a.tsbuildinfo' + + + + +Edit [2]:: force build with c linked + +tsgo --b --verbose --force +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'c/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is being forcibly rebuilt + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/a/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/b/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo.readable.baseline.txt] *rewrite with same content* +//// [/home/src/workspaces/solution/dist/c/index.d.ts] *rewrite with same content* + +c/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/c/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/c/src/index.ts + +b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/b/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/b/src/index.ts + +a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/dist/b/index.d.ts +*refresh* /home/src/workspaces/solution/a/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/a/src/index.ts + + +Edit [3]:: remove c from dependencies of a and unlink it +//// [/home/src/workspaces/solution/a/node_modules/c] *deleted* +//// [/home/src/workspaces/solution/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"b":"1.0.0"}} + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output 'dist/a.tsbuildinfo' is older than input 'a/package.json' + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +a/src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/src/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in a/src/index.ts:2 + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"emitDiagnosticsPerFile":[[4,[{"pos":47,"end":52,"code":2883,"category":1,"messageKey":"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883","messageArgs":["stage","../../b/node_modules/c/src/index.js","Current"]}]]],"affectedFilesPendingEmit":[[4,16]],"latestChangedDtsFile":"./a/index.d.ts","linkedPackagesSignature":"04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "signature": "40ef1c8da751da23c9139542eea9f276-export declare const currentStage: () => import(\"c\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../a/src/index.ts", + [ + { + "pos": 47, + "end": 52, + "code": 2883, + "category": 1, + "messageKey": "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883", + "messageArgs": [ + "stage", + "../../b/node_modules/c/src/index.js", + "Current" + ] + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "../a/src/index.ts", + "DtsEmit", + [ + 4, + 16 + ] + ] + ], + "latestChangedDtsFile": "./a/index.d.ts", + "linkedPackagesSignature": "04e79a34ca0664260ef3cb0a2f610cdd-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2268 +} + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [4]:: no change + +tsgo --b --verbose +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/index.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because buildinfo file 'dist/a.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +a/src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/src/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in a/src/index.ts:2 + + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-types-entry-of-linked-package-changes.js b/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-types-entry-of-linked-package-changes.js new file mode 100644 index 0000000000000..71882a3859695 --- /dev/null +++ b/tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/updates-declaration-emit-when-types-entry-of-linked-package-changes.js @@ -0,0 +1,896 @@ +currentDirectory::/home/src/workspaces/solution +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/solution/a/node_modules/b] -> /home/src/workspaces/solution/b *new* +//// [/home/src/workspaces/solution/a/node_modules/c] -> /home/src/workspaces/solution/c *new* +//// [/home/src/workspaces/solution/a/package.json] *new* +{"name":"a","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"b":"1.0.0","c":"1.0.0"}} +//// [/home/src/workspaces/solution/a/src/index.ts] *new* +import { currentStage } from "b"; +export const stage = currentStage(); +//// [/home/src/workspaces/solution/a/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/a", + "tsBuildInfoFile": "../dist/a.tsbuildinfo" + }, + "include": ["src"], + "references": [{"path":"../b"}] +} +//// [/home/src/workspaces/solution/b/node_modules/c] -> /home/src/workspaces/solution/c *new* +//// [/home/src/workspaces/solution/b/package.json] *new* +{"name":"b","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{"c":"1.0.0"}} +//// [/home/src/workspaces/solution/b/src/index.ts] *new* +import { current } from "c/src/index.js"; +export const currentStage = () => current; +//// [/home/src/workspaces/solution/b/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/b", + "tsBuildInfoFile": "../dist/b.tsbuildinfo" + }, + "include": ["src"], + "references": [{"path":"../c"}] +} +//// [/home/src/workspaces/solution/c/package.json] *new* +{"name":"c","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{}} +//// [/home/src/workspaces/solution/c/src/index.ts] *new* +export interface Current { readonly stage: string } +export const current: Current = { stage: "test" }; +//// [/home/src/workspaces/solution/c/src/main.ts] *new* +export const version = "1.0.0"; +//// [/home/src/workspaces/solution/c/tsconfig.json] *new* +{ + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "../dist/c", + "tsBuildInfoFile": "../dist/c.tsbuildinfo" + }, + "include": ["src"], + "references": [] +} +//// [/home/src/workspaces/solution/tsconfig.json] *new* +{"files":[],"references":[{"path":"./a"}]} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is out of date because output file 'dist/c.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'c/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output file 'dist/b.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output file 'dist/a.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +//// [/home/src/tslibs/TS/Lib/lib.es2026.full.d.ts] *Lib* +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +interface SymbolConstructor { + (desc?: string | number): symbol; + for(name: string): symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} +declare const console: { log(msg: any): void; }; +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"missingPackageJsons":["../b/node_modules/c/src/index.js/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./a/index.d.ts","linkedPackagesSignature":"4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "missingPackageJsons": [ + "../b/node_modules/c/src/index.js/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./a/index.d.ts", + "linkedPackagesSignature": "4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2126 +} +//// [/home/src/workspaces/solution/dist/a/index.d.ts] *new* +export declare const stage: import("c").Current; + +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[3],"packageJsons":["../b/package.json","../c/package.json"],"missingPackageJsons":["../b/node_modules/c/src/index.js/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","../b/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n",{"version":"1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;","signature":"d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./b","rootDir":"../b/src","strict":true,"tsBuildInfoFile":"./b.tsbuildinfo"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./b/index.d.ts","linkedPackagesSignature":"4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b/src/index.ts" + ], + "original": 3 + } + ], + "packageJsons": [ + "../b/package.json", + "../c/package.json" + ], + "missingPackageJsons": [ + "../b/node_modules/c/src/index.js/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "../b/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../b/src/index.ts", + "version": "1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./b", + "rootDir": "../b/src", + "strict": true, + "tsBuildInfoFile": "./b.tsbuildinfo" + }, + "referencedMap": { + "../b/src/index.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./b/index.d.ts", + "linkedPackagesSignature": "4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 1845 +} +//// [/home/src/workspaces/solution/dist/b/index.d.ts] *new* +export declare const currentStage: () => import("c/src/index.js").Current; + +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[[2,3]],"packageJsons":["../c/package.json"],"fileNames":["lib.es2026.full.d.ts","../c/src/index.ts","../c/src/main.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };","signature":"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","impliedNodeFormat":99},{"version":"8c62520a4c541b0aab40e2e7abefd466-export const version = \"1.0.0\";","signature":"1b669051a90e86443f194e6eeaf4bfd6-export declare const version = \"1.0.0\";\n","impliedNodeFormat":99}],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./c","rootDir":"../c/src","strict":true,"tsBuildInfoFile":"./c.tsbuildinfo"},"latestChangedDtsFile":"./c/main.d.ts"} +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../c/src/index.ts", + "../c/src/main.ts" + ], + "original": [ + 2, + 3 + ] + } + ], + "packageJsons": [ + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "../c/src/index.ts", + "../c/src/main.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "../c/src/index.ts", + "version": "24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "24adc195ff28658d712c9b893a84480c-export interface Current { readonly stage: string }\nexport const current: Current = { stage: \"test\" };", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "../c/src/main.ts", + "version": "8c62520a4c541b0aab40e2e7abefd466-export const version = \"1.0.0\";", + "signature": "1b669051a90e86443f194e6eeaf4bfd6-export declare const version = \"1.0.0\";\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "8c62520a4c541b0aab40e2e7abefd466-export const version = \"1.0.0\";", + "signature": "1b669051a90e86443f194e6eeaf4bfd6-export declare const version = \"1.0.0\";\n", + "impliedNodeFormat": 99 + } + } + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./c", + "rootDir": "../c/src", + "strict": true, + "tsBuildInfoFile": "./c.tsbuildinfo" + }, + "latestChangedDtsFile": "./c/main.d.ts", + "size": 1673 +} +//// [/home/src/workspaces/solution/dist/c/index.d.ts] *new* +export interface Current { + readonly stage: string; +} +export declare const current: Current; + +//// [/home/src/workspaces/solution/dist/c/main.d.ts] *new* +export declare const version = "1.0.0"; + + +c/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/c/src/index.ts +*refresh* /home/src/workspaces/solution/c/src/main.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/c/src/index.ts +(stored at emit) /home/src/workspaces/solution/c/src/main.ts + +b/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/b/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/b/src/index.ts + +a/tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/solution/dist/c/index.d.ts +*refresh* /home/src/workspaces/solution/dist/b/index.d.ts +*refresh* /home/src/workspaces/solution/a/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/solution/a/src/index.ts + + +Edit [0]:: point types of c to another entry +//// [/home/src/workspaces/solution/c/package.json] *modified* +{"name":"c","version":"1.0.0","type":"module","types":"./src/main.ts","dependencies":{}} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is out of date because output 'dist/c.tsbuildinfo' is older than input 'c/package.json' + +[HH:MM:SS AM] Building project 'c/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'c/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output 'dist/b.tsbuildinfo' is older than input 'c/package.json' + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output 'dist/a.tsbuildinfo' is older than input 'c/package.json' + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"missingPackageJsons":["../a/node_modules/c/src/package.json","../b/node_modules/c/src/index.js/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./a/index.d.ts","emitSignatures":[[4,"166dc830f76f60dbfa1d5ff8e21580de-export declare const stage: import(\"c/src/index.js\").Current;\n"]],"linkedPackagesSignature":"ca9e47fc1014921dc12a88579e08a64f-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/main.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/main.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "missingPackageJsons": [ + "../a/node_modules/c/src/package.json", + "../b/node_modules/c/src/index.js/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./a/index.d.ts", + "emitSignatures": [ + { + "file": "../a/src/index.ts", + "signature": "166dc830f76f60dbfa1d5ff8e21580de-export declare const stage: import(\"c/src/index.js\").Current;\n", + "original": [ + 4, + "166dc830f76f60dbfa1d5ff8e21580de-export declare const stage: import(\"c/src/index.js\").Current;\n" + ] + } + ], + "linkedPackagesSignature": "ca9e47fc1014921dc12a88579e08a64f-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/main.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/main.ts\"}", + "size": 2287 +} +//// [/home/src/workspaces/solution/dist/a/index.d.ts] *modified* +export declare const stage: import("c/src/index.js").Current; + +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[3],"packageJsons":["../b/package.json","../c/package.json"],"missingPackageJsons":["../b/node_modules/c/src/index.js/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","../b/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n",{"version":"1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;","signature":"d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./b","rootDir":"../b/src","strict":true,"tsBuildInfoFile":"./b.tsbuildinfo"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./b/index.d.ts","linkedPackagesSignature":"c5ecd082717da8ef06fba01d6c5e6021-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/main.ts\"}"} +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b/src/index.ts" + ], + "original": 3 + } + ], + "packageJsons": [ + "../b/package.json", + "../c/package.json" + ], + "missingPackageJsons": [ + "../b/node_modules/c/src/index.js/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "../b/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../b/src/index.ts", + "version": "1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./b", + "rootDir": "../b/src", + "strict": true, + "tsBuildInfoFile": "./b.tsbuildinfo" + }, + "referencedMap": { + "../b/src/index.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./b/index.d.ts", + "linkedPackagesSignature": "c5ecd082717da8ef06fba01d6c5e6021-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/main.ts\"}", + "size": 1844 +} +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo] *mTime changed* + +c/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +b/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: no change + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/main.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is up to date because newest input 'a/src/index.ts' is older than output 'dist/a.tsbuildinfo' + + + + +Edit [2]:: point types of c back to index +//// [/home/src/workspaces/solution/c/package.json] *modified* +{"name":"c","version":"1.0.0","type":"module","types":"./src/index.ts","dependencies":{}} + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is out of date because output 'dist/c.tsbuildinfo' is older than input 'c/package.json' + +[HH:MM:SS AM] Building project 'c/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project 'c/tsconfig.json'... + +[HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output 'dist/b.tsbuildinfo' is older than input 'c/package.json' + +[HH:MM:SS AM] Building project 'b/tsconfig.json'... + +[HH:MM:SS AM] Project 'a/tsconfig.json' is out of date because output 'dist/a.tsbuildinfo' is older than input 'c/package.json' + +[HH:MM:SS AM] Building project 'a/tsconfig.json'... + +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["../a/package.json","../b/package.json","../c/package.json"],"missingPackageJsons":["../b/node_modules/c/src/index.js/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","./b/index.d.ts","../a/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n","d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n",{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./a","rootDir":"../a/src","strict":true,"tsBuildInfoFile":"./a.tsbuildinfo"},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./a/index.d.ts","linkedPackagesSignature":"4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/a.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../a/src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "../a/package.json", + "../b/package.json", + "../c/package.json" + ], + "missingPackageJsons": [ + "../b/node_modules/c/src/index.js/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "./b/index.d.ts", + "../a/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "./b/index.d.ts", + "version": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../a/src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./b/index.d.ts" + ], + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./a", + "rootDir": "../a/src", + "strict": true, + "tsBuildInfoFile": "./a.tsbuildinfo" + }, + "referencedMap": { + "../a/src/index.ts": [ + "./b/index.d.ts" + ], + "./b/index.d.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./a/index.d.ts", + "linkedPackagesSignature": "4084db9a06666b3db4e907ff7b41bf9a-../a/node_modules/b -> ../b {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../a/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}\n../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 2126 +} +//// [/home/src/workspaces/solution/dist/a/index.d.ts] *modified* +export declare const stage: import("c").Current; + +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[3],"packageJsons":["../b/package.json","../c/package.json"],"missingPackageJsons":["../b/node_modules/c/src/index.js/package.json"],"fileNames":["lib.es2026.full.d.ts","./c/index.d.ts","../b/src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n",{"version":"1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;","signature":"d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[2]],"options":{"composite":true,"emitDeclarationOnly":true,"module":199,"noEmitOnError":true,"outDir":"./b","rootDir":"../b/src","strict":true,"tsBuildInfoFile":"./b.tsbuildinfo"},"referencedMap":[[3,1]],"latestChangedDtsFile":"./b/index.d.ts","linkedPackagesSignature":"4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}"} +//// [/home/src/workspaces/solution/dist/b.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "../b/src/index.ts" + ], + "original": 3 + } + ], + "packageJsons": [ + "../b/package.json", + "../c/package.json" + ], + "missingPackageJsons": [ + "../b/node_modules/c/src/index.js/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "./c/index.d.ts", + "../b/src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "./c/index.d.ts", + "version": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "signature": "772688f640dfff8943755b05148ff770-export interface Current {\n readonly stage: string;\n}\nexport declare const current: Current;\n", + "impliedNodeFormat": "CommonJS" + }, + { + "fileName": "../b/src/index.ts", + "version": "1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "1be45da9493d61c890e76e46bc9e35a5-import { current } from \"c/src/index.js\";\nexport const currentStage = () => current;", + "signature": "d1346b3ed40bf05c6a20fa24037a99a2-export declare const currentStage: () => import(\"c/src/index.js\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "./c/index.d.ts" + ] + ], + "options": { + "composite": true, + "emitDeclarationOnly": true, + "module": 199, + "noEmitOnError": true, + "outDir": "./b", + "rootDir": "../b/src", + "strict": true, + "tsBuildInfoFile": "./b.tsbuildinfo" + }, + "referencedMap": { + "../b/src/index.ts": [ + "./c/index.d.ts" + ] + }, + "latestChangedDtsFile": "./b/index.d.ts", + "linkedPackagesSignature": "4dbc6d9418bcdb28e07fe377c23d870e-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./src/index.ts\"}", + "size": 1845 +} +//// [/home/src/workspaces/solution/dist/c.tsbuildinfo] *mTime changed* + +c/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +b/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + +a/tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: no change + +tsgo --b --verbose +ExitStatus:: Success +Output:: +[HH:MM:SS AM] Projects in this build: + * c/tsconfig.json + * b/tsconfig.json + * a/tsconfig.json + * tsconfig.json + +[HH:MM:SS AM] Project 'c/tsconfig.json' is up to date because newest input 'c/src/main.ts' is older than output 'dist/c.tsbuildinfo' + +[HH:MM:SS AM] Project 'b/tsconfig.json' is up to date because newest input 'b/src/index.ts' is older than output 'dist/b.tsbuildinfo' + +[HH:MM:SS AM] Project 'a/tsconfig.json' is up to date because newest input 'a/src/index.ts' is older than output 'dist/a.tsbuildinfo' + + diff --git a/tsc/testdata/baselines/reference/tsbuild/inferredTypeFromMonorepoReference/inferred-type-from-referenced-project-that-references-another-project-in-monorepo.js b/tsc/testdata/baselines/reference/tsbuild/inferredTypeFromMonorepoReference/inferred-type-from-referenced-project-that-references-another-project-in-monorepo.js index f46592f3d930f..1163cacaa8a46 100644 --- a/tsc/testdata/baselines/reference/tsbuild/inferredTypeFromMonorepoReference/inferred-type-from-referenced-project-that-references-another-project-in-monorepo.js +++ b/tsc/testdata/baselines/reference/tsbuild/inferredTypeFromMonorepoReference/inferred-type-from-referenced-project-that-references-another-project-in-monorepo.js @@ -178,7 +178,7 @@ declare class MyClass { export { MyClass }; //// [/home/src/workspaces/solution/packages/package-a/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[4],"packageJsons":["./package.json","../package-b/package.json","../package-c/package.json"],"fileNames":["lib.es2022.full.d.ts","../package-c/out/index.d.ts","../package-b/out/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fda98a6734eab276b5c9c8694ee117da-export interface MyType {\n id: string;\n name: string;\n enabled: boolean;\n}\n","c244312b1cf9f2fd4ddd2d16bb44d0b9-import type { MyType } from \"package-c\";\nexport declare function createThing(input: MyType): MyType;\n",{"version":"1b8e37ecd837c2f357c793c86828b133-import { createThing } from \"package-b\";\n\nclass MyClass {\n public thing = createThing({ id: \"1\", name: \"test\", enabled: true });\n}\n\nexport { MyClass };","signature":"f0d3d8e75bf995728f62a7d715cdf8a8-declare class MyClass {\n thing: import(\"package-c\").MyType;\n}\nexport { MyClass };\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"declaration":true,"module":99,"outDir":"./out","rootDir":"./src","target":9},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./out/index.d.ts"} +{"version":"FakeTSVersion","root":[4],"packageJsons":["./package.json","../package-b/package.json","../package-c/package.json"],"fileNames":["lib.es2022.full.d.ts","../package-c/out/index.d.ts","../package-b/out/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fda98a6734eab276b5c9c8694ee117da-export interface MyType {\n id: string;\n name: string;\n enabled: boolean;\n}\n","c244312b1cf9f2fd4ddd2d16bb44d0b9-import type { MyType } from \"package-c\";\nexport declare function createThing(input: MyType): MyType;\n",{"version":"1b8e37ecd837c2f357c793c86828b133-import { createThing } from \"package-b\";\n\nclass MyClass {\n public thing = createThing({ id: \"1\", name: \"test\", enabled: true });\n}\n\nexport { MyClass };","signature":"f0d3d8e75bf995728f62a7d715cdf8a8-declare class MyClass {\n thing: import(\"package-c\").MyType;\n}\nexport { MyClass };\n","impliedNodeFormat":1}],"fileIdsList":[[3],[2]],"options":{"composite":true,"emitDeclarationOnly":true,"declaration":true,"module":99,"outDir":"./out","rootDir":"./src","target":9},"referencedMap":[[4,1],[3,2]],"latestChangedDtsFile":"./out/index.d.ts","linkedPackagesSignature":"ea22790ab2f245f5bdf0bd0e6ce340e7-../../node_modules/package-b -> ../package-b {\"type\":\"module\",\"main\":\"./src/index.ts\",\"types\":\"./src/index.ts\",\"exports\":{\".\":\"./src/index.ts\"}}\n../../node_modules/package-c -> ../package-c {\"type\":\"module\",\"main\":\"./src/index.ts\",\"types\":\"./src/index.ts\",\"exports\":{\".\":\"./src/index.ts\"}}"} //// [/home/src/workspaces/solution/packages/package-a/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -264,14 +264,15 @@ export { MyClass }; ] }, "latestChangedDtsFile": "./out/index.d.ts", - "size": 1896 + "linkedPackagesSignature": "ea22790ab2f245f5bdf0bd0e6ce340e7-../../node_modules/package-b -> ../package-b {\"type\":\"module\",\"main\":\"./src/index.ts\",\"types\":\"./src/index.ts\",\"exports\":{\".\":\"./src/index.ts\"}}\n../../node_modules/package-c -> ../package-c {\"type\":\"module\",\"main\":\"./src/index.ts\",\"types\":\"./src/index.ts\",\"exports\":{\".\":\"./src/index.ts\"}}", + "size": 2284 } //// [/home/src/workspaces/solution/packages/package-b/out/index.d.ts] *new* import type { MyType } from "package-c"; export declare function createThing(input: MyType): MyType; //// [/home/src/workspaces/solution/packages/package-b/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[3],"packageJsons":["./package.json","../package-c/package.json"],"fileNames":["lib.es2022.full.d.ts","../package-c/out/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fda98a6734eab276b5c9c8694ee117da-export interface MyType {\n id: string;\n name: string;\n enabled: boolean;\n}\n",{"version":"fbb82e716b8d6d09c2f530e11f7c8614-import type { MyType } from \"package-c\";\n\nexport function createThing(input: MyType): MyType {\n return { ...input };\n}","signature":"c244312b1cf9f2fd4ddd2d16bb44d0b9-import type { MyType } from \"package-c\";\nexport declare function createThing(input: MyType): MyType;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"emitDeclarationOnly":true,"declaration":true,"module":99,"outDir":"./out","rootDir":"./src","target":9},"referencedMap":[[3,1]],"latestChangedDtsFile":"./out/index.d.ts"} +{"version":"FakeTSVersion","root":[3],"packageJsons":["./package.json","../package-c/package.json"],"fileNames":["lib.es2022.full.d.ts","../package-c/out/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"fda98a6734eab276b5c9c8694ee117da-export interface MyType {\n id: string;\n name: string;\n enabled: boolean;\n}\n",{"version":"fbb82e716b8d6d09c2f530e11f7c8614-import type { MyType } from \"package-c\";\n\nexport function createThing(input: MyType): MyType {\n return { ...input };\n}","signature":"c244312b1cf9f2fd4ddd2d16bb44d0b9-import type { MyType } from \"package-c\";\nexport declare function createThing(input: MyType): MyType;\n","impliedNodeFormat":1}],"fileIdsList":[[2]],"options":{"composite":true,"emitDeclarationOnly":true,"declaration":true,"module":99,"outDir":"./out","rootDir":"./src","target":9},"referencedMap":[[3,1]],"latestChangedDtsFile":"./out/index.d.ts","linkedPackagesSignature":"40fbea8d1cc68fbb24e35bab38f9d278-../../node_modules/package-c -> ../package-c {\"type\":\"module\",\"main\":\"./src/index.ts\",\"types\":\"./src/index.ts\",\"exports\":{\".\":\"./src/index.ts\"}}"} //// [/home/src/workspaces/solution/packages/package-b/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -343,7 +344,8 @@ export declare function createThing(input: MyType): MyType; ] }, "latestChangedDtsFile": "./out/index.d.ts", - "size": 1662 + "linkedPackagesSignature": "40fbea8d1cc68fbb24e35bab38f9d278-../../node_modules/package-c -> ../package-c {\"type\":\"module\",\"main\":\"./src/index.ts\",\"types\":\"./src/index.ts\",\"exports\":{\".\":\"./src/index.ts\"}}", + "size": 1886 } //// [/home/src/workspaces/solution/packages/package-c/out/index.d.ts] *new* export interface MyType { diff --git a/tsc/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js b/tsc/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js index 560625f57cd6e..9b1949947bc19 100644 --- a/tsc/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js +++ b/tsc/testdata/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js @@ -170,7 +170,7 @@ export class LassieDog extends Dog { } //// [/home/src/workspaces/packages/src-dogs/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[4,8]],"packageJsons":["./package.json","../src-types/package.json"],"fileNames":["lib.es2026.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":"e1943411d89cafd8c6f5a028539f5775-import { Dog } from '../dog.js';\nexport declare class LassieDog extends Dog {\n protected static getDogConfig: () => import(\"src-types\").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"} +{"version":"FakeTSVersion","root":[[4,8]],"packageJsons":["./package.json","../src-types/package.json"],"fileNames":["lib.es2026.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":"e1943411d89cafd8c6f5a028539f5775-import { Dog } from '../dog.js';\nexport declare class LassieDog extends Dog {\n protected static getDogConfig: () => import(\"src-types\").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","linkedPackagesSignature":"20f15c05377c729800a38999a272ff8a-node_modules/src-types -> ../src-types {\"type\":\"module\",\"exports\":\"./index.js\"}"} //// [/home/src/workspaces/packages/src-dogs/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -341,7 +341,8 @@ export class LassieDog extends Dog { ] }, "latestChangedDtsFile": "./index.d.ts", - "size": 3278 + "linkedPackagesSignature": "20f15c05377c729800a38999a272ff8a-node_modules/src-types -> ../src-types {\"type\":\"module\",\"exports\":\"./index.js\"}", + "size": 3427 } //// [/home/src/workspaces/packages/src-types/dogconfig.d.ts] *new* export interface DogConfig { diff --git a/tsc/testdata/baselines/reference/tsc/incremental/updates-declaration-emit-when-linked-dependency-is-removed-and-added.js b/tsc/testdata/baselines/reference/tsc/incremental/updates-declaration-emit-when-linked-dependency-is-removed-and-added.js new file mode 100644 index 0000000000000..8beb7301231b2 --- /dev/null +++ b/tsc/testdata/baselines/reference/tsc/incremental/updates-declaration-emit-when-linked-dependency-is-removed-and-added.js @@ -0,0 +1,447 @@ +currentDirectory::/home/src/workspaces/project/a +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a/node_modules/b] -> /home/src/workspaces/project/b *new* +//// [/home/src/workspaces/project/a/node_modules/c] -> /home/src/workspaces/project/c *new* +//// [/home/src/workspaces/project/a/package.json] *new* +{"name":"a","version":"1.0.0","type":"module","dependencies":{"b":"1.0.0","c":"1.0.0"}} +//// [/home/src/workspaces/project/a/src/index.ts] *new* +import { currentStage } from "b"; +export const stage = currentStage(); +//// [/home/src/workspaces/project/a/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"] +} +//// [/home/src/workspaces/project/b/index.d.ts] *new* +export declare const currentStage: () => import("c").Current; +//// [/home/src/workspaces/project/b/node_modules/c] -> /home/src/workspaces/project/c *new* +//// [/home/src/workspaces/project/b/package.json] *new* +{"name":"b","version":"1.0.0","type":"module","types":"./index.d.ts","dependencies":{"c":"1.0.0"}} +//// [/home/src/workspaces/project/c/index.d.ts] *new* +export interface Current { readonly stage: string } +export declare const current: Current; +//// [/home/src/workspaces/project/c/package.json] *new* +{"name":"c","version":"1.0.0","type":"module","types":"./index.d.ts"} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/tslibs/TS/Lib/lib.es2026.full.d.ts] *Lib* +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +interface SymbolConstructor { + (desc?: string | number): symbol; + for(name: string): symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} +declare const console: { log(msg: any): void; }; +//// [/home/src/workspaces/project/a/dist/index.d.ts] *new* +export declare const stage: import("c").Current; + +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo] *new* +{"version":"FakeTSVersion","root":[4],"packageJsons":["./package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","../c/index.d.ts","../b/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;","impliedNodeFormat":99},{"version":"439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;","impliedNodeFormat":99},{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"emitDeclarationOnly":true,"declaration":true,"module":199,"outDir":"./dist","rootDir":"./src","strict":true},"referencedMap":[[4,1],[3,2]],"linkedPackagesSignature":"9844832280f0943052ed1bc773a3e082-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/b -> ../b {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}"} +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo.readable.baseline.txt] *new* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "./package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "../c/index.d.ts", + "../b/index.d.ts", + "./src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "../c/index.d.ts", + "version": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "signature": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "../b/index.d.ts", + "version": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "signature": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "../b/index.d.ts" + ], + [ + "../c/index.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": true, + "declaration": true, + "module": 199, + "outDir": "./dist", + "rootDir": "./src", + "strict": true + }, + "referencedMap": { + "./src/index.ts": [ + "../b/index.d.ts" + ], + "../b/index.d.ts": [ + "../c/index.d.ts" + ] + }, + "linkedPackagesSignature": "9844832280f0943052ed1bc773a3e082-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/b -> ../b {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}", + "size": 1985 +} + +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/project/c/index.d.ts +*refresh* /home/src/workspaces/project/b/index.d.ts +*refresh* /home/src/workspaces/project/a/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a/src/index.ts + + +Edit [0]:: remove c from dependencies and unlink it +//// [/home/src/workspaces/project/a/node_modules/c] *deleted* +//// [/home/src/workspaces/project/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","dependencies":{"b":"1.0.0"}} + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in src/index.ts:2 + +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["./package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","../c/index.d.ts","../b/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;","impliedNodeFormat":99},{"version":"439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;","impliedNodeFormat":99},{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"emitDeclarationOnly":true,"declaration":true,"module":199,"outDir":"./dist","rootDir":"./src","strict":true},"referencedMap":[[4,1],[3,2]],"emitDiagnosticsPerFile":[[4,[{"pos":47,"end":52,"code":2883,"category":1,"messageKey":"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883","messageArgs":["stage","../../b/node_modules/c/index.js","Current"]}]]],"linkedPackagesSignature":"866bdb0650462f3cc900f7a922d6d0a4-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/b -> ../b {\"type\":\"module\",\"types\":\"./index.d.ts\"}"} +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "./package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "../c/index.d.ts", + "../b/index.d.ts", + "./src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "../c/index.d.ts", + "version": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "signature": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "../b/index.d.ts", + "version": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "signature": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "../b/index.d.ts" + ], + [ + "../c/index.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": true, + "declaration": true, + "module": 199, + "outDir": "./dist", + "rootDir": "./src", + "strict": true + }, + "referencedMap": { + "./src/index.ts": [ + "../b/index.d.ts" + ], + "../b/index.d.ts": [ + "../c/index.d.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "./src/index.ts", + [ + { + "pos": 47, + "end": 52, + "code": 2883, + "category": 1, + "messageKey": "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_2883", + "messageArgs": [ + "stage", + "../../b/node_modules/c/index.js", + "Current" + ] + } + ] + ] + ], + "linkedPackagesSignature": "866bdb0650462f3cc900f7a922d6d0a4-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/b -> ../b {\"type\":\"module\",\"types\":\"./index.d.ts\"}", + "size": 2179 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: no change + +tsgo +ExitStatus:: DiagnosticsPresent_OutputsSkipped +Output:: +src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in src/index.ts:2 + + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [2]:: add c to dependencies and link it +//// [/home/src/workspaces/project/a/node_modules/c] -> /home/src/workspaces/project/c *new* +//// [/home/src/workspaces/project/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","dependencies":{"b":"1.0.0","c":"1.0.0"}} + +tsgo +ExitStatus:: Success +Output:: +//// [/home/src/workspaces/project/a/dist/index.d.ts] *rewrite with same content* +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo] *modified* +{"version":"FakeTSVersion","root":[4],"packageJsons":["./package.json","../b/package.json","../c/package.json"],"fileNames":["lib.es2026.full.d.ts","../c/index.d.ts","../b/index.d.ts","./src/index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;","impliedNodeFormat":99},{"version":"439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;","impliedNodeFormat":99},{"version":"58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();","signature":"620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n","impliedNodeFormat":99}],"fileIdsList":[[3],[2]],"options":{"emitDeclarationOnly":true,"declaration":true,"module":199,"outDir":"./dist","rootDir":"./src","strict":true},"referencedMap":[[4,1],[3,2]],"linkedPackagesSignature":"9844832280f0943052ed1bc773a3e082-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/b -> ../b {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}"} +//// [/home/src/workspaces/project/a/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* +{ + "version": "FakeTSVersion", + "root": [ + { + "files": [ + "./src/index.ts" + ], + "original": 4 + } + ], + "packageJsons": [ + "./package.json", + "../b/package.json", + "../c/package.json" + ], + "fileNames": [ + "lib.es2026.full.d.ts", + "../c/index.d.ts", + "../b/index.d.ts", + "./src/index.ts" + ], + "fileInfos": [ + { + "fileName": "lib.es2026.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": "../c/index.d.ts", + "version": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "signature": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "84e857cae1dadf8646c736e92d69dd7f-export interface Current { readonly stage: string }\nexport declare const current: Current;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "../b/index.d.ts", + "version": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "signature": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "impliedNodeFormat": "ESNext", + "original": { + "version": "439fc1840141ec93ccca8462af32e6f0-export declare const currentStage: () => import(\"c\").Current;", + "impliedNodeFormat": 99 + } + }, + { + "fileName": "./src/index.ts", + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": "ESNext", + "original": { + "version": "58d3d85f395f5825bc9d710f0024af35-import { currentStage } from \"b\";\nexport const stage = currentStage();", + "signature": "620c9be1975f68589ff91cdbbde3297b-export declare const stage: import(\"c\").Current;\n", + "impliedNodeFormat": 99 + } + } + ], + "fileIdsList": [ + [ + "../b/index.d.ts" + ], + [ + "../c/index.d.ts" + ] + ], + "options": { + "emitDeclarationOnly": true, + "declaration": true, + "module": 199, + "outDir": "./dist", + "rootDir": "./src", + "strict": true + }, + "referencedMap": { + "./src/index.ts": [ + "../b/index.d.ts" + ], + "../b/index.d.ts": [ + "../c/index.d.ts" + ] + }, + "linkedPackagesSignature": "9844832280f0943052ed1bc773a3e082-../b/node_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/b -> ../b {\"type\":\"module\",\"types\":\"./index.d.ts\"}\nnode_modules/c -> ../c {\"type\":\"module\",\"types\":\"./index.d.ts\"}", + "size": 1985 +} + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [3]:: no change + +tsgo +ExitStatus:: Success +Output:: + +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: diff --git a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-updates-declaration-emit-when-linked-dependency-is-removed-and-added.js b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-updates-declaration-emit-when-linked-dependency-is-removed-and-added.js new file mode 100644 index 0000000000000..f98df2d5ebdab --- /dev/null +++ b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-updates-declaration-emit-when-linked-dependency-is-removed-and-added.js @@ -0,0 +1,158 @@ +currentDirectory::/home/src/workspaces/project/a +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/a/node_modules/b] -> /home/src/workspaces/project/b *new* +//// [/home/src/workspaces/project/a/node_modules/c] -> /home/src/workspaces/project/c *new* +//// [/home/src/workspaces/project/a/package.json] *new* +{"name":"a","version":"1.0.0","type":"module","dependencies":{"b":"1.0.0","c":"1.0.0"}} +//// [/home/src/workspaces/project/a/src/index.ts] *new* +import { currentStage } from "b"; +export const stage = currentStage(); +//// [/home/src/workspaces/project/a/tsconfig.json] *new* +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "module": "nodenext", + "types": [], + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"] +} +//// [/home/src/workspaces/project/b/index.d.ts] *new* +export declare const currentStage: () => import("c").Current; +//// [/home/src/workspaces/project/b/node_modules/c] -> /home/src/workspaces/project/c *new* +//// [/home/src/workspaces/project/b/package.json] *new* +{"name":"b","version":"1.0.0","type":"module","types":"./index.d.ts","dependencies":{"c":"1.0.0"}} +//// [/home/src/workspaces/project/c/index.d.ts] *new* +export interface Current { readonly stage: string } +export declare const current: Current; +//// [/home/src/workspaces/project/c/package.json] *new* +{"name":"c","version":"1.0.0","type":"module","types":"./index.d.ts"} + +tsgo --watch --incremental false +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.es2026.full.d.ts] *Lib* +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +interface SymbolConstructor { + (desc?: string | number): symbol; + for(name: string): symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} +declare const console: { log(msg: any): void; }; +//// [/home/src/workspaces/project/a/dist/index.d.ts] *new* +export declare const stage: import("c").Current; + + +Watch Registrations:: +Directory watches:: + /home/src/tslibs/TS/Lib + /home/src/workspaces/project + /home/src/workspaces/project/a + /home/src/workspaces/project/a/node_modules + /home/src/workspaces/project/a/node_modules/b + /home/src/workspaces/project/a/node_modules/c + /home/src/workspaces/project/a/src (recursive) + /home/src/workspaces/project/b + /home/src/workspaces/project/b/node_modules + /home/src/workspaces/project/b/node_modules/c + /home/src/workspaces/project/c +tsconfig.json:: +SemanticDiagnostics:: +*refresh* /home/src/tslibs/TS/Lib/lib.es2026.full.d.ts +*refresh* /home/src/workspaces/project/c/index.d.ts +*refresh* /home/src/workspaces/project/b/index.d.ts +*refresh* /home/src/workspaces/project/a/src/index.ts +Signatures:: +(stored at emit) /home/src/workspaces/project/a/src/index.ts + + +Edit [0]:: remove c from dependencies and unlink it +//// [/home/src/workspaces/project/a/node_modules/c] *deleted* +//// [/home/src/workspaces/project/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","dependencies":{"b":"1.0.0"}} + + +Output:: +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/index.ts:2:14 - error TS2883: The inferred type of 'stage' cannot be named without a reference to 'Current' from '../../b/node_modules/c/index.js'. This is likely not portable. A type annotation is necessary. + +2 export const stage = currentStage(); +   ~~~~~ + + +Found 1 error in src/index.ts:2 + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + +Watch Registrations:: +Directory watches:: + /home/src/tslibs/TS/Lib + /home/src/workspaces/project + /home/src/workspaces/project/a + /home/src/workspaces/project/a/node_modules + /home/src/workspaces/project/a/node_modules/b + /home/src/workspaces/project/a/src (recursive) + /home/src/workspaces/project/b + /home/src/workspaces/project/b/node_modules + /home/src/workspaces/project/b/node_modules/c + /home/src/workspaces/project/c +tsconfig.json:: +SemanticDiagnostics:: +Signatures:: + + +Edit [1]:: add c to dependencies and link it +//// [/home/src/workspaces/project/a/node_modules/c] -> /home/src/workspaces/project/c *new* +//// [/home/src/workspaces/project/a/package.json] *modified* +{"name":"a","version":"1.0.0","type":"module","dependencies":{"b":"1.0.0","c":"1.0.0"}} + + +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/a/dist/index.d.ts] *rewrite with same content* + +Watch Registrations:: +Directory watches:: + /home/src/tslibs/TS/Lib + /home/src/workspaces/project + /home/src/workspaces/project/a + /home/src/workspaces/project/a/node_modules + /home/src/workspaces/project/a/node_modules/b + /home/src/workspaces/project/a/node_modules/c + /home/src/workspaces/project/a/src (recursive) + /home/src/workspaces/project/b + /home/src/workspaces/project/b/node_modules + /home/src/workspaces/project/b/node_modules/c + /home/src/workspaces/project/c +tsconfig.json:: +SemanticDiagnostics:: +Signatures::